evr/presenter: Check for null argument in GetVideoWindow().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-10-06 14:48:58 +03:00 committed by Alexandre Julliard
parent 9b1bd73188
commit c01a9bae61
2 changed files with 8 additions and 0 deletions

View File

@ -616,7 +616,12 @@ static HRESULT WINAPI video_presenter_control_GetVideoWindow(IMFVideoDisplayCont
TRACE("%p, %p.\n", iface, window);
if (!window)
return E_POINTER;
EnterCriticalSection(&presenter->cs);
*window = presenter->video_window;
LeaveCriticalSection(&presenter->cs);
return S_OK;
}

View File

@ -1065,6 +1065,9 @@ static void test_default_presenter(void)
hwnd = create_window();
ok(!!hwnd, "Failed to create a test window.\n");
hr = IMFVideoDisplayControl_GetVideoWindow(display_control, NULL);
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
hwnd2 = hwnd;
hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &hwnd2);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);