qcap: Fixed a use after free in error path (Coverity).
This commit is contained in:
parent
de7635a2f0
commit
524ff6fe27
|
@ -314,6 +314,7 @@ HRESULT qcap_driver_get_format(const Capture *capBox, AM_MEDIA_TYPE ** mT)
|
||||||
if (!vi)
|
if (!vi)
|
||||||
{
|
{
|
||||||
CoTaskMemFree(mT[0]);
|
CoTaskMemFree(mT[0]);
|
||||||
|
mT[0] = NULL;
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
mT[0]->majortype = MEDIATYPE_Video;
|
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;
|
return VFW_S_NO_MORE_ITEMS;
|
||||||
|
|
||||||
hr = qcap_driver_get_format(This->driver_info, &vfw_pmt);
|
hr = qcap_driver_get_format(This->driver_info, &vfw_pmt);
|
||||||
CopyMediaType(pmt, vfw_pmt);
|
if (SUCCEEDED(hr)) {
|
||||||
DeleteMediaType(vfw_pmt);
|
CopyMediaType(pmt, vfw_pmt);
|
||||||
|
DeleteMediaType(vfw_pmt);
|
||||||
|
}
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue