Don't leave garbage in output parameters

This commit is contained in:
Sam Lantinga
2025-07-29 20:48:32 -07:00
parent cd15893ea3
commit c663b6ec1f

View File

@@ -531,6 +531,12 @@ bool SDL_UnlockAudioStream(SDL_AudioStream *stream)
bool SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec)
{
if (!stream) {
if (src_spec) {
SDL_zerop(src_spec);
}
if (dst_spec) {
SDL_zerop(dst_spec);
}
return SDL_InvalidParamError("stream");
}