Module: wine Branch: master Commit: 4bb45afc3fc8387b9726c6315888a6902fcafa06 URL: http://source.winehq.org/git/wine.git/?a=commit;h=4bb45afc3fc8387b9726c63158...
Author: Damjan Jovanovic damjan.jov@gmail.com Date: Thu Jan 17 07:40:39 2013 +0200
quartz: return the IMemAllocator so the BaseOutputPin can store it and use it, avoiding a NULL pointer crash.
---
dlls/quartz/parser.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index da9b4b1..f0b1b93 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; }