aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/parser/vocabulary.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp
index 3989f20209..2642b6bd6e 100644
--- a/engines/sci/parser/vocabulary.cpp
+++ b/engines/sci/parser/vocabulary.cpp
@@ -142,7 +142,7 @@ bool Vocabulary::loadParserWords() {
if (resourceType == kVocabularySCI1) {
c = 1;
- while (seeker < resource->size() && currentWordPos < 255 && c) {
+ while (seeker < resource->size() && currentWordPos < ARRAYSIZE(currentWord) - 1 && c) {
c = resource->getUint8At(seeker++);
currentWord[currentWordPos++] = c;
}
@@ -158,6 +158,7 @@ bool Vocabulary::loadParserWords() {
return false;
}
c = resource->getUint8At(seeker++);
+ assert(currentWordPos < ARRAYSIZE(currentWord) - 1);
currentWord[currentWordPos++] = c & 0x7f; // 0x80 is used to terminate the string
} while (c < 0x80);
}