From f04174aa8a0c871dbb2a5523d747ec11d65c036c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 30 Oct 2016 11:13:51 -0400 Subject: TITANIC: Fix playing past very last frame of videos --- engines/titanic/support/avi_surface.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/titanic/support/avi_surface.cpp') diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp index c3fe54522b..b4d72d43ca 100644 --- a/engines/titanic/support/avi_surface.cpp +++ b/engines/titanic/support/avi_surface.cpp @@ -376,10 +376,11 @@ void AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) { _movieFrameSurface[0]->h != r.height(); startAtFrame(startFrame); - while (!_decoder->endOfVideo() && _currentFrame < (int)endFrame && !g_vm->shouldQuit()) { + while (_currentFrame < (int)endFrame && !g_vm->shouldQuit()) { if (isNextFrame()) { renderFrame(); - _currentFrame = _decoder->getCurFrame(); + _currentFrame = _decoder->endOfVideo() ? _decoder->getFrameCount() : + _decoder->getCurFrame(); if (isDifferent) { // Clear the destination area, and use the transBlitFrom method, -- cgit v1.2.3