aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/parser/vocabulary.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp
index 1f062c6363..3989f20209 100644
--- a/engines/sci/parser/vocabulary.cpp
+++ b/engines/sci/parser/vocabulary.cpp
@@ -153,11 +153,20 @@ bool Vocabulary::loadParserWords() {
}
} else {
do {
+ if (seeker == resource->size()) {
+ warning("SCI0: Vocabulary not usable, disabling");
+ return false;
+ }
c = resource->getUint8At(seeker++);
currentWord[currentWordPos++] = c & 0x7f; // 0x80 is used to terminate the string
} while (c < 0x80);
}
+ if (seeker == resource->size()) {
+ warning("Vocabulary not usable, disabling");
+ return false;
+ }
+
currentWord[currentWordPos] = 0;
// Now decode class and group: