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

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

parent 9b1bd731
...@@ -616,7 +616,12 @@ static HRESULT WINAPI video_presenter_control_GetVideoWindow(IMFVideoDisplayCont ...@@ -616,7 +616,12 @@ static HRESULT WINAPI video_presenter_control_GetVideoWindow(IMFVideoDisplayCont
TRACE("%p, %p.\n", iface, window); TRACE("%p, %p.\n", iface, window);
if (!window)
return E_POINTER;
EnterCriticalSection(&presenter->cs);
*window = presenter->video_window; *window = presenter->video_window;
LeaveCriticalSection(&presenter->cs);
return S_OK; return S_OK;
} }
......
...@@ -1065,6 +1065,9 @@ static void test_default_presenter(void) ...@@ -1065,6 +1065,9 @@ static void test_default_presenter(void)
hwnd = create_window(); hwnd = create_window();
ok(!!hwnd, "Failed to create a test window.\n"); 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; hwnd2 = hwnd;
hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &hwnd2); hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &hwnd2);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); 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