SCI32: Fix null references in Robot decoder

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.)
This commit is contained in:
Colin Snover 2017-01-10 19:37:13 -06:00
parent e00c773d95
commit 63ad0a6715

View File

@ -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) {