diff --git a/src/platform/sdl/sdl-audio.c b/src/platform/sdl/sdl-audio.c index 3e19ce2c5..ccc2fd9d1 100644 --- a/src/platform/sdl/sdl-audio.c +++ b/src/platform/sdl/sdl-audio.c @@ -97,7 +97,7 @@ static void _GBASDLAudioCallback(void* context, Uint8* data, int len) { } GBASyncConsumeAudio(&audioContext->thread->sync); if (available < len) { - memset(((short*) data) + audioContext->obtainedSpec.channels * available, 0, len - available); + memset(((short*) data) + audioContext->obtainedSpec.channels * available, 0, (len - available) * audioContext->obtainedSpec.channels * sizeof(short)); } #endif }