From 14f152997625320f0cd5cc9b92a2b1e9e6d2df00 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 26 Apr 2013 18:15:08 +0300 Subject: TOLTECS: Ignore invalid script opcodes (script bugs) - bug #3604025 The original ignores invalid opcodes as well, according to johndoe --- engines/toltecs/script.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/toltecs/script.cpp b/engines/toltecs/script.cpp index 07d74ac369..476c3a4fcf 100644 --- a/engines/toltecs/script.cpp +++ b/engines/toltecs/script.cpp @@ -265,7 +265,7 @@ void ScriptInterpreter::execOpcode(byte opcode) { _subCode = _code; byte length = readByte(); if (length == 0) { - warning("Possible script bug detected - opcode length is 0 when calling script function"); + warning("Opcode length is 0 when calling script function"); return; } debug(2, "length = %d", length); @@ -484,7 +484,9 @@ void ScriptInterpreter::execOpcode(byte opcode) { _code++; break; default: - error("Invalid opcode %d", opcode); + // Most likely a script bug. Throw a warning and ignore it. + // The original ignores invalid opcodes as well - bug #3604025. + warning("Invalid opcode %d", opcode); } } -- cgit v1.2.3