[Scummvm-git-logs] scummvm master -> 983237d9122a3f1eec2f18d2b9fc499c76c400ed

sev- sev at scummvm.org
Tue Mar 7 07:51:55 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
983237d912 DIRECTOR: Added sanity check to Score::getSpriteById()


Commit: 983237d9122a3f1eec2f18d2b9fc499c76c400ed
    https://github.com/scummvm/scummvm/commit/983237d9122a3f1eec2f18d2b9fc499c76c400ed
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-03-07T07:51:38+01:00

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

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 0d0be21..112e4b2 100644
--- a/engines/director/score.cpp
+++ b/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 {





More information about the Scummvm-git-logs mailing list