mirror of
https://github.com/mpv-player/mpv
synced 2025-01-31 20:21:49 +00:00
ao/wasapi: fix possible null dereference of pDevice
IMMDeviceEnumerator::GetDefaultAudioEndpoint may set pDevice to null on failure. http://msdn.microsoft.com/en-us/library/windows/desktop/dd371401%28v=vs.85%29.aspx
This commit is contained in:
parent
3da6f723c6
commit
f7c26230eb
@ -950,6 +950,7 @@ HRESULT wasapi_thread_init(struct ao *ao)
|
||||
eRender, eConsole,
|
||||
&state->pDevice);
|
||||
SAFE_RELEASE(pEnumerator, IMMDeviceEnumerator_Release(pEnumerator));
|
||||
EXIT_ON_ERROR(hr);
|
||||
|
||||
char *id = get_device_id(state->pDevice);
|
||||
MP_VERBOSE(ao, "Default device ID: %s\n", id);
|
||||
|
Loading…
Reference in New Issue
Block a user