mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-13 00:04:10 +00:00
Enforce fluid_voice_add_mod() checking
This commit is contained in:
parent
650d654f3d
commit
7ca6bcc16a
1 changed files with 8 additions and 0 deletions
|
@ -1539,9 +1539,17 @@ fluid_voice_stop(fluid_voice_t *voice)
|
||||||
void
|
void
|
||||||
fluid_voice_add_mod(fluid_voice_t *voice, fluid_mod_t *mod, int mode)
|
fluid_voice_add_mod(fluid_voice_t *voice, fluid_mod_t *mod, int mode)
|
||||||
{
|
{
|
||||||
|
fluid_return_if_fail(voice != NULL);
|
||||||
|
fluid_return_if_fail(mod != NULL);
|
||||||
|
|
||||||
|
/* mod must be simple modulator. Ignore it if it is a linked modulator */
|
||||||
|
fluid_return_if_fail(!fluid_mod_is_linked(mod));
|
||||||
|
|
||||||
/* Ignore the modulator if its sources inputs are invalid */
|
/* Ignore the modulator if its sources inputs are invalid */
|
||||||
if(fluid_mod_check_sources(mod, "api fluid_voice_add_mod mod"))
|
if(fluid_mod_check_sources(mod, "api fluid_voice_add_mod mod"))
|
||||||
{
|
{
|
||||||
|
/* Initialize next, in case mod doesn't come from new_fluid_mod() */
|
||||||
|
mod->next = NULL;
|
||||||
fluid_voice_add_mod_local(voice, mod, mode, FLUID_NUM_MOD);
|
fluid_voice_add_mod_local(voice, mod, mode, FLUID_NUM_MOD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue