Permalink
Browse files

SUPERNOVA: Fixes OOB read

  • Loading branch information...
Joefish committed Nov 22, 2018
1 parent ff36f94 commit 498de6347e969720958960e9fea266fad9959c4c
Showing with 1 addition and 1 deletion.
  1. +1 −1 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);

0 comments on commit 498de63

Please sign in to comment.