diff options
Diffstat (limited to 'engines/scumm/smush')
-rw-r--r-- | engines/scumm/smush/smush_player.cpp | 8 | ||||
-rw-r--r-- | engines/scumm/smush/smush_player.h | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index b663c707dd..be67728327 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -985,7 +985,7 @@ void SmushPlayer::parseNextFrame() { error("SmushPlayer: Unable to open file %s", _seekFile.c_str()); _base = tmp; _base->readUint32BE(); - _base->readUint32BE(); + _baseSize = _base->readUint32BE(); if (_seekPos > 0) { assert(_seekPos > 8); @@ -1023,12 +1023,14 @@ void SmushPlayer::parseNextFrame() { const int32 subSize = _base->readUint32BE(); const int32 subOffset = _base->pos(); - if (_base->eos()) { + if (_base->pos() >= _baseSize) { _vm->_smushVideoShouldFinish = true; _endOfFile = true; return; } + debug(3, "Chunk: %s at %x", Common::tag2string(subType).c_str(), subOffset); + switch (subType) { case MKID_BE('AHDR'): // FT INSANE may seek file to the beginning handleAnimHeader(subSize, *_base); @@ -1037,7 +1039,7 @@ void SmushPlayer::parseNextFrame() { handleFrame(subSize, *_base); break; default: - error("Unknown Chunk found at %x: %x, %d", subOffset, subType, subSize); + error("Unknown Chunk found at %x: %s, %d", subOffset, Common::tag2string(subType).c_str(), subSize); } _base->seek(subOffset + subSize, SEEK_SET); diff --git a/engines/scumm/smush/smush_player.h b/engines/scumm/smush/smush_player.h index 2e2996009c..f64f56ad4e 100644 --- a/engines/scumm/smush/smush_player.h +++ b/engines/scumm/smush/smush_player.h @@ -51,6 +51,7 @@ private: Codec37Decoder *_codec37; Codec47Decoder *_codec47; Common::SeekableReadStream *_base; + uint32 _baseSize; byte *_frameBuffer; byte *_specialBuffer; |