diff options
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/parser/vocabulary.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp index 483fae277c..387ddef8bf 100644 --- a/engines/sci/parser/vocabulary.cpp +++ b/engines/sci/parser/vocabulary.cpp @@ -231,6 +231,12 @@ bool Vocabulary::loadSuffixes() { // Beginning of next string - skip leading '*' seeker++; + // The QFG2 demo vocab is truncated at the end. Check for such cases here + if (seeker >= resource->size()) { + warning("Vocabulary word from %s is truncated for suffix %d at %u", resource->name().c_str(), _parserSuffixes.size(), seeker); + break; + } + maxSize = resource->size() - seeker; suffix.word_suffix = (const char *)resource->getUnsafeDataAt(seeker, maxSize); suffix.word_suffix_length = Common::strnlen(suffix.word_suffix, maxSize); |