[Scummvm-devel] FT: assert error
Sebastian Dransfeld
sebastid at stud.ntnu.no
Mon Jan 12 00:11:01 CET 2004
I get this error:
scummvm: scumm/imuse_digi/dimuse_sndmgr.cpp:390: int32
Scumm::ImuseDigiSndMgr::getDataFromRegion(Scumm::ImuseDigiSndMgr::soundStruct*, int, byte**, int, int): Assertion `region >= 0 && region < soundHandle->numRegions' failed.
Backtrack of the error:
In scumm/imuse_digi/dimuse.cpp
if (_track[l].curRegion == -1)
switchToNextRegion(l);
...
int result2 = _sound->getDataFromRegion(_track[l].soundHandle, _track[l].curRegion, &ptr, offset, mixer_size_12);
This will lead to an error in one of the asserts in getDataFromRegion
because switchToNextRegion can return without changing curRegion if the
game is Full Throttle, so curRegion will remain -1. The bug is triggered
if the door to the bar at the beginning is clicked at but no action is
taken.
void IMuseDigital::switchToNextRegion(int track) {
int num_regions = _sound->getNumRegions(_track[track].soundHandle);
int num_jumps = _sound->getNumJumps(_track[track].soundHandle);
if ((_vm->_gameId == GID_FT) && (num_jumps != 0)) {
_track[track].regionOffset = 0;
return;
}
int32 ImuseDigiSndMgr::getDataFromRegion(soundStruct *soundHandle, int region, byte **buf, int32 offset, int32 size) {
...
assert(region >= 0 && region < soundHandle->numRegions);
More information about the Scummvm-devel
mailing list