Commit b8a7ead3 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

strmbase: Don't forget to add ref pUnk in CopyMediaType when pbFormat is null.

parent 44c6ca99
...@@ -28,15 +28,18 @@ ...@@ -28,15 +28,18 @@
WINE_DEFAULT_DEBUG_CHANNEL(strmbase); WINE_DEFAULT_DEBUG_CHANNEL(strmbase);
HRESULT WINAPI CopyMediaType(AM_MEDIA_TYPE * pDest, const AM_MEDIA_TYPE *pSrc) HRESULT WINAPI CopyMediaType(AM_MEDIA_TYPE *dest, const AM_MEDIA_TYPE *src)
{ {
*pDest = *pSrc; *dest = *src;
if (!pSrc->pbFormat) return S_OK; if (src->pbFormat)
if (!(pDest->pbFormat = CoTaskMemAlloc(pSrc->cbFormat))) {
return E_OUTOFMEMORY; dest->pbFormat = CoTaskMemAlloc(src->cbFormat);
memcpy(pDest->pbFormat, pSrc->pbFormat, pSrc->cbFormat); if (!dest->pbFormat)
if (pDest->pUnk) return E_OUTOFMEMORY;
IUnknown_AddRef(pDest->pUnk); memcpy(dest->pbFormat, src->pbFormat, src->cbFormat);
}
if (dest->pUnk)
IUnknown_AddRef(dest->pUnk);
return S_OK; return S_OK;
} }
......
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