Nikolay Sivov : evr/presenter: Check for null argument in GetVideoWindow().
Module: wine Branch: master Commit: c01a9bae61618eca9a551108994b374b05e865ed URL: https://source.winehq.org/git/wine.git/?a=commit;h=c01a9bae61618eca9a5511089... Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Oct 6 14:48:58 2020 +0300 evr/presenter: Check for null argument in GetVideoWindow(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/evr/presenter.c | 5 +++++ dlls/evr/tests/evr.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/dlls/evr/presenter.c b/dlls/evr/presenter.c index 8c455778d7..9acbead728 100644 --- a/dlls/evr/presenter.c +++ b/dlls/evr/presenter.c @@ -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; } diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 85eedbe664..53f1b02724 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -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);
participants (1)
-
Alexandre Julliard