aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2018-11-22 22:20:16 +0100
committerJoseph-Eugene Winzer2019-02-06 09:42:11 +0100
commit498de6347e969720958960e9fea266fad9959c4c (patch)
tree2d80c17e8f7338842ec304bcdb4d5340e710cce5 /engines
parentff36f94c1f6112b4f6318a25c3376d6d53b07b53 (diff)
downloadscummvm-rg350-498de6347e969720958960e9fea266fad9959c4c.tar.gz
scummvm-rg350-498de6347e969720958960e9fea266fad9959c4c.tar.bz2
scummvm-rg350-498de6347e969720958960e9fea266fad9959c4c.zip
SUPERNOVA: Fixes OOB read
Diffstat (limited to 'engines')
-rw-r--r--engines/supernova/rooms.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/supernova/rooms.cpp b/engines/supernova/rooms.cpp
index 18fd64e32c..10cb988f6b 100644
--- a/engines/supernova/rooms.cpp
+++ b/engines/supernova/rooms.cpp
@@ -57,7 +57,7 @@ bool Room::serialize(Common::WriteStream *out) {
out->writeByte(_sentenceRemoved[i]);
int numObjects = 0;
- while ((_objectState[numObjects]._id != INVALIDOBJECT) && (numObjects < kMaxObject))
+ while ((numObjects < kMaxObject) && (_objectState[numObjects]._id != INVALIDOBJECT))
++numObjects;
out->writeSint32LE(numObjects);