aboutsummaryrefslogtreecommitdiff
path: root/engines/composer
diff options
context:
space:
mode:
authorangstsmurf2019-07-19 23:58:15 +0200
committerFilippos Karapetis2019-07-20 08:06:49 +0300
commite5144e9590087eac0ebd6604e9b44f6ee804b89d (patch)
tree37d10b7769adab2f466abe1a3cc408d5418869a1 /engines/composer
parenta3851729959f94d46051f91643fc988dc2713242 (diff)
downloadscummvm-rg350-e5144e9590087eac0ebd6604e9b44f6ee804b89d.tar.gz
scummvm-rg350-e5144e9590087eac0ebd6604e9b44f6ee804b89d.tar.bz2
scummvm-rg350-e5144e9590087eac0ebd6604e9b44f6ee804b89d.zip
COMPOSER: Don't crash when skipping invalid animations
Don't try to run a NULL animation. Fixes a crash in Gregory.
Diffstat (limited to 'engines/composer')
-rw-r--r--engines/composer/graphics.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/composer/graphics.cpp b/engines/composer/graphics.cpp
index b95a6bc567..aa7ed7c143 100644
--- a/engines/composer/graphics.cpp
+++ b/engines/composer/graphics.cpp
@@ -151,8 +151,10 @@ void ComposerEngine::playAnimation(uint16 animId, int16 x, int16 y, int16 eventP
Animation *anim = NULL;
loadAnimation(anim, animId, x, y, eventParam);
- _anims.push_back(anim);
- runEvent(kEventAnimStarted, animId, eventParam, 0);
+ if (anim != NULL) {
+ _anims.push_back(anim);
+ runEvent(kEventAnimStarted, animId, eventParam, 0);
+ }
}
void ComposerEngine::stopAnimation(Animation *anim, bool localOnly, bool pipesOnly) {