From 8337959c78c815593904f0ff920354e50be19dc7 Mon Sep 17 00:00:00 2001 From: Damjan Jovanovic Date: Thu, 17 Jan 2013 07:39:17 +0200 Subject: [PATCH] Return the IMemAllocator so the BaseOutputPin can store it and use it, avoiding a NULL pointer crash. --- dlls/wineqtdecoder/qtsplitter.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index a3cd91f8b5b..03cc8a9d1f0 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -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;