make fluid_synth_write_float() safe when called with NULL buffers

This commit is contained in:
derselbst 2018-07-20 19:30:18 +02:00
parent 8afb46515f
commit f6f66d53fd

View file

@ -3327,6 +3327,10 @@ fluid_synth_nwrite_float(fluid_synth_t *synth, int len,
#endif #endif
float cpu_load; float cpu_load;
fluid_return_val_if_fail(synth != NULL, FLUID_FAILED);
fluid_return_val_if_fail(left != NULL, FLUID_FAILED);
fluid_return_val_if_fail(right != NULL, FLUID_FAILED);
/* First, take what's still available in the buffer */ /* First, take what's still available in the buffer */
count = 0; count = 0;
num = synth->cur; num = synth->cur;
@ -3742,6 +3746,10 @@ fluid_synth_write_float(fluid_synth_t *synth, int len,
float cpu_load; float cpu_load;
fluid_profile_ref_var(prof_ref); fluid_profile_ref_var(prof_ref);
fluid_return_val_if_fail(synth != NULL, FLUID_FAILED);
fluid_return_val_if_fail(lout != NULL, FLUID_FAILED);
fluid_return_val_if_fail(rout != NULL, FLUID_FAILED);
fluid_rvoice_mixer_set_mix_fx(synth->eventhandler->mixer, 1); fluid_rvoice_mixer_set_mix_fx(synth->eventhandler->mixer, 1);
l = synth->cur; l = synth->cur;