src/audio/SDL_wave.c
changeset 1465 8dfa9a6d69a5
parent 1428 5f52867ba65c
child 1487 dc6b59e925a2
--- a/src/audio/SDL_wave.c	Sat Mar 04 05:13:03 2006 +0000
+++ b/src/audio/SDL_wave.c	Sat Mar 04 08:24:35 2006 +0000
@@ -550,12 +550,13 @@
 	if ( format != NULL ) {
 		SDL_free(format);
 	}
-	if ( freesrc && src ) {
-		SDL_RWclose(src);
-	}
-	else {
-		// seek to the end of the file (given by the RIFF chunk)
-		SDL_RWseek(src, wavelen - chunk.length - headerDiff, RW_SEEK_CUR);
+	if ( src ) {
+		if ( freesrc ) {
+			SDL_RWclose(src);
+		} else {
+			// seek to the end of the file (given by the RIFF chunk)
+			SDL_RWseek(src, wavelen - chunk.length - headerDiff, RW_SEEK_CUR);
+		}
 	}
 	if ( was_error ) {
 		spec = NULL;