src/audio/SDL_wave.c
changeset 3611 57823d017f02
parent 2859 99210400e8b9
child 3697 f7b03b6838cb
     1.1 --- a/src/audio/SDL_wave.c	Wed Jan 06 07:26:49 2010 +0000
     1.2 +++ b/src/audio/SDL_wave.c	Wed Jan 06 07:34:20 2010 +0000
     1.3 @@ -454,6 +454,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 @@ -553,6 +554,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 @@ -625,6 +627,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);