Permalink
Browse files

SCI: Fix out of bounds issue in getFrameSize

If there is no item at all, returns a (0,0,0,0) Rect.
  • Loading branch information...
jcrona authored and bluegr committed Feb 6, 2019
1 parent 7061f7c commit a29254dda2c94f808b2fc4d91eb845e404dec564
Showing with 6 additions and 0 deletions.
  1. +6 −0 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];

0 comments on commit a29254d

Please sign in to comment.