Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Zero out the audio hotplug event structure, so the "padded" fields ar…
…e sane.

Just in case we ever need those bits in the future.
  • Loading branch information
icculus committed Mar 20, 2015
1 parent cafd030 commit 537b68b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/audio/SDL_audio.c
Expand Up @@ -351,6 +351,7 @@ SDL_AddAudioDevice(const int iscapture, const char *name, void *handle)
/* Post the event, if desired */
if (SDL_GetEventState(SDL_AUDIODEVICEADDED) == SDL_ENABLE) {
SDL_Event event;
SDL_zero(event);
event.adevice.type = SDL_AUDIODEVICEADDED;
event.adevice.which = device_index;
event.adevice.iscapture = iscapture;
Expand All @@ -377,6 +378,7 @@ void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device)
/* Post the event, if desired */
if (SDL_GetEventState(SDL_AUDIODEVICEREMOVED) == SDL_ENABLE) {
SDL_Event event;
SDL_zero(event);
event.adevice.type = SDL_AUDIODEVICEREMOVED;
event.adevice.which = device->id;
event.adevice.iscapture = device->iscapture ? 1 : 0;
Expand Down

0 comments on commit 537b68b

Please sign in to comment.