From fd40cb22244f68af7e4260b3133f2466607a0efb Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sat, 12 Jul 2014 10:44:37 +0200 Subject: SCUMM: Fix potential crash in o5_setClass() If 'obj' was exactly equal to _numActors, derefActor() would have complained about it being an invalid actor. I haven't seen any bug reports about this, so presumably it never actually happened. --- engines/scumm/script_v5.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/scumm') diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index 2cda9898af..91afa859a9 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -544,7 +544,7 @@ void ScummEngine_v5::o5_setClass() { } else if (cls == 0) { // Class '0' means: clean all class data _classData[obj] = 0; - if ((_game.features & GF_SMALL_HEADER) && obj <= _numActors) { + if ((_game.features & GF_SMALL_HEADER) && objIsActor(obj)) { Actor *a = derefActor(obj, "o5_setClass"); a->_ignoreBoxes = false; a->_forceClip = 0; -- cgit v1.2.3