mirror of
https://github.com/mpv-player/mpv
synced 2024-12-23 23:32:26 +00:00
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.
This commit is contained in:
parent
762623cdef
commit
d4aaf29a05
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user