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
|
#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;
|
||||||
|
|
Loading…
Reference in a new issue