diff options
author | Filippos Karapetis | 2013-01-08 23:07:22 +0200 |
---|---|---|
committer | Filippos Karapetis | 2013-01-08 23:13:38 +0200 |
commit | 796867cd32408aada11fc21323d5ee0ce201ffee (patch) | |
tree | 5ea4a472084ac03a62d3da120aa5774862a8a9b6 | |
parent | a7b72d0a9ad5c96665db7a130b195f1589164c95 (diff) | |
download | scummvm-rg350-796867cd32408aada11fc21323d5ee0ce201ffee.tar.gz scummvm-rg350-796867cd32408aada11fc21323d5ee0ce201ffee.tar.bz2 scummvm-rg350-796867cd32408aada11fc21323d5ee0ce201ffee.zip |
TOLTECS: Fix script bug #3599964 - "TOLTECS: Crash when entering cave"
-rw-r--r-- | engines/toltecs/script.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/toltecs/script.cpp b/engines/toltecs/script.cpp index f5e3f8481f..9ea95a2cd1 100644 --- a/engines/toltecs/script.cpp +++ b/engines/toltecs/script.cpp @@ -252,9 +252,12 @@ void ScriptInterpreter::execOpcode(byte opcode) { // ok _subCode = _code; byte length = readByte(); + if (length == 0) { + warning("Possible script bug detected - opcode length is 0 when calling script function"); + return; + } debug(2, "length = %d", length); uint16 index = readInt16(); - debug(2, "callScriptFunction %d", index); execScriptFunction(index); _code += length - 2; break; |