[Scummvm-git-logs] scummvm master -> 25bcc8add0cf7f3d0a1102511a84e9a126fabab7
NMIError
noreply at scummvm.org
Tue Apr 15 19:07:40 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
25bcc8add0 DGDS: Fix looping sounds reading out of bounds
Commit: 25bcc8add0cf7f3d0a1102511a84e9a126fabab7
https://github.com/scummvm/scummvm/commit/25bcc8add0cf7f3d0a1102511a84e9a126fabab7
Author: Coen Rampen (crampen at gmail.com)
Date: 2025-04-15T21:07:28+02:00
Commit Message:
DGDS: Fix looping sounds reading out of bounds
Changed paths:
engines/dgds/sound/midiparser_sci.cpp
diff --git a/engines/dgds/sound/midiparser_sci.cpp b/engines/dgds/sound/midiparser_sci.cpp
index 6db7bace45e..d562cd2961f 100644
--- a/engines/dgds/sound/midiparser_sci.cpp
+++ b/engines/dgds/sound/midiparser_sci.cpp
@@ -576,7 +576,7 @@ bool MidiParser_SCI::processEvent(const EventInfo &info, bool fireEvents) {
case 0xC:
if (info.channel() == 0xF) {// SCI special case
if (info.basic.param1 == kSetSignalLoop) {
- _loopTick = _position._lastEventTime + info.delta;
+ _loopTick = _position._lastEventTick + info.delta;
return true;
}
@@ -693,7 +693,13 @@ bool MidiParser_SCI::processEvent(const EventInfo &info, bool fireEvents) {
// treats this case as an infinite loop (bug #5744).
if (_pSnd->loop || _pSnd->hold > 0) {
// Change from SCI: Don't stop current notes on loop.
- jumpToTick(_loopTick, false, false);
+ if (!jumpToTick(_loopTick, false, false)) {
+ // Jumping to the specified tick failed. This means play
+ // position is still at the end of the MIDI data. Stop the
+ // sound to prevent reading out of bounds.
+ warning("Jump to tick at end of looping sound failed! Stopping sound.");
+ _music->soundStop(_pSnd);
+ }
// Done with this event.
return true;
More information about the Scummvm-git-logs
mailing list