aboutsummaryrefslogtreecommitdiff
path: root/scumm/saveload.cpp
diff options
context:
space:
mode:
authorMax Horn2005-05-26 10:07:37 +0000
committerMax Horn2005-05-26 10:07:37 +0000
commitde52d556d434424f093fb954da8d1fa27025d17e (patch)
tree8f8d1986d71b63b5b7b5b2a8088e465e28328762 /scumm/saveload.cpp
parentca40942959b494edf8ff4754f7f64215d8cf70f4 (diff)
downloadscummvm-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.cpp8
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;