Zebediah Figura : winegstreamer: Make sure the pipeline state is NULL before removing output pins.

Alexandre Julliard julliard at winehq.org
Thu Feb 22 15:07:47 CST 2018


Module: wine
Branch: master
Commit: 7bf59055cbb1df356f2ee45f47238e637583c5f5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=7bf59055cbb1df356f2ee45f47238e637583c5f5

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Feb 22 09:06:16 2018 -0600

winegstreamer: Make sure the pipeline state is NULL before removing output pins.

Source pads can be created asynchronously, so they might not be created until
during the call to gst_element_set_state(). Therefore don't copy This->ppPins
into a local variable.

This condition can be triggered by failing to demux a stream.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winegstreamer/gstdemux.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 8ccf0ad..518d995 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -1913,7 +1913,6 @@ static HRESULT GST_RemoveOutputPins(GSTImpl *This)
 {
     HRESULT hr;
     ULONG i;
-    GSTOutPin **ppOldPins = This->ppPins;
 
     TRACE("(%p)\n", This);
     mark_wine_thread();
@@ -1927,17 +1926,17 @@ static HRESULT GST_RemoveOutputPins(GSTImpl *This)
     This->my_src = This->their_sink = NULL;
 
     for (i = 0; i < This->cStreams; i++) {
-        hr = BaseOutputPinImpl_BreakConnect(&ppOldPins[i]->pin);
+        hr = BaseOutputPinImpl_BreakConnect(&This->ppPins[i]->pin);
         TRACE("Disconnect: %08x\n", hr);
-        IPin_Release(&ppOldPins[i]->pin.pin.IPin_iface);
+        IPin_Release(&This->ppPins[i]->pin.pin.IPin_iface);
     }
     This->cStreams = 0;
+    CoTaskMemFree(This->ppPins);
     This->ppPins = NULL;
     gst_element_set_bus(This->container, NULL);
     gst_object_unref(This->container);
     This->container = NULL;
     BaseFilterImpl_IncrementPinVersion(&This->filter);
-    CoTaskMemFree(ppOldPins);
     return S_OK;
 }
 




More information about the wine-cvs mailing list