src/audio/SDL_wave.c
changeset 171 02e27b705645
parent 0 74212992fb08
child 252 e8157fcb3114
     1.1 --- a/src/audio/SDL_wave.c	Tue Sep 04 23:22:23 2001 +0000
     1.2 +++ b/src/audio/SDL_wave.c	Tue Sep 11 18:52:45 2001 +0000
     1.3 @@ -434,7 +434,13 @@
     1.4  	/* Check the magic header */
     1.5  	RIFFchunk	= SDL_ReadLE32(src);
     1.6  	wavelen		= SDL_ReadLE32(src);
     1.7 -	WAVEmagic	= SDL_ReadLE32(src);
     1.8 +	if ( wavelen == WAVE ) { /* The RIFFchunk has already been read */
     1.9 +		WAVEmagic = wavelen;
    1.10 +		wavelen   = RIFFchunk;
    1.11 +		RIFFchunk = RIFF;
    1.12 +	} else {
    1.13 +		WAVEmagic = SDL_ReadLE32(src);
    1.14 +	}
    1.15  	if ( (RIFFchunk != RIFF) || (WAVEmagic != WAVE) ) {
    1.16  		SDL_SetError("Unrecognized file type (not WAVE)");
    1.17  		was_error = 1;