Commit adc4dd67 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

evr/presenter: Validate passed handle on SetVideoWindow().

parent c01a9bae
......@@ -603,6 +603,9 @@ static HRESULT WINAPI video_presenter_control_SetVideoWindow(IMFVideoDisplayCont
TRACE("%p, %p.\n", iface, window);
if (!IsWindow(window))
return E_INVALIDARG;
EnterCriticalSection(&presenter->cs);
presenter->video_window = window;
LeaveCriticalSection(&presenter->cs);
......
......@@ -1073,6 +1073,12 @@ static void test_default_presenter(void)
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(hwnd2 == NULL, "Unexpected window %p.\n", hwnd2);
hr = IMFVideoDisplayControl_SetVideoWindow(display_control, NULL);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
hr = IMFVideoDisplayControl_SetVideoWindow(display_control, (HWND)0x1);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
hr = IMFVideoDisplayControl_SetVideoWindow(display_control, hwnd);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment