From 8fc8531f70dbccb963823392ae923e89666839bb Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 29 Sep 2008 20:40:58 +0000 Subject: Since no one has come up with any better suggestion... this should fix #2123258 ("COMI: Crash after video (SAN) play"). The eos() function won't return true until we've tried to read *past* the end of the stream. svn-id: r34689 --- engines/scumm/smush/smush_player.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index 6b79b7e2c4..3b17f3ae10 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -1017,16 +1017,17 @@ void SmushPlayer::parseNextFrame() { } assert(_base); + + const uint32 subType = _base->readUint32BE(); + const int32 subSize = _base->readUint32BE(); + const int32 subOffset = _base->pos(); + if (_base->eos()) { _vm->_smushVideoShouldFinish = true; _endOfFile = true; return; } - const uint32 subType = _base->readUint32BE(); - const int32 subSize = _base->readUint32BE(); - const int32 subOffset = _base->pos(); - switch (subType) { case MKID_BE('AHDR'): // FT INSANE may seek file to the beginning handleAnimHeader(subSize, *_base); -- cgit v1.2.3