[Scummvm-git-logs] scummvm master -> 7fa3ba2dd0f9662790d3b66dc197d50d5c2721d5
NMIError
noreply at scummvm.org
Sun Apr 13 19:55:30 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:
7fa3ba2dd0 AUDIO/MIDI: Increase maximum number of subtracks
Commit: 7fa3ba2dd0f9662790d3b66dc197d50d5c2721d5
https://github.com/scummvm/scummvm/commit/7fa3ba2dd0f9662790d3b66dc197d50d5c2721d5
Author: Coen Rampen (crampen at gmail.com)
Date: 2025-04-13T21:55:21+02:00
Commit Message:
AUDIO/MIDI: Increase maximum number of subtracks
Increase the maximum number of MIDI type 1 subtracks for AGS "Mika's Surreal Dream 2"
Changed paths:
audio/midiparser.h
audio/midiparser_smf.cpp
diff --git a/audio/midiparser.h b/audio/midiparser.h
index 77af6acde26..b28a4b0e42b 100644
--- a/audio/midiparser.h
+++ b/audio/midiparser.h
@@ -28,7 +28,7 @@
#include "common/endian.h"
#include "common/stream.h"
-#define AUDIO_MIDIPARSER_MAXIMUM_SUBTRACKS 20
+#define AUDIO_MIDIPARSER_MAXIMUM_SUBTRACKS 35
class MidiDriver_BASE;
diff --git a/audio/midiparser_smf.cpp b/audio/midiparser_smf.cpp
index 1b0ec04f2a0..cb781df00fb 100644
--- a/audio/midiparser_smf.cpp
+++ b/audio/midiparser_smf.cpp
@@ -156,8 +156,12 @@ bool MidiParser_SMF::loadMusic(byte *data, uint32 size) {
}
// Now we identify and store the location for each track.
- if (_numTracks > ARRAYSIZE(_tracks)) {
- warning("Can only handle %d tracks but was handed %d", (int)ARRAYSIZE(_tracks), (int)_numTracks);
+ if (_numTracks > MAXIMUM_TRACKS) {
+ warning("Can only handle %d tracks but was handed %d", (int)MAXIMUM_TRACKS, (int)_numTracks);
+ return false;
+ }
+ if (midiType == 1 && numTrackChunks > MAXIMUM_SUBTRACKS) {
+ warning("Can only handle MIDI type 1 with %d subtracks but was handed %d", (int)MAXIMUM_SUBTRACKS, (int)numTrackChunks);
return false;
}
More information about the Scummvm-git-logs
mailing list