0
0
Fork 0
mirror of https://github.com/ZDoom/fluidsynth.git synced 2025-04-13 03:10:55 +00:00

Fix an uninitialized memory access

that could possibly trigger an FPE trap for instruments that use the exclusive class generator
This commit is contained in:
derselbst 2020-06-28 14:58:02 +02:00
parent 4261848dd4
commit c5293fc753

View file

@ -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);