aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Christophe Rona2019-02-06 18:13:07 +0100
committerFilippos Karapetis2019-02-08 02:41:26 +0200
commita29254dda2c94f808b2fc4d91eb845e404dec564 (patch)
tree9cede78704be76d7cf56fb501de4e5896d6b7fe0
parent7061f7cb173871e84d26010b9742fcec8a0ece1a (diff)
downloadscummvm-rg350-a29254dda2c94f808b2fc4d91eb845e404dec564.tar.gz
scummvm-rg350-a29254dda2c94f808b2fc4d91eb845e404dec564.tar.bz2
scummvm-rg350-a29254dda2c94f808b2fc4d91eb845e404dec564.zip
SCI: Fix out of bounds issue in getFrameSize
If there is no item at all, returns a (0,0,0,0) Rect.
-rw-r--r--engines/sci/video/robot_decoder.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp
index 8a0948d962..a99a15a23c 100644
--- a/engines/sci/video/robot_decoder.cpp
+++ b/engines/sci/video/robot_decoder.cpp
@@ -1169,6 +1169,12 @@ bool RobotDecoder::readPartialAudioRecordAndSubmit(const int startFrame, const i
uint16 RobotDecoder::getFrameSize(Common::Rect &outRect) const {
assert(_plane != nullptr);
+
+ if (_screenItemList.size() == 0) {
+ outRect.clip(0, 0);
+ return _numFramesTotal;
+ }
+
outRect = _screenItemList[0]->getNowSeenRect(*_plane);
for (RobotScreenItemList::size_type i = 1; i < _screenItemList.size(); ++i) {
ScreenItem &screenItem = *_screenItemList[i];