From 9b91843fa84295eef0c2518eea3e10b20b9fa1ca Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 29 Jul 2025 20:49:39 -0700
Subject: [PATCH] Don't leave garbage in output parameters
---
src/SDL_mixer.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/SDL_mixer.c b/src/SDL_mixer.c
index d2dc7d00..b3b50a1e 100644
--- a/src/SDL_mixer.c
+++ b/src/SDL_mixer.c
@@ -897,6 +897,9 @@ SDL_PropertiesID MIX_GetMixerProperties(MIX_Mixer *mixer)
bool MIX_GetMixerFormat(MIX_Mixer *mixer, SDL_AudioSpec *spec)
{
if (!CheckMixerParam(mixer)) {
+ if (spec) {
+ SDL_zerop(spec);
+ }
return false;
} else if (!spec) {
return SDL_InvalidParamError("spec");