From fc510bd7985191478613bd3b52c088f078b84fbf Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Sun, 28 May 2017 21:50:47 +0200 Subject: [PATCH] nacl: Fixed crash if allocating memory for audio device failed. --- src/audio/nacl/SDL_naclaudio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/audio/nacl/SDL_naclaudio.c b/src/audio/nacl/SDL_naclaudio.c index abbaf1db50faa..dc5930b2f6d20 100644 --- a/src/audio/nacl/SDL_naclaudio.c +++ b/src/audio/nacl/SDL_naclaudio.c @@ -106,8 +106,7 @@ NACLAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { 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 @@ NACLAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { /* Start audio playback while we are still on the main thread. */ ppb_audio->StartPlayback(private->audio); - return 1; + return 0; } static int