[Scummvm-git-logs] scummvm master -> e9eb3fbe784734705658fcb7843a400746c13107

NMIError noreply at scummvm.org
Sun Mar 29 19:56:33 UTC 2026


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:
e9eb3fbe78 AUDIO/MIDI: Fix unguarded access to _sources array


Commit: e9eb3fbe784734705658fcb7843a400746c13107
    https://github.com/scummvm/scummvm/commit/e9eb3fbe784734705658fcb7843a400746c13107
Author: Coen Rampen (crampen at gmail.com)
Date: 2026-03-29T21:56:22+02:00

Commit Message:
AUDIO/MIDI: Fix unguarded access to _sources array

Changed paths:
    audio/mt32gm.cpp


diff --git a/audio/mt32gm.cpp b/audio/mt32gm.cpp
index 4cc5457666f..7a5a6a01d3d 100644
--- a/audio/mt32gm.cpp
+++ b/audio/mt32gm.cpp
@@ -594,7 +594,7 @@ void MidiDriver_MT32GM::controlChange(byte outputChannel, byte controllerNumber,
 				controllerValue = 0;
 			} else {
 				// Scale to user volume
-				uint16 userVolume = _sources[source].type == SOURCE_TYPE_SFX ? _userSfxVolume : _userMusicVolume; // Treat SOURCE_TYPE_UNDEFINED as music
+				uint16 userVolume = (source >= 0 && _sources[source].type == SOURCE_TYPE_SFX) ? _userSfxVolume : _userMusicVolume; // Treat SOURCE_TYPE_UNDEFINED as music
 				controllerValue = (controllerValue * userVolume) >> 8;
 			}
 		}




More information about the Scummvm-git-logs mailing list