aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorTorbjörn Andersson2014-07-12 10:44:37 +0200
committerTorbjörn Andersson2014-07-12 10:44:37 +0200
commitfd40cb22244f68af7e4260b3133f2466607a0efb (patch)
tree3e50e4ec3895796282016a8019d12dcb4268441f /engines/scumm
parentbf90d3602422bed51677c4aafd1b54b4c2860631 (diff)
downloadscummvm-rg350-fd40cb22244f68af7e4260b3133f2466607a0efb.tar.gz
scummvm-rg350-fd40cb22244f68af7e4260b3133f2466607a0efb.tar.bz2
scummvm-rg350-fd40cb22244f68af7e4260b3133f2466607a0efb.zip
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.
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/script_v5.cpp2
1 files changed, 1 insertions, 1 deletions
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;