[Commits] SDL: nacl: Fixed crash if allocating memory for audio device fai...

libsdl.org revision control commits-owner at libsdl.org
Sun May 28 13:00:30 PDT 2017


details:   https://hg.libsdl.org/SDL/rev/0ebcca15e978
changeset: 11048:0ebcca15e978
user:      Philipp Wiesemann <philipp.wiesemann at arcor.de>
date:      Sun May 28 21:50:47 2017 +0200
description:
nacl: Fixed crash if allocating memory for audio device failed.

diffstat:

 src/audio/nacl/SDL_naclaudio.c |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (22 lines):

diff -r 3abb7c6f2e74 -r 0ebcca15e978 src/audio/nacl/SDL_naclaudio.c
--- a/src/audio/nacl/SDL_naclaudio.c	Sun May 28 21:50:37 2017 +0200
+++ b/src/audio/nacl/SDL_naclaudio.c	Sun May 28 21:50:47 2017 +0200
@@ -106,8 +106,7 @@
     
     private = (SDL_PrivateAudioData *) SDL_calloc(1, (sizeof *private));
     if (private == NULL) {
-        SDL_OutOfMemory();
-        return 0;
+        return SDL_OutOfMemory();
     }
     
     private->mutex = SDL_CreateMutex();
@@ -131,7 +130,7 @@
     /* Start audio playback while we are still on the main thread. */
     ppb_audio->StartPlayback(private->audio);
     
-    return 1;
+    return 0;
 }
 
 static int


More information about the commits mailing list