aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2016-02-12 20:30:43 +0100
committerMartin Kiewitz2016-02-12 20:30:43 +0100
commiteaf6e5d4f8848f87835b368dd9f8f31cb14a705c (patch)
tree4ca2f8003f7a721e252957cb5bd53f868f5d6e02 /engines/sci
parent655f4dfedbb2b3ca8600777eb1011bb1df0ecf79 (diff)
downloadscummvm-rg350-eaf6e5d4f8848f87835b368dd9f8f31cb14a705c.tar.gz
scummvm-rg350-eaf6e5d4f8848f87835b368dd9f8f31cb14a705c.tar.bz2
scummvm-rg350-eaf6e5d4f8848f87835b368dd9f8f31cb14a705c.zip
SCI: Fix fallback detector crashing on BE regress.
Regression from af3fec8c26d92005b507dca65d1d50f820feb0e7 Code resulted in a crash on BE platforms
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/resource.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 54ef4b3363..f35781231b 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -2679,7 +2679,9 @@ Common::String ResourceManager::findSierraGameId() {
return "";
// Seek to the name selector of the first export
- byte *seeker = heap->data + READ_UINT16(heap->data + gameObjectOffset + nameSelector * 2);
+ byte *offsetPtr = heap->data + gameObjectOffset + nameSelector * 2;
+ uint16 offset = !isSci11Mac() ? READ_LE_UINT16(offsetPtr) : READ_BE_UINT16(offsetPtr);
+ byte *seeker = heap->data + offset;
Common::String sierraId;
sierraId += (const char *)seeker;