From e38d4f20e8251937fd582e1ebb17568144a41e92 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 6 Oct 2012 10:22:08 +0200 Subject: SCI: Fix dissect_script crash with invalid object types --- engines/sci/engine/scriptdebug.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines') 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: -- cgit v1.2.3