src/audio/SDL_wave.c
changeset 7037 3fedf1f25b94
parent 6885 700f1b25f77f
child 7313 c7346a060a7d
     1.1 --- a/src/audio/SDL_wave.c	Fri Mar 29 21:29:57 2013 -0400
     1.2 +++ b/src/audio/SDL_wave.c	Sun Mar 31 12:48:50 2013 -0400
     1.3 @@ -134,8 +134,7 @@
     1.4          MS_ADPCM_state.wavefmt.channels * sizeof(Sint16);
     1.5      *audio_buf = (Uint8 *) SDL_malloc(*audio_len);
     1.6      if (*audio_buf == NULL) {
     1.7 -        SDL_Error(SDL_ENOMEM);
     1.8 -        return (-1);
     1.9 +        return SDL_OutOfMemory();
    1.10      }
    1.11      decoded = *audio_buf;
    1.12  
    1.13 @@ -359,8 +358,7 @@
    1.14          IMA_ADPCM_state.wavefmt.channels * sizeof(Sint16);
    1.15      *audio_buf = (Uint8 *) SDL_malloc(*audio_len);
    1.16      if (*audio_buf == NULL) {
    1.17 -        SDL_Error(SDL_ENOMEM);
    1.18 -        return (-1);
    1.19 +        return SDL_OutOfMemory();
    1.20      }
    1.21      decoded = *audio_buf;
    1.22  
    1.23 @@ -620,14 +618,12 @@
    1.24      chunk->length = SDL_ReadLE32(src);
    1.25      chunk->data = (Uint8 *) SDL_malloc(chunk->length);
    1.26      if (chunk->data == NULL) {
    1.27 -        SDL_Error(SDL_ENOMEM);
    1.28 -        return (-1);
    1.29 +        return SDL_OutOfMemory();
    1.30      }
    1.31      if (SDL_RWread(src, chunk->data, chunk->length, 1) != 1) {
    1.32 -        SDL_Error(SDL_EFREAD);
    1.33          SDL_free(chunk->data);
    1.34          chunk->data = NULL;
    1.35 -        return (-1);
    1.36 +        return SDL_Error(SDL_EFREAD);
    1.37      }
    1.38      return (chunk->length);
    1.39  }