Commit 524ff6fe authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

qcap: Fixed a use after free in error path (Coverity).

parent de7635a2
......@@ -314,6 +314,7 @@ HRESULT qcap_driver_get_format(const Capture *capBox, AM_MEDIA_TYPE ** mT)
if (!vi)
{
CoTaskMemFree(mT[0]);
mT[0] = NULL;
return E_OUTOFMEMORY;
}
mT[0]->majortype = MEDIATYPE_Video;
......
......@@ -678,9 +678,10 @@ static HRESULT WINAPI VfwPin_GetMediaType(BasePin *iface, int iPosition, AM_MEDI
return VFW_S_NO_MORE_ITEMS;
hr = qcap_driver_get_format(This->driver_info, &vfw_pmt);
if (SUCCEEDED(hr)) {
CopyMediaType(pmt, vfw_pmt);
DeleteMediaType(vfw_pmt);
}
return 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