aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2012-10-06 10:22:08 +0200
committerWillem Jan Palenstijn2012-10-06 13:07:12 +0200
commite38d4f20e8251937fd582e1ebb17568144a41e92 (patch)
treea9893375addbb009e4261abd24362ce4d80f3989 /engines
parent5f3f21e20ed86f4056544dbb5c3fcd471e20b377 (diff)
downloadscummvm-rg350-e38d4f20e8251937fd582e1ebb17568144a41e92.tar.gz
scummvm-rg350-e38d4f20e8251937fd582e1ebb17568144a41e92.tar.bz2
scummvm-rg350-e38d4f20e8251937fd582e1ebb17568144a41e92.zip
SCI: Fix dissect_script crash with invalid object types
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/scriptdebug.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 5594c0461c..b2f22aa985 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -527,7 +527,8 @@ void Kernel::dissectScript(int scriptNumber, Vocabulary *vocab) {
_seeker += objsize;
- objectctr[objType]++;
+ if (objType >= 0 && objType < ARRAYSIZE(objectctr))
+ objectctr[objType]++;
switch (objType) {
case SCI_OBJ_OBJECT: