Skip to content

Commit

Permalink
Fix crash in SDL audio thread, by Juha Kuikka
Browse files Browse the repository at this point in the history
Wrong audio spec structure was populated with the internal callback, causing the audio thread to call a NULL pointer.
  • Loading branch information
slouken committed Apr 19, 2017
1 parent 1d1a0d7 commit d20d426
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/audio/SDL_audio.c
Expand Up @@ -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 */
Expand Down

0 comments on commit d20d426

Please sign in to comment.