diff options
author | whiterandrek | 2018-06-09 16:00:23 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | a76d86a3429c0203efe7932207bb48322eb92548 (patch) | |
tree | aaf0a4fb596354a1d38a8e50430476183f2b00fe | |
parent | fb8d8c1f570b9e6da55cf21eb6d176335a65f25c (diff) | |
download | scummvm-rg350-a76d86a3429c0203efe7932207bb48322eb92548.tar.gz scummvm-rg350-a76d86a3429c0203efe7932207bb48322eb92548.tar.bz2 scummvm-rg350-a76d86a3429c0203efe7932207bb48322eb92548.zip |
PINK: add check to startFrame because it can be greater than sprite's frames number
-rw-r--r-- | engines/pink/objects/actions/action_play.cpp | 1 | ||||
-rw-r--r-- | engines/pink/objects/actions/action_still.cpp | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/engines/pink/objects/actions/action_play.cpp b/engines/pink/objects/actions/action_play.cpp index 9e9c856da4..9af1900e32 100644 --- a/engines/pink/objects/actions/action_play.cpp +++ b/engines/pink/objects/actions/action_play.cpp @@ -58,6 +58,7 @@ void ActionPlay::pause(bool paused) { void ActionPlay::onStart() { debug("Actor %s has now ActionPlay %s", _actor->getName().c_str(), _name.c_str()); _decoder->start(); + assert(_startFrame <= _decoder->getFrameCount()); for (uint i = 0; i < _startFrame; ++i) { _decoder->skipFrame(); } diff --git a/engines/pink/objects/actions/action_still.cpp b/engines/pink/objects/actions/action_still.cpp index 693d1304d4..78f0949591 100644 --- a/engines/pink/objects/actions/action_still.cpp +++ b/engines/pink/objects/actions/action_still.cpp @@ -48,6 +48,8 @@ void ActionStill::pause(bool paused) {} void ActionStill::onStart() { debug("Actor %s has now ActionStill %s", _actor->getName().c_str(), _name.c_str()); + if (_startFrame >= _decoder->getFrameCount()) + _startFrame = 0; for (uint i = 0; i < _startFrame; ++i) { _decoder->skipFrame(); } |