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
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 */
count = 0;
num = synth->cur;
@ -3743,6 +3747,10 @@ fluid_synth_write_float(fluid_synth_t *synth, int len,
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);
l = synth->cur;
fluid_rvoice_mixer_get_bufs(synth->eventhandler->mixer, &left_in, &right_in);