mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 12:00:45 +00:00
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 a new issue