plugins: sdl: fix LoadWAVStream failing to load WAV files

Reading the WAV length seems to have been accidentally
commented out in commit e28d1fe916. The WAV length is
not used here but disabling the read broke WAV header
parsing completely.

Change-Id: Ia6d0b1a168b2b029bd1cbec9bdc482caf6fa0487
This commit is contained in:
Aidan MacDonald 2026-04-25 15:48:07 +01:00
parent 80e3c0b065
commit 31d8118581

View file

@ -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;