Skip to content

Commit

Permalink
audio: Fixed off-by-one error in upsampling.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jan 24, 2017
1 parent dad07f9 commit a80cb67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/audio/SDL_audiocvt.c
Expand Up @@ -314,7 +314,7 @@ SDL_ResampleAudioSimple(const int chans, const double rate_incr,
SDL_memcpy(last_sample, final_sample, framelen);
}

dst = (outbuf + (dest_samples * chans)) - 1;
dst = (outbuf + (dest_samples * chans));
} else { /* downsample */
float *target = (outbuf + (dest_samples * chans));
dst = outbuf;
Expand Down Expand Up @@ -410,7 +410,7 @@ SDL_ResampleAudioSimple_si16_c2(const double rate_incr,
last_sample[1] = final_right;
last_sample[0] = final_left;

dst = (outbuf + (dest_samples * chans)) - 1;
dst = (outbuf + (dest_samples * chans));
} else {
Sint16 *target = (outbuf + (dest_samples * chans));
dst = outbuf;
Expand Down

0 comments on commit a80cb67

Please sign in to comment.