From 4bb45afc3fc8387b9726c6315888a6902fcafa06 Mon Sep 17 00:00:00 2001 From: Damjan Jovanovic Date: Thu, 17 Jan 2013 07:40:39 +0200 Subject: [PATCH] quartz: return the IMemAllocator so the BaseOutputPin can store it and use it, avoiding a NULL pointer crash. --- dlls/quartz/parser.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index da9b4b1c977..f0b1b9357af 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -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; }