Commit 56659c3a authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

quartz: Don't return a pointer to a stack variable in AMFilterData_ParseFilterData().

parent e11f637c
...@@ -689,8 +689,7 @@ static HRESULT DXDiag_InitDXDiagDirectShowFiltersContainer(IDxDiagContainer* pSu ...@@ -689,8 +689,7 @@ static HRESULT DXDiag_InitDXDiagDirectShowFiltersContainer(IDxDiagContainer* pSu
SUCCEEDED(IFilterMapper2_QueryInterface(pFileMapper, &IID_IAMFilterData, (void **)&pFilterData))) SUCCEEDED(IFilterMapper2_QueryInterface(pFileMapper, &IID_IAMFilterData, (void **)&pFilterData)))
{ {
DWORD array_size; DWORD array_size;
BYTE *tmp; REGFILTER2 *pRF;
REGFILTER2 *pRF = NULL;
if (SUCCEEDED(IPropertyBag_Read(pPropFilterBag, wszFilterDataName, &v, NULL)) && if (SUCCEEDED(IPropertyBag_Read(pPropFilterBag, wszFilterDataName, &v, NULL)) &&
SUCCEEDED(SafeArrayAccessData(V_UNION(&v, parray), (LPVOID*) &pData))) SUCCEEDED(SafeArrayAccessData(V_UNION(&v, parray), (LPVOID*) &pData)))
...@@ -698,10 +697,8 @@ static HRESULT DXDiag_InitDXDiagDirectShowFiltersContainer(IDxDiagContainer* pSu ...@@ -698,10 +697,8 @@ static HRESULT DXDiag_InitDXDiagDirectShowFiltersContainer(IDxDiagContainer* pSu
ULONG j; ULONG j;
array_size = V_UNION(&v, parray)->rgsabound->cElements; array_size = V_UNION(&v, parray)->rgsabound->cElements;
if (SUCCEEDED(IAMFilterData_ParseFilterData(pFilterData, pData, array_size, &tmp))) if (SUCCEEDED(IAMFilterData_ParseFilterData(pFilterData, pData, array_size, (BYTE **)&pRF)))
{ {
pRF = ((REGFILTER2 **)tmp)[0];
snprintfW(bufferW, sizeof(bufferW)/sizeof(bufferW[0]), szVersionFormat, pRF->dwVersion); snprintfW(bufferW, sizeof(bufferW)/sizeof(bufferW[0]), szVersionFormat, pRF->dwVersion);
if (pRF->dwVersion == 1) if (pRF->dwVersion == 1)
{ {
...@@ -721,7 +718,7 @@ static HRESULT DXDiag_InitDXDiagDirectShowFiltersContainer(IDxDiagContainer* pSu ...@@ -721,7 +718,7 @@ static HRESULT DXDiag_InitDXDiagDirectShowFiltersContainer(IDxDiagContainer* pSu
} }
dwMerit = pRF->dwMerit; dwMerit = pRF->dwMerit;
CoTaskMemFree(tmp); CoTaskMemFree(pRF);
} }
SafeArrayUnaccessData(V_UNION(&v, parray)); SafeArrayUnaccessData(V_UNION(&v, parray));
......
...@@ -1778,7 +1778,7 @@ static HRESULT WINAPI AMFilterData_ParseFilterData(IAMFilterData* iface, ...@@ -1778,7 +1778,7 @@ static HRESULT WINAPI AMFilterData_ParseFilterData(IAMFilterData* iface,
prf2 = CoTaskMemAlloc(sizeof(*prf2)); prf2 = CoTaskMemAlloc(sizeof(*prf2));
if (!prf2) if (!prf2)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
*ppRegFilter2 = (BYTE *)&prf2; *ppRegFilter2 = (BYTE *)prf2;
hr = FM2_ReadFilterData(pData, prf2); hr = FM2_ReadFilterData(pData, prf2);
if (FAILED(hr)) if (FAILED(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