summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2014-11-17 03:28:41 -0800
committerKevin Mitchell <kevmitch@gmail.com>2014-11-17 04:13:52 -0800
commitf7c26230eb5ed3e3fc8517f069b1ef863aef8260 (patch)
tree077fef51f1fb5993ae99e73978d979c91147fd2f
parent3da6f723c6ceba468412f2282ab4f7958ca6f5d7 (diff)
downloadmpv-f7c26230eb5ed3e3fc8517f069b1ef863aef8260.tar.bz2
mpv-f7c26230eb5ed3e3fc8517f069b1ef863aef8260.tar.xz
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
-rwxr-xr-xaudio/out/ao_wasapi_utils.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c
index 69bbefe5ef..cf94220c4e 100755
--- a/audio/out/ao_wasapi_utils.c
+++ b/audio/out/ao_wasapi_utils.c
@@ -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);