mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-01 00:21:14 +00:00
make fluid_synth_write_float() safe when called with NULL buffers
This commit is contained in:
parent
8afb46515f
commit
f6f66d53fd
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue