quartz: return the IMemAllocator so the BaseOutputPin can store it and use it, avoiding a NULL pointer crash.

This commit is contained in:
Damjan Jovanovic 2013-01-17 07:40:39 +02:00 committed by Alexandre Julliard
parent 8337959c78
commit 4bb45afc3f

View file

@ -595,7 +595,14 @@ static HRESULT WINAPI Parser_OutputPin_DecideAllocator(BaseOutputPin *iface, IMe
*pAlloc = NULL;
if (This->alloc)
{
hr = IMemInputPin_NotifyAllocator(pPin, This->alloc, This->readonly);
if (SUCCEEDED(hr))
{
*pAlloc = This->alloc;
IMemAllocator_AddRef(*pAlloc);
}
}
else
hr = VFW_E_NO_ALLOCATOR;
@ -661,6 +668,8 @@ static ULONG WINAPI Parser_OutputPin_Release(IPin * iface)
FreeMediaType(This->pmt);
CoTaskMemFree(This->pmt);
FreeMediaType(&This->pin.pin.mtCurrent);
if (This->pin.pAllocator)
IMemAllocator_Release(This->pin.pAllocator);
CoTaskMemFree(This);
return 0;
}