aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorAlyssa Milburn2011-02-20 12:36:08 +0100
committerAlyssa Milburn2011-02-20 12:45:15 +0100
commit805acaa81e836761fc5dee8f94b5f09e7831ed99 (patch)
treedcef08af5059d01b1c4a469e99618f7024e229b2 /engines/mohawk
parent417dd6314b5355f74423cb2de22c18da1b0e968b (diff)
downloadscummvm-rg350-805acaa81e836761fc5dee8f94b5f09e7831ed99.tar.gz
scummvm-rg350-805acaa81e836761fc5dee8f94b5f09e7831ed99.tar.bz2
scummvm-rg350-805acaa81e836761fc5dee8f94b5f09e7831ed99.zip
MOHAWK: Ignore out-of-bounds LB words.
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/livingbooks.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index a7af9ac711..cc38adb34f 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -3142,6 +3142,11 @@ bool LBLiveTextItem::contains(Common::Point point) {
void LBLiveTextItem::paletteUpdate(uint16 word, bool on) {
_vm->_needsRedraw = true;
+ // Sometimes the last phrase goes out-of-bounds, the original engine
+ // only checks the words which are valid in the palette updating code.
+ if (word >= _words.size())
+ return;
+
if (_resourceId) {
// with a resource, we draw a bitmap in draw() rather than changing the palette
return;