[Scummvm-tracker] [ScummVM :: Bugs] #16308: ACCESS: MARTIAN: Segfault after death in Casino

ScummVM :: Bugs trac at scummvm.org
Wed Oct 22 17:19:06 UTC 2025


#16308: ACCESS: MARTIAN: Segfault after death in Casino
---------------------+---------------------------------
Reporter:  alexbevi  |       Owner:  (none)
    Type:  defect    |      Status:  new
Priority:  normal    |   Component:  Engine: Access
 Version:            |  Resolution:
Keywords:            |        Game:  Martian Memorandum
---------------------+---------------------------------
Comment (by antoniou79):

 Debugging with {{{-d 1 --debugflags=scripts }}} switches shows that a
 {{{0684 46 cmdDead(deathId=0)}}}
 script command is executed before the segmentation fault. This command
 calls the {{{MartianEngine::dead(int deathId)}}} method, which seems to be
 doing lots of cleaning up, since the player just died. The
 {{{freechar()}}} call, frees the {{{_data}}} member, but then the calling
 method ({{{Scripts::charLoop()}}}) tries to "seek" to some position on the
 data with {{{data->seek(pos)}}} and it results to a segmentation fault
 since the _data is now nullptr.

 Adding a checking code right after {{executeScript}} like:
 {{{
 if (_data == nullptr) {
         _endFlag = endFlag;
         return;
 }
 }}}
 seems to fix the issue, but I am not sure, if other stuff should happen
 before returning, in this case.
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/16308#comment:5>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list