Skip to content
Permalink
Browse files

DIRECTOR: Added sanity check to Score::getSpriteById()

  • Loading branch information
sev- committed Mar 7, 2017
1 parent 96f720d commit 983237d9122a3f1eec2f18d2b9fc499c76c400ed
Showing with 4 additions and 0 deletions.
  1. +4 −0 engines/director/score.cpp
@@ -1050,6 +1050,10 @@ void Score::processEvents() {
}

Sprite *Score::getSpriteById(uint16 id) {
if (_currentFrame >= _frames.size() || _currentFrame < 0 || id >= _frames[_currentFrame]->_sprites.size()) {
warning("Score::getSpriteById(%d): out of bounds. frame: %d", id, _currentFrame);
return nullptr;
}
if (_frames[_currentFrame]->_sprites[id]) {
return _frames[_currentFrame]->_sprites[id];
} else {

0 comments on commit 983237d

Please sign in to comment.
You can’t perform that action at this time.