[Scummvm-tracker] [ScummVM :: Bugs] #12932: Grim Fandango crash after solving the signpost in the Petrified Forest

ScummVM :: Bugs trac at scummvm.org
Sat Sep 18 06:34:17 UTC 2021


#12932: Grim Fandango crash after solving the signpost in the Petrified Forest
---------------------+----------------------------
Reporter:  Die4Ever  |       Owner:  (none)
    Type:  defect    |      Status:  new
Priority:  blocker   |   Component:  Engine: Grim
 Version:            |  Resolution:
Keywords:  crash     |        Game:  Grim Fandango
---------------------+----------------------------
Comment (by eriktorbjorn):

 I suspect this bit of Imuse::startSound() is wrong:

 {{{
         // If the track is fading out bring it back to the normal running
 tracks
         for (i = MAX_IMUSE_TRACKS; i < MAX_IMUSE_TRACKS +
 MAX_IMUSE_FADETRACKS; i++) {
                 if (!scumm_stricmp(_track[i]->soundName, soundName) &&
 !_track[i]->toBeRemoved) {

                         Track *fadeTrack = _track[i];
                         track = _track[i - MAX_IMUSE_TRACKS];

                         if (track->used) {
                                 flushTrack(track);
 g_system->getMixer()->stopHandle(track->handle);
                         }

                         // Clone the settings of the given track
                         memcpy(track, fadeTrack, sizeof(Track));
                         track->trackId = i - MAX_IMUSE_TRACKS;
                         // Reset the track
                         fadeTrack->clear();
                         // Mark as used for now so the track won't be
 reused again this frame
                         track->used = true;

                         return true;
                 }
         }
 }}}

 Apparently the music that gets started when leaving the room is already
 playing on a fade out track (don't ask me why it's on fade out). So it
 "clones" the track back to an ordinary track, except when it stops the
 sound handle on the fade out track that deletes the underlying stream
 since it has the "dispose after use" flag.

 I assume that disposing after use is generally a good thing, but not in
 this particular case?

 Maybe it needs to do what Imuse::cloneToFadeOutTrack() does, where it
 apparently makes a new copy of the sound as well?
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/12932#comment:8>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list