Skip to content

Commit ca01016

Browse files
Wohlstandicculus
authored andcommitted
SDL_audiotypecvt.c: Fixed memory corruption when resampling S16 t F32
1 parent c53c351 commit ca01016

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/audio/SDL_audiotypecvt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static void SDLCALL SDL_Convert_U8_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFor
125125

126126
static void SDLCALL SDL_Convert_S16_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format)
127127
{
128-
const int num_samples = cvt->len_cvt;
128+
const int num_samples = cvt->len_cvt / sizeof(Sint16);
129129
const Sint16 *src = (const Sint16 *)cvt->buf;
130130
float *dst = (float *)cvt->buf;
131131
int i;

0 commit comments

Comments
 (0)