use explicit array access in fluid_synth_nwrite_float()

rather than pointer arithmetic
This commit is contained in:
derselbst 2018-05-18 13:09:03 +02:00
parent 6bcdf87c06
commit ce337e2497

View file

@ -2972,8 +2972,8 @@ fluid_synth_nwrite_float(fluid_synth_t* synth, int len,
for (i = 0; i < synth->audio_channels; i++) { for (i = 0; i < synth->audio_channels; i++) {
#ifdef WITH_FLOAT #ifdef WITH_FLOAT
FLUID_MEMCPY(left[i], &left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT] + synth->cur, bytes); FLUID_MEMCPY(left[i], &left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + synth->cur], bytes);
FLUID_MEMCPY(right[i], &right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT] + synth->cur, bytes); FLUID_MEMCPY(right[i], &right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + synth->cur], bytes);
#else //WITH_FLOAT #else //WITH_FLOAT
int j; int j;
for (j = 0; j < num; j++) { for (j = 0; j < num; j++) {
@ -2987,10 +2987,10 @@ fluid_synth_nwrite_float(fluid_synth_t* synth, int len,
{ {
#ifdef WITH_FLOAT #ifdef WITH_FLOAT
if(fx_left != NULL) if(fx_left != NULL)
FLUID_MEMCPY(fx_left[i], &fx_left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT] + synth->cur, bytes); FLUID_MEMCPY(fx_left[i], &fx_left_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + synth->cur], bytes);
if(fx_right != NULL) if(fx_right != NULL)
FLUID_MEMCPY(fx_right[i], &fx_right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT] + synth->cur, bytes); FLUID_MEMCPY(fx_right[i], &fx_right_in[i * FLUID_BUFSIZE * FLUID_MIXER_MAX_BUFFERS_DEFAULT + synth->cur], bytes);
#else //WITH_FLOAT #else //WITH_FLOAT
int j; int j;
if(fx_left != NULL) { if(fx_left != NULL) {