SDL: SDL_audiotypecvt.c: Fixed memory corruption when resampling S16 t F32 (384fc)

From 384fcea585573db4e5707c249746008f25a0fbac Mon Sep 17 00:00:00 2001
From: Wohlstand <[EMAIL REDACTED]>
Date: Sat, 3 Feb 2024 10:27:35 +0300
Subject: [PATCH] SDL_audiotypecvt.c: Fixed memory corruption when resampling
 S16 t F32

(cherry picked from commit ca010165770b31ddebf334bc5709302b0d6da41e)
---
 src/audio/SDL_audiotypecvt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/audio/SDL_audiotypecvt.c b/src/audio/SDL_audiotypecvt.c
index 53c8ffe69a4e..f596a81240e6 100644
--- a/src/audio/SDL_audiotypecvt.c
+++ b/src/audio/SDL_audiotypecvt.c
@@ -125,7 +125,7 @@ static void SDLCALL SDL_Convert_U8_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFor
 
 static void SDLCALL SDL_Convert_S16_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format)
 {
-    const int num_samples = cvt->len_cvt;
+    const int num_samples = cvt->len_cvt / sizeof(Sint16);
     const Sint16 *src = (const Sint16 *)cvt->buf;
     float *dst = (float *)cvt->buf;
     int i;