Damjan Jovanovic : Return the IMemAllocator so the BaseOutputPin can store it and use it, avoiding a NULL pointer crash.

Alexandre Julliard julliard at winehq.org
Thu Jan 17 14:48:49 CST 2013


Module: wine
Branch: master
Commit: 8337959c78c815593904f0ff920354e50be19dc7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8337959c78c815593904f0ff920354e50be19dc7

Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date:   Thu Jan 17 07:39:17 2013 +0200

Return the IMemAllocator so the BaseOutputPin can store it and use it, avoiding a NULL pointer crash.

---

 dlls/wineqtdecoder/qtsplitter.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index a3cd91f..03cc8a9 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;
 




More information about the wine-cvs mailing list