evr/presenter: Validate passed handle on SetVideoWindow().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c01a9bae61
commit
adc4dd674a
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue