From 31d8118581d98cb04752fcd343453019d6a8206d Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sat, 25 Apr 2026 15:48:07 +0100 Subject: [PATCH] plugins: sdl: fix LoadWAVStream failing to load WAV files Reading the WAV length seems to have been accidentally commented out in commit e28d1fe91671. The WAV length is not used here but disabling the read broke WAV header parsing completely. Change-Id: Ia6d0b1a168b2b029bd1cbec9bdc482caf6fa0487 --- apps/plugins/sdl/SDL_mixer/wavestream.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/plugins/sdl/SDL_mixer/wavestream.c b/apps/plugins/sdl/SDL_mixer/wavestream.c index 489863908f..8dbb2a934a 100644 --- a/apps/plugins/sdl/SDL_mixer/wavestream.c +++ b/apps/plugins/sdl/SDL_mixer/wavestream.c @@ -286,7 +286,7 @@ static SDL_RWops *LoadWAVStream (SDL_RWops *src, SDL_AudioSpec *spec, /* WAV magic header */ Uint32 RIFFchunk; -// Uint32 wavelen; + Uint32 wavelen; Uint32 WAVEmagic; /* FMT chunk */ @@ -296,8 +296,12 @@ static SDL_RWops *LoadWAVStream (SDL_RWops *src, SDL_AudioSpec *spec, /* Check the magic header */ RIFFchunk = SDL_ReadLE32(src); -// wavelen = SDL_ReadLE32(src); + wavelen = SDL_ReadLE32(src); WAVEmagic = SDL_ReadLE32(src); + + /* Unused */ + (void)wavelen; + if ( (RIFFchunk != RIFF) || (WAVEmagic != WAVE) ) { Mix_SetError("Unrecognized file type (not WAVE)"); was_error = 1;