diff options
Diffstat (limited to 'engines/pink')
-rw-r--r-- | engines/pink/objects/actions/action_play.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/pink/objects/actions/action_play.cpp b/engines/pink/objects/actions/action_play.cpp index bc93eba13c..e86ff55c21 100644 --- a/engines/pink/objects/actions/action_play.cpp +++ b/engines/pink/objects/actions/action_play.cpp @@ -50,8 +50,7 @@ void ActionPlay::update() { _decoder.setEndOfTrack(); assert(!_decoder.needsUpdate()); _actor->endAction(); - } - else + } else decodeNext(); } @@ -61,8 +60,9 @@ void ActionPlay::pause(bool paused) { void ActionPlay::onStart() { debug("Actor %s has now ActionPlay %s", _actor->getName().c_str(), _name.c_str()); - if (_stopFrame == -1) - _stopFrame = _decoder.getFrameCount() - 1; + int frameCount = _decoder.getFrameCount(); + if (_stopFrame == -1 || _stopFrame >= frameCount) + _stopFrame = frameCount - 1; assert(_startFrame < _decoder.getFrameCount()); setFrame(_startFrame); // doesn't need to decode startFrame here. Update method will decode |