From a80cb672e3365326a9926727bdf746b66eed9093 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 24 Jan 2017 00:03:36 -0500 Subject: [PATCH] audio: Fixed off-by-one error in upsampling. --- src/audio/SDL_audiocvt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 09ea91b89..82367f71b 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -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; @@ -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;