diff options
author | wm4 <wm4@nowhere> | 2015-06-17 13:42:31 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-06-17 13:42:31 +0200 |
commit | d4aaf29a05b3f8d434371d970d878861694a37f2 (patch) | |
tree | 7c25fd068f972a08dbe27d9b94bf66972f219267 /audio | |
parent | 762623cdef4de03412d8e425d603dab8ecc4590d (diff) | |
download | mpv-d4aaf29a05b3f8d434371d970d878861694a37f2.tar.bz2 mpv-d4aaf29a05b3f8d434371d970d878861694a37f2.tar.xz |
ao_wasapi: fix crash on hotplug init error
On init error, the mp_msg macros are actually called. They could cause
a crash because state->log was NULL.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao_wasapi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c index 3c0bab3231..81b7535c4b 100644 --- a/audio/out/ao_wasapi.c +++ b/audio/out/ao_wasapi.c @@ -390,6 +390,7 @@ static int hotplug_init(struct ao *ao) { MP_DBG(ao, "Hotplug init\n"); struct wasapi_state *state = ao->priv; + state->log = ao->log; CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); HRESULT hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &IID_IMMDeviceEnumerator, (void **)&state->pEnumerator); |