Skip to content

Commit

Permalink
SCI32: Fix null references in Robot decoder
Browse files Browse the repository at this point in the history
Failing to reduce the size of the ScreenItem arrays causes other
parts of the decoder (like RobotDecoder::getFrameSize) to try
reading ScreenItems that were already destroyed and nulled out in
the list. (In SSCI, the screen item count was held in a separate
property instead of being part of the screen item list.)
  • Loading branch information
csnover committed Jan 11, 2017
1 parent e00c773 commit 63ad0a6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions engines/sci/video/robot_decoder.cpp
Expand Up @@ -1436,6 +1436,14 @@ void RobotDecoder::doVersion5(const bool shouldSubmitAudio) {
_screenItemList[i] = nullptr;
}
}

if (screenItemCount < oldScreenItemCount) {
_screenItemList.resize(screenItemCount);
_screenItemX.resize(screenItemCount);
_screenItemY.resize(screenItemCount);
_originalScreenItemX.resize(screenItemCount);
_originalScreenItemY.resize(screenItemCount);
}
}

void RobotDecoder::createCels5(const byte *rawVideoData, const int16 numCels, const bool usePalette) {
Expand Down

0 comments on commit 63ad0a6

Please sign in to comment.