mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
nacl: Fixed crash if allocating memory for audio device failed.
This commit is contained in:
parent
7c5078d8bd
commit
fc510bd798
@ -106,8 +106,7 @@ NACLAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) {
|
|||||||
|
|
||||||
private = (SDL_PrivateAudioData *) SDL_calloc(1, (sizeof *private));
|
private = (SDL_PrivateAudioData *) SDL_calloc(1, (sizeof *private));
|
||||||
if (private == NULL) {
|
if (private == NULL) {
|
||||||
SDL_OutOfMemory();
|
return SDL_OutOfMemory();
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private->mutex = SDL_CreateMutex();
|
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. */
|
/* Start audio playback while we are still on the main thread. */
|
||||||
ppb_audio->StartPlayback(private->audio);
|
ppb_audio->StartPlayback(private->audio);
|
||||||
|
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user