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:39:17 +02:00 committed by Alexandre Julliard
parent 4bdfa7f864
commit 8337959c78
1 changed files with 9 additions and 0 deletions

View File

@ -1352,6 +1352,8 @@ static ULONG WINAPI QTOutPin_Release(IPin *iface)
{
DeleteMediaType(This->pmt);
FreeMediaType(&This->pin.pin.mtCurrent);
if (This->pin.pAllocator)
IMemAllocator_Release(This->pin.pAllocator);
CoTaskMemFree(This);
return 0;
}
@ -1384,7 +1386,14 @@ static HRESULT WINAPI QTOutPin_DecideAllocator(BaseOutputPin *iface, IMemInputPi
*pAlloc = NULL;
if (QTfilter->pInputPin.pAlloc)
{
hr = IMemInputPin_NotifyAllocator(pPin, QTfilter->pInputPin.pAlloc, FALSE);
if (SUCCEEDED(hr))
{
*pAlloc = QTfilter->pInputPin.pAlloc;
IMemAllocator_AddRef(*pAlloc);
}
}
else
hr = VFW_E_NO_ALLOCATOR;