From 5e985b72dc1afbacbb96cc89b5472264e7a93737 Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Mon, 15 Apr 2024 20:12:38 +0100 Subject: [PATCH] SDL_ConvertAudioSamples: Make sure we got enough data --- 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 a7cc96dd6..c1d920934 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -1102,7 +1102,7 @@ int SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec, const Uint8 *src_data if (dstlen >= 0) { dst = (Uint8 *)SDL_malloc(dstlen); if (dst) { - retval = (SDL_GetAudioStreamData(stream, dst, dstlen) >= 0) ? 0 : -1; + retval = (SDL_GetAudioStreamData(stream, dst, dstlen) == dstlen) ? 0 : -1; } } }