mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-06-03 02:20:50 +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:
parent
4261848dd4
commit
c5293fc753
1 changed files with 1 additions and 2 deletions
|
@ -4527,14 +4527,13 @@ fluid_synth_kill_by_exclusive_class_LOCAL(fluid_synth_t *synth,
|
||||||
for(i = 0; i < synth->polyphony; i++)
|
for(i = 0; i < synth->polyphony; i++)
|
||||||
{
|
{
|
||||||
fluid_voice_t *existing_voice = synth->voice[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
|
/* 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 */
|
* class and is not part of the same noteon event (voice group), then kill it */
|
||||||
|
|
||||||
if(fluid_voice_is_playing(existing_voice)
|
if(fluid_voice_is_playing(existing_voice)
|
||||||
&& fluid_voice_get_channel(existing_voice) == fluid_voice_get_channel(new_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_get_id(existing_voice) != fluid_voice_get_id(new_voice))
|
||||||
{
|
{
|
||||||
fluid_voice_kill_excl(existing_voice);
|
fluid_voice_kill_excl(existing_voice);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue