From 932f0b5c5b16d54bf3b62c5c3ede901482268c02 Mon Sep 17 00:00:00 2001 From: derselbst Date: Sun, 18 Aug 2024 11:48:12 +0200 Subject: [PATCH] Reject MIDI Format 2 Addresses issue #1366 --- src/midi/fluid_midi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/midi/fluid_midi.c b/src/midi/fluid_midi.c index 1f6a9ad12..85e002023 100644 --- a/src/midi/fluid_midi.c +++ b/src/midi/fluid_midi.c @@ -357,6 +357,12 @@ fluid_midi_file_read_mthd(fluid_midi_file *mf) } mf->type = mthd[9]; + if(!(mf->type == 0 || mf->type == 1)) + { + FLUID_LOG(FLUID_ERR, + "Sorry, but MIDI Format %d is not supported by this player", mf->type); + return FLUID_FAILED; + } mf->ntracks = (unsigned) mthd[11]; mf->ntracks += (unsigned int)(mthd[10]) << 16;