From 537b68b9f0ef116be22e7d6a5bd6dfd1f1309efd Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 19 Mar 2015 22:11:20 -0400 Subject: [PATCH] Zero out the audio hotplug event structure, so the "padded" fields are sane. Just in case we ever need those bits in the future. --- src/audio/SDL_audio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index eafeb337a4db2..e5680299f5b27 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -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; @@ -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;