mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 03:10:22 +00:00
DIRECTOR: Added sanity check to Score::getSpriteById()
This commit is contained in:
parent
96f720d93d
commit
983237d912
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user