[Scummvm-tracker] [ScummVM :: Bugs] #12188: SCUMM: COMI: iMUSE crash on region number assertion
ScummVM :: Bugs
trac at scummvm.org
Wed Feb 24 09:31:43 UTC 2021
#12188: SCUMM: COMI: iMUSE crash on region number assertion
-----------------------+------------------------------
Reporter: orgads | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: Engine: SCUMM
Version: | Resolution:
Keywords: imuse comi | Game: Monkey Island 3
-----------------------+------------------------------
Comment (by AndywinXp):
Darn. I'm really having a hard time reproducing it; this should never
happen, since any request for a region higher than the total number of
regions is already blocked in
{{{
void IMuseDigital::switchToNextRegion(Track *track) {
...
int num_regions = _sound->getNumRegions(track->soundDesc);
if (++track->curRegion == num_regions) {
flushTrack(track);
debug(5, "SwToNeReg(trackId:%d) - end of region, exiting
SwToNeReg", track->trackId);
return;
}
...
}
}}}
All things considered, though, this happens in the same function after a
while
([https://github.com/scummvm/scummvm/blob/master/engines/scumm/imuse_digi/dimuse.cpp
Line 593]):
{{{
int region = _sound->getRegionIdByJumpId(soundDesc, jumpId);
}}}
and then this region variable is assigned to track->curRegion in a couple
of instances.
A guess that a quick fix is to go to the line above and add a doublecheck
to always have a region whose id is lower than the maximum number of
regions for that soundDesc (and if an error occurs, what should we do?).
But I don't know how to test the fix if I can't reproduce the behaviour
:-(
--
Ticket URL: <https://bugs.scummvm.org/ticket/12188#comment:2>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list