aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/smush
diff options
context:
space:
mode:
authorEugene Sandulenko2009-05-11 18:34:54 +0000
committerEugene Sandulenko2009-05-11 18:34:54 +0000
commitefbc0f139b3998fc5a67798958a987a076cee212 (patch)
treef247f31c6964aabbec583089975395b949f6f58c /engines/scumm/smush
parentd09037fa6cc19e8f1bd3dac5b14369a8811726e8 (diff)
downloadscummvm-rg350-efbc0f139b3998fc5a67798958a987a076cee212.tar.gz
scummvm-rg350-efbc0f139b3998fc5a67798958a987a076cee212.tar.bz2
scummvm-rg350-efbc0f139b3998fc5a67798958a987a076cee212.zip
Fix bug #2678272: "FT: Russian version crashes on windows and psp"
svn-id: r40461
Diffstat (limited to 'engines/scumm/smush')
-rw-r--r--engines/scumm/smush/smush_player.cpp8
-rw-r--r--engines/scumm/smush/smush_player.h1
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;