Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed off-by-one error in SDL_ConvertStereo().
Browse files Browse the repository at this point in the history
Fixes Bugzilla #561.
  • Loading branch information
icculus committed Jul 12, 2013
1 parent d2d1ada commit 5358299
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/audio/SDL_audiocvt.c
Expand Up @@ -293,10 +293,9 @@ SDL_ConvertStereo(SDL_AudioCVT * cvt, SDL_AudioFormat format)
const type *src = (const type *) (cvt->buf + cvt->len_cvt); \
type *dst = (type *) (cvt->buf + cvt->len_cvt * 2); \
for (i = cvt->len_cvt / sizeof(type); i; --i) { \
const type val = *src; \
src -= 1; \
dst -= 2; \
dst[0] = dst[1] = val; \
dst[0] = dst[1] = *src; \
} \
}

Expand Down

0 comments on commit 5358299

Please sign in to comment.