src/audio/SDL_wave.c
branchSDL-1.2
changeset 4158 96ce26f24b01
parent 1818 7995cc87b777
child 4159 a1b03ba2fcd0
     1.1 --- a/src/audio/SDL_wave.c	Fri Nov 07 04:15:36 2008 +0000
     1.2 +++ b/src/audio/SDL_wave.c	Wed Nov 12 17:23:40 2008 +0000
     1.3 @@ -440,6 +440,7 @@
     1.4  	do {
     1.5  		if ( chunk.data != NULL ) {
     1.6  			SDL_free(chunk.data);
     1.7 +			chunk.data = NULL;
     1.8  		}
     1.9  		lenread = ReadChunk(src, &chunk);
    1.10  		if ( lenread < 0 ) {
    1.11 @@ -522,6 +523,7 @@
    1.12  	do {
    1.13  		if ( *audio_buf != NULL ) {
    1.14  			SDL_free(*audio_buf);
    1.15 +			*audio_buf = NULL;
    1.16  		}
    1.17  		lenread = ReadChunk(src, &chunk);
    1.18  		if ( lenread < 0 ) {
    1.19 @@ -591,6 +593,7 @@
    1.20  	if ( SDL_RWread(src, chunk->data, chunk->length, 1) != 1 ) {
    1.21  		SDL_Error(SDL_EFREAD);
    1.22  		SDL_free(chunk->data);
    1.23 +		chunk->data = NULL;
    1.24  		return(-1);
    1.25  	}
    1.26  	return(chunk->length);