diff options
author | Filippos Karapetis | 2018-12-30 12:53:23 +0200 |
---|---|---|
committer | Filippos Karapetis | 2018-12-30 12:53:23 +0200 |
commit | 57f114cbc3f8ecea0668c732550afc638e3ee302 (patch) | |
tree | ce3d1a3abb82b397cb1521737679ac0215db34d8 | |
parent | ce90507e859f04324212cb14c7089dff6e07b007 (diff) | |
download | scummvm-rg350-57f114cbc3f8ecea0668c732550afc638e3ee302.tar.gz scummvm-rg350-57f114cbc3f8ecea0668c732550afc638e3ee302.tar.bz2 scummvm-rg350-57f114cbc3f8ecea0668c732550afc638e3ee302.zip |
SCI: Don't try to validate resources added from a Mac resource fork
The fix has been authored originally by csnover, adapted from commit ca420e44167e5ee488b4ad547104fa6b976e6f1c
Fixes Trac#10440, Trac#10892.
-rw-r--r-- | engines/sci/resource.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 2e64b1080c..b2b422f3cb 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -2103,7 +2103,12 @@ Resource *ResourceManager::updateResource(ResourceId resId, ResourceSource *src, return res; } - if (validateResource(resId, sourceMapLocation, src->getLocationName(), offset, size, volumeFile->size())) { + // Resources from MacResourceForkResourceSource do not have a source size + // since the source "volume file" is the empty data fork, and they don't + // have an offset either since the MacResManager handles this, so trying to + // validate these resources using the normal validation would always fail + if (src->getSourceType() == kSourceMacResourceFork || + validateResource(resId, sourceMapLocation, src->getLocationName(), offset, size, volumeFile->size())) { if (res == nullptr) { res = new Resource(this, resId); _resMap.setVal(resId, res); |