From 8315a00a016a9ef6d7f1fe06f29a33f333bbf7f8 Mon Sep 17 00:00:00 2001 From: capehill Date: Wed, 28 Jun 2023 21:25:01 +0300 Subject: [PATCH] Fix crash in AudioConvertByteswap --- src/audio/SDL_audiocvt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 8c3badcb4..299dfd107 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -238,7 +238,7 @@ static void AudioConvertByteswap(void *dst, const void *src, int num_samples, in case b: { \ const Uint##b *tsrc = (const Uint##b *)src; \ Uint##b *tdst = (Uint##b *)dst; \ - for (i = num_samples; i; i++) { \ + for (i = 0; i < num_samples; i++) { \ tdst[i] = SDL_Swap##b(tsrc[i]); \ } \ break; \