aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/imuse_player.cpp4
-rw-r--r--sound/midiparser.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/scumm/imuse_player.cpp b/scumm/imuse_player.cpp
index 3b9c225043..2257230bdd 100644
--- a/scumm/imuse_player.cpp
+++ b/scumm/imuse_player.cpp
@@ -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();
diff --git a/sound/midiparser.cpp b/sound/midiparser.cpp
index f9d360f6e9..0b2408f4cf 100644
--- a/sound/midiparser.cpp
+++ b/sound/midiparser.cpp
@@ -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;