[Scummvm-tracker] [ScummVM :: Bugs] #14753: SCUMM: OSX crash with misread local Macintosh resource forks
ScummVM :: Bugs
trac at scummvm.org
Sat Dec 16 08:36:28 UTC 2023
#14753: SCUMM: OSX crash with misread local Macintosh resource forks
---------------------+----------------------------
Reporter: dwatteau | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: Engine: SCUMM
Version: | Resolution:
Keywords: | Game:
---------------------+----------------------------
Comment (by eriktorbjorn):
I suppose we could test the MD5 sum of the resource fork, but then we'd
have to know exactly which versions exist and I have no idea.
We could check that all the expected resources exist, I guess. Or maybe
it's enough to just check that there is a resource fork in the first
place. Something like this perhaps, though I haven't tested it:
{{{
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index a9de92a7c71..767e7b201cf 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1230,6 +1230,16 @@ Common::Error ScummEngine::init() {
}
}
+ if (!macResourceFile.empty()) {
+ if (!resource.open(macResourceFile))
+ return
Common::Error(Common::kReadingFailed, Common::U32String::format(_("Could
not open Macintosh resource file %s"), macResourceFile.c_str()));
+
+ if (!resource.hasResFork())
+ return
Common::Error(Common::kReadingFailed, Common::U32String::format(_("Could
not find resource fork in Macintosh resource file %s"),
macResourceFile.c_str()));
+
+ resource.close();
+ }
+
if (!_macScreen && _renderMode ==
Common::kRenderMacintoshBW)
}}}
I have no idea about the regression, though.
--
Ticket URL: <https://bugs.scummvm.org/ticket/14753#comment:3>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list