From c5293fc7536b6f3a525192651d77e67d85d6cce3 Mon Sep 17 00:00:00 2001 From: derselbst Date: Sun, 28 Jun 2020 14:58:02 +0200 Subject: [PATCH] Fix an uninitialized memory access that could possibly trigger an FPE trap for instruments that use the exclusive class generator --- src/synth/fluid_synth.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c index 19cb65bf..63c26ec4 100644 --- a/src/synth/fluid_synth.c +++ b/src/synth/fluid_synth.c @@ -4527,14 +4527,13 @@ fluid_synth_kill_by_exclusive_class_LOCAL(fluid_synth_t *synth, for(i = 0; i < synth->polyphony; i++) { fluid_voice_t *existing_voice = synth->voice[i]; - int existing_excl_class = fluid_voice_gen_value(existing_voice, GEN_EXCLUSIVECLASS); /* If voice is playing, on the same channel, has same exclusive * class and is not part of the same noteon event (voice group), then kill it */ if(fluid_voice_is_playing(existing_voice) && fluid_voice_get_channel(existing_voice) == fluid_voice_get_channel(new_voice) - && existing_excl_class == excl_class + && fluid_voice_gen_value(existing_voice, GEN_EXCLUSIVECLASS) == excl_class && fluid_voice_get_id(existing_voice) != fluid_voice_get_id(new_voice)) { fluid_voice_kill_excl(existing_voice);