mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 13:13:58 +00:00
Fix for RC bug [780675] MI2: Reoccuring crash
Tightened up OOB track selection handling in MidiParser. Apparently some SMFs in the Mac version of MI2 (and other games?) specify track -1 in their jump commands to indicate a jump within the same track. svn-id: r9321
This commit is contained in:
parent
c5de745580
commit
7c16006cc7
@ -698,8 +698,8 @@ void Player::key_off(uint8 chan, byte note) {
|
||||
bool Player::jump(uint track, uint beat, uint tick) {
|
||||
if (!_parser)
|
||||
return false;
|
||||
_track_index = track;
|
||||
_parser->setTrack (track);
|
||||
if (_parser->setTrack (track))
|
||||
_track_index = track;
|
||||
if (!_parser->jumpToTick ((beat - 1) * TICKS_PER_BEAT + tick))
|
||||
return false;
|
||||
turn_off_pedals();
|
||||
|
@ -252,7 +252,7 @@ void MidiParser::resetTracking() {
|
||||
}
|
||||
|
||||
bool MidiParser::setTrack (int track) {
|
||||
if (track >= _num_tracks)
|
||||
if (track < 0 || track >= _num_tracks)
|
||||
return false;
|
||||
else if (track == _active_track)
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user