Damjan Jovanovic : winegstreamer: 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: 4bdfa7f864553c478890fd9607c742f20f24034b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4bdfa7f864553c478890fd9607c742f20f24034b

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

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

---

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

diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 41158ff..52935d0 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;
 




More information about the wine-cvs mailing list