return NULL if LADSPA alloc fails

instead of assertion fail
This commit is contained in:
Tom M 2017-10-04 19:59:31 +02:00 committed by GitHub
parent 5ac826d0e0
commit 10c4cfa29e
1 changed files with 6 additions and 2 deletions

View File

@ -40,9 +40,13 @@
#define L(x);
fluid_LADSPA_FxUnit_t* new_fluid_LADSPA_FxUnit(fluid_synth_t* synth){
if(synth == NULL)
return NULL;
fluid_LADSPA_FxUnit_t* FxUnit=FLUID_NEW(fluid_LADSPA_FxUnit_t);
assert(FxUnit);
assert(synth);
if(FxUnit == NULL)
return NULL;
/* The default state is 'bypassed'. The Fx unit has to be turned on explicitly by the user. */
/* Those settings have to be done in order to allow fluid_LADSPA_clean. */
FxUnit->Bypass=fluid_LADSPA_Bypassed;