From 7ee24599276861edf45db4a4779c61cd0341f690 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 30 May 2023 01:09:21 -0400 Subject: [PATCH] audio: Check for unlikely failure case in WAV loaded. I don't think this can fail at the moment, but if WaveCheckFormat goes out of sync with this switch statement at some point, this seems like a good failsafe. --- src/audio/SDL_wave.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index e7e5fc0327..759d34d9e1 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -2058,6 +2058,8 @@ static int WaveLoad(SDL_RWops *src, WaveFile *file, SDL_AudioSpec *spec, Uint8 * return SDL_SetError("Unexpected %u-bit PCM data format", (unsigned int)format->bitspersample); } break; + default: + return SDL_SetError("Unexpected data format"); } /* Report the end position back to the cleanup code. */