audio: Fixed off-by-one error in upsampling.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 24 Jan 2017 00:03:36 -0500
changeset 10841b9d6a3d65394
parent 10840 3c3708a0b217
child 10842 30b37eaf3b3c
audio: Fixed off-by-one error in upsampling.
src/audio/SDL_audiocvt.c
     1.1 --- a/src/audio/SDL_audiocvt.c	Mon Jan 23 16:45:50 2017 -0500
     1.2 +++ b/src/audio/SDL_audiocvt.c	Tue Jan 24 00:03:36 2017 -0500
     1.3 @@ -314,7 +314,7 @@
     1.4              SDL_memcpy(last_sample, final_sample, framelen);
     1.5          }
     1.6  
     1.7 -        dst = (outbuf + (dest_samples * chans)) - 1;
     1.8 +        dst = (outbuf + (dest_samples * chans));
     1.9      } else {  /* downsample */
    1.10          float *target = (outbuf + (dest_samples * chans));
    1.11          dst = outbuf;
    1.12 @@ -410,7 +410,7 @@
    1.13          last_sample[1] = final_right;
    1.14          last_sample[0] = final_left;
    1.15  
    1.16 -        dst = (outbuf + (dest_samples * chans)) - 1;
    1.17 +        dst = (outbuf + (dest_samples * chans));
    1.18      } else {
    1.19          Sint16 *target = (outbuf + (dest_samples * chans));
    1.20          dst = outbuf;