quartz: Don't set the VideoRenderer object on creation failure.

This commit is contained in:
Michael Stefaniuc 2012-07-02 01:05:01 +02:00 committed by Alexandre Julliard
parent d28971a23e
commit eb6388c4a5

View file

@ -668,8 +668,6 @@ HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv)
if (FAILED(hr)) if (FAILED(hr))
goto fail; goto fail;
*ppv = pVideoRenderer;
hr = BaseControlWindow_Init(&pVideoRenderer->baseControlWindow, &IVideoWindow_VTable, &pVideoRenderer->renderer.filter, &pVideoRenderer->renderer.filter.csFilter, &pVideoRenderer->renderer.pInputPin->pin, &renderer_BaseWindowFuncTable); hr = BaseControlWindow_Init(&pVideoRenderer->baseControlWindow, &IVideoWindow_VTable, &pVideoRenderer->renderer.filter, &pVideoRenderer->renderer.filter.csFilter, &pVideoRenderer->renderer.pInputPin->pin, &renderer_BaseWindowFuncTable);
if (FAILED(hr)) if (FAILED(hr))
goto fail; goto fail;
@ -678,10 +676,14 @@ HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv)
if (FAILED(hr)) if (FAILED(hr))
goto fail; goto fail;
if (!CreateRenderingSubsystem(pVideoRenderer)) if (!CreateRenderingSubsystem(pVideoRenderer)) {
return E_FAIL; hr = E_FAIL;
goto fail;
}
*ppv = pVideoRenderer;
return S_OK;
return hr;
fail: fail:
BaseRendererImpl_Release(&pVideoRenderer->renderer.filter.IBaseFilter_iface); BaseRendererImpl_Release(&pVideoRenderer->renderer.filter.IBaseFilter_iface);
CoTaskMemFree(pVideoRenderer); CoTaskMemFree(pVideoRenderer);