From 4bdfa7f864553c478890fd9607c742f20f24034b Mon Sep 17 00:00:00 2001 From: Damjan Jovanovic Date: Thu, 17 Jan 2013 07:38:12 +0200 Subject: [PATCH] winegstreamer: return the IMemAllocator so the BaseOutputPin can store it and use it, avoiding a NULL pointer crash. --- dlls/winegstreamer/gstdemux.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 41158ff7885..52935d07073 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1478,6 +1478,8 @@ static ULONG WINAPI GSTOutPin_Release(IPin *iface) { DeleteMediaType(This->pmt); FreeMediaType(&This->pin.pin.mtCurrent); gst_segment_free(This->segment); + if (This->pin.pAllocator) + IMemAllocator_Release(This->pin.pAllocator); CoTaskMemFree(This); return 0; } @@ -1510,7 +1512,14 @@ static HRESULT WINAPI GSTOutPin_DecideAllocator(BaseOutputPin *iface, IMemInputP *pAlloc = NULL; if (GSTfilter->pInputPin.pAlloc) + { hr = IMemInputPin_NotifyAllocator(pPin, GSTfilter->pInputPin.pAlloc, FALSE); + if (SUCCEEDED(hr)) + { + *pAlloc = GSTfilter->pInputPin.pAlloc; + IMemAllocator_AddRef(*pAlloc); + } + } else hr = VFW_E_NO_ALLOCATOR;