From 124a5b71bc75be956616a8b4ae354271255aa0ef Mon Sep 17 00:00:00 2001 From: jjceresa <32781294+jjceresa@users.noreply.github.com> Date: Fri, 30 Mar 2018 20:03:15 +0200 Subject: [PATCH] fix buffer overrun during channel disabled check (#358) --- src/synth/fluid_synth.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c index 904ba86f..defeffed 100644 --- a/src/synth/fluid_synth.c +++ b/src/synth/fluid_synth.c @@ -1831,8 +1831,7 @@ fluid_synth_all_notes_off(fluid_synth_t* synth, int chan) result = FLUID_FAILED; else { - /* Allowed only on MIDI channel enabled */ - FLUID_API_RETURN_IF_CHAN_DISABLED(FLUID_FAILED); + /* Allowed (even for channel disabled) as chan = -1 selects all channels */ result = fluid_synth_all_notes_off_LOCAL (synth, chan); } FLUID_API_RETURN(result); @@ -1874,8 +1873,7 @@ fluid_synth_all_sounds_off(fluid_synth_t* synth, int chan) result = FLUID_FAILED; else { - /* Allowed only on MIDI channel enabled */ - FLUID_API_RETURN_IF_CHAN_DISABLED(FLUID_FAILED); + /* Allowed (even for channel disabled) as chan = -1 selects all channels */ result = fluid_synth_all_sounds_off_LOCAL (synth, chan); } FLUID_API_RETURN(result);