src/audio/SDL_wave.c
changeset 1465 8dfa9a6d69a5
parent 1428 5f52867ba65c
child 1487 dc6b59e925a2
     1.1 --- a/src/audio/SDL_wave.c	Sat Mar 04 05:13:03 2006 +0000
     1.2 +++ b/src/audio/SDL_wave.c	Sat Mar 04 08:24:35 2006 +0000
     1.3 @@ -550,12 +550,13 @@
     1.4  	if ( format != NULL ) {
     1.5  		SDL_free(format);
     1.6  	}
     1.7 -	if ( freesrc && src ) {
     1.8 -		SDL_RWclose(src);
     1.9 -	}
    1.10 -	else {
    1.11 -		// seek to the end of the file (given by the RIFF chunk)
    1.12 -		SDL_RWseek(src, wavelen - chunk.length - headerDiff, RW_SEEK_CUR);
    1.13 +	if ( src ) {
    1.14 +		if ( freesrc ) {
    1.15 +			SDL_RWclose(src);
    1.16 +		} else {
    1.17 +			// seek to the end of the file (given by the RIFF chunk)
    1.18 +			SDL_RWseek(src, wavelen - chunk.length - headerDiff, RW_SEEK_CUR);
    1.19 +		}
    1.20  	}
    1.21  	if ( was_error ) {
    1.22  		spec = NULL;