diff options
author | Max Horn | 2005-05-26 10:07:37 +0000 |
---|---|---|
committer | Max Horn | 2005-05-26 10:07:37 +0000 |
commit | de52d556d434424f093fb954da8d1fa27025d17e (patch) | |
tree | 8f8d1986d71b63b5b7b5b2a8088e465e28328762 /scumm/saveload.cpp | |
parent | ca40942959b494edf8ff4754f7f64215d8cf70f4 (diff) | |
download | scummvm-rg350-de52d556d434424f093fb954da8d1fa27025d17e.tar.gz scummvm-rg350-de52d556d434424f093fb954da8d1fa27025d17e.tar.bz2 scummvm-rg350-de52d556d434424f093fb954da8d1fa27025d17e.zip |
Fix bad endian bug in thumbnails code
svn-id: r18256
Diffstat (limited to 'scumm/saveload.cpp')
-rw-r--r-- | scumm/saveload.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index d276c8257a..ab050a7673 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -130,8 +130,12 @@ bool ScummEngine::loadState(int slot, bool compat) { // Since version 52 a thumbnail is saved directly after the header if (hdr.ver >= VER(52)) { - uint32 type = in->readUint32BE(); - if (type != MKID('THMB')) { + uint32 type; + in->read(&type, 4); + + // Check for the THMB header. Also, work around a bug which caused + // the chunk type (incorrectly) to be written in LE on LE machines. + if (! (type == MKID('THMB') || (hdr.ver < VER(55) && type == MKID('BMHT')))){ warning("Can not load thumbnail"); delete in; return false; |