Commit a273ce07 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

quartz: Don't crash in SetMediaType if the source media type is NULL.

parent 4a9d2d43
......@@ -661,8 +661,13 @@ static HRESULT WINAPI StdMediaSample2_SetMediaType(IMediaSample2 * iface, AM_MED
TRACE("(%p)->(%p)\n", iface, pMediaType);
if (This->props.pMediaType)
{
FreeMediaType(This->props.pMediaType);
else if (!(This->props.pMediaType = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE))))
This->props.pMediaType = NULL;
}
if (!pMediaType)
return S_FALSE;
if (!(This->props.pMediaType = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE))))
return E_OUTOFMEMORY;
return CopyMediaType(This->props.pMediaType, pMediaType);
......
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