Skip to content

Unchecked set audio stream format in MIX_DecodeAudio #890

Description

@Starbuck5

Hello, I was testing putting invalid values into the audio spec in MIX_DecodeAudio while working on a Python port of the functionality. I noticed that whatever values I put in, the output still worked. Even negative values, 60 channels, etc. By calling MIX_GetAudioDecoderFormat, I could tell the values were just not getting set if they were invalid. My expected behavior was for the invalid input to be rejected by SDL.

I checked the code and I noticed that it's not checking the output of SDL_SetAudioStreamFormat here.

https://github.com/libsdl-org/SDL_mixer/blob/main/src/SDL_mixer.c#L3189

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions