[Scummvm-tracker] [ScummVM :: Bugs] #12762: The longest Journey crashes

ScummVM :: Bugs trac at scummvm.org
Fri Aug 27 15:40:54 UTC 2021


#12762: The longest Journey crashes
-------------------+----------------------------------
Reporter:  toby63  |       Owner:  criezy
    Type:  defect  |      Status:  new
Priority:  normal  |   Component:  Engine: Stark
 Version:          |  Resolution:
Keywords:          |        Game:  The Longest Journey
-------------------+----------------------------------
Comment (by antoniou79):

 I think I've found the issue for this specific crash, but I cannot be sure
 my fix for this would prevent other similar crashes.

 Basically, the game.exe files for GOG and Steam are different and have
 very different sizes. The GOG one is 424KB and the Steam one is 94KB.

 The stark engine reads "game.exe" to get resources, seemingly only to
 provide "styled confirmation dialogs" as per:
 https://github.com/scummvm/scummvm/blob/fed702c0593323c1509745223b9383666ce53241/engines/stark/stark.cpp#L315

 This fails for the steam version. In particular, it fails in the
 loadBackground() method here:
  Common::SeekableReadStream *stream =
 executable.getResource(Common::kWinBitmap, 147);
 https://github.com/scummvm/scummvm/blob/fed702c0593323c1509745223b9383666ce53241/engines/stark/ui/dialogbox.cpp#L226

 The code has fallback for the case that the "stream" returned by this
 getResource() attempt is null ("If we were not able to load the
 background, fallback to dark blue")
 https://github.com/scummvm/scummvm/blob/fed702c0593323c1509745223b9383666ce53241/engines/stark/ui/dialogbox.cpp#L58

 But the SeekableReadStream *PEResources::getResource() method, calls the
 SeekableReadStream *ReadStream::readStream() method on the exe file stream
 and this last method produces the assertion fault.

 I've pushed a fix for this, that checks the version info of the executable
 (game.exe) and if it matches the Steam version (1.0.0.161) then it skips
 trying to load the background image resource. There probably is a better
 way to do this, since if the build version of the Steam release changes,
 then the issue could come back.
 https://github.com/scummvm/scummvm/commit/565a0559ed09660daa83cd529afa4e0efb6949c5
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/12762#comment:8>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list