[Scummvm-cvs-logs] scummvm master -> ac0a1b9357dc68479fdc477f00192e68a2396bd5
Strangerke
Strangerke at scummvm.org
Sun May 25 18:25:37 CEST 2014
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:
ac0a1b9357 TOON: Add a safeguard to avoid dereferencing a null pointer in playAnim()
Commit: ac0a1b9357dc68479fdc477f00192e68a2396bd5
https://github.com/scummvm/scummvm/commit/ac0a1b9357dc68479fdc477f00192e68a2396bd5
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-05-25T18:24:08+02:00
Commit Message:
TOON: Add a safeguard to avoid dereferencing a null pointer in playAnim()
Changed paths:
engines/toon/character.cpp
diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp
index cab3179..51e8dee 100644
--- a/engines/toon/character.cpp
+++ b/engines/toon/character.cpp
@@ -1059,12 +1059,14 @@ void Character::playAnim(int32 animId, int32 unused, int32 flags) {
_specialAnim->loadAnimation(animName);
_animSpecialId = animId;
-
- _animationInstance->setAnimation(_specialAnim);
- _animationInstance->setAnimationRange(0, _specialAnim->_numFrames - 1);
- _animationInstance->reset();
- _animationInstance->stopAnimation();
- _animationInstance->setLooping(false);
+
+ if (_animationInstance) {
+ _animationInstance->setAnimation(_specialAnim);
+ _animationInstance->setAnimationRange(0, _specialAnim->_numFrames - 1);
+ _animationInstance->reset();
+ _animationInstance->stopAnimation();
+ _animationInstance->setLooping(false);
+ }
}
int32 Character::getAnimFlag() {
More information about the Scummvm-git-logs
mailing list