nacl: Fixed crash if allocating memory for audio device failed.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sun, 28 May 2017 21:50:47 +0200
changeset 110480ebcca15e978
parent 11047 3abb7c6f2e74
child 11049 6e24dc7c67c6
nacl: Fixed crash if allocating memory for audio device failed.
src/audio/nacl/SDL_naclaudio.c
     1.1 --- a/src/audio/nacl/SDL_naclaudio.c	Sun May 28 21:50:37 2017 +0200
     1.2 +++ b/src/audio/nacl/SDL_naclaudio.c	Sun May 28 21:50:47 2017 +0200
     1.3 @@ -106,8 +106,7 @@
     1.4      
     1.5      private = (SDL_PrivateAudioData *) SDL_calloc(1, (sizeof *private));
     1.6      if (private == NULL) {
     1.7 -        SDL_OutOfMemory();
     1.8 -        return 0;
     1.9 +        return SDL_OutOfMemory();
    1.10      }
    1.11      
    1.12      private->mutex = SDL_CreateMutex();
    1.13 @@ -131,7 +130,7 @@
    1.14      /* Start audio playback while we are still on the main thread. */
    1.15      ppb_audio->StartPlayback(private->audio);
    1.16      
    1.17 -    return 1;
    1.18 +    return 0;
    1.19  }
    1.20  
    1.21  static int