From d20d426c3a5fd1d8cafd3193bd7dcde8b8fd2946 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 18 Apr 2017 22:17:40 -0700 Subject: [PATCH] Fix crash in SDL audio thread, by Juha Kuikka Wrong audio spec structure was populated with the internal callback, causing the audio thread to call a NULL pointer. --- src/audio/SDL_audio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 051ebdd47..a25865c35 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -1344,8 +1344,8 @@ open_audio_device(const char *devname, int iscapture, SDL_SetError("Couldn't create audio buffer queue"); return 0; } - device->spec.callback = iscapture ? SDL_BufferQueueFillCallback : SDL_BufferQueueDrainCallback; - device->spec.userdata = device; + device->callbackspec.callback = iscapture ? SDL_BufferQueueFillCallback : SDL_BufferQueueDrainCallback; + device->callbackspec.userdata = device; } /* Allocate a scratch audio buffer */