diff options
author | Willem Jan Palenstijn | 2012-10-06 10:22:08 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2012-10-06 13:07:12 +0200 |
commit | e38d4f20e8251937fd582e1ebb17568144a41e92 (patch) | |
tree | a9893375addbb009e4261abd24362ce4d80f3989 /engines | |
parent | 5f3f21e20ed86f4056544dbb5c3fcd471e20b377 (diff) | |
download | scummvm-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.cpp | 3 |
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: |