aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/video
diff options
context:
space:
mode:
authorColin Snover2017-01-10 19:37:13 -0600
committerColin Snover2017-01-11 11:13:44 -0600
commit63ad0a67153e880d72897221354245920a25514c (patch)
tree593275c75393f90ad61bb337787cee3cc9146388 /engines/sci/video
parente00c773d9529ba7915d1ef9443df289ef8eb34a5 (diff)
downloadscummvm-rg350-63ad0a67153e880d72897221354245920a25514c.tar.gz
scummvm-rg350-63ad0a67153e880d72897221354245920a25514c.tar.bz2
scummvm-rg350-63ad0a67153e880d72897221354245920a25514c.zip
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.)
Diffstat (limited to 'engines/sci/video')
-rw-r--r--engines/sci/video/robot_decoder.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp
index 296fdf8db2..0cb4831159 100644
--- a/engines/sci/video/robot_decoder.cpp
+++ b/engines/sci/video/robot_decoder.cpp
@@ -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) {