Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/vmr9.c | 4 ++-- dlls/quartz/vmr9.c | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index a098416bb2c..0bd37fe7f13 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -3226,9 +3226,9 @@ static void test_clipping_window(void) ok(!!window, "Failed to create a window.\n");
hr = IVMRWindowlessControl9_SetVideoClippingWindow(windowless_control, NULL); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); hr = IVMRWindowlessControl9_SetVideoClippingWindow(windowless_control, (HWND)0xdeadbeef); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &mt); ok(hr == S_OK, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index f611a3a7cf0..06e545eedfc 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -1852,12 +1852,16 @@ static HRESULT WINAPI VMR9WindowlessControl_SetVideoClippingWindow(IVMRWindowles
TRACE("(%p/%p)->(%p)\n", iface, This, hwnd);
+ if (!IsWindow(hwnd)) + { + WARN("Invalid window %p, returning E_INVALIDARG.\n", hwnd); + return E_INVALIDARG; + } + EnterCriticalSection(&This->renderer.filter.csFilter); This->hWndClippingWindow = hwnd; if (This->renderer.sink.pin.peer) VMR9_maybe_init(This, FALSE, &This->renderer.sink.pin.mt); - if (!hwnd) - IVMRSurfaceAllocatorEx9_TerminateDevice(This->allocator, This->cookie); LeaveCriticalSection(&This->renderer.filter.csFilter); return S_OK; }