Skip to content

Commit

Permalink
nacl: Fixed crash if allocating memory for audio device failed.
Browse files Browse the repository at this point in the history
  • Loading branch information
philippwiesemann committed May 28, 2017
1 parent 7c5078d commit fc510bd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/audio/nacl/SDL_naclaudio.c
Expand Up @@ -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();
Expand All @@ -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
Expand Down

0 comments on commit fc510bd

Please sign in to comment.