mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
streamsynchronizer: avoid crashing when operating on released pad
This commit is contained in:
parent
76cc8b8f2a
commit
af28016d0a
1 changed files with 8 additions and 2 deletions
|
@ -94,11 +94,16 @@ gst_stream_get_other_pad (GstStream * stream, GstPad * pad)
|
||||||
static GstPad *
|
static GstPad *
|
||||||
gst_stream_get_other_pad_from_pad (GstPad * pad)
|
gst_stream_get_other_pad_from_pad (GstPad * pad)
|
||||||
{
|
{
|
||||||
GstStreamSynchronizer *self =
|
GstObject *parent = gst_pad_get_parent (pad);
|
||||||
GST_STREAM_SYNCHRONIZER (gst_pad_get_parent (pad));
|
GstStreamSynchronizer *self;
|
||||||
GstStream *stream;
|
GstStream *stream;
|
||||||
GstPad *opad = NULL;
|
GstPad *opad = NULL;
|
||||||
|
|
||||||
|
/* released pad does not have parent anymore */
|
||||||
|
if (!G_LIKELY (parent))
|
||||||
|
goto exit;
|
||||||
|
|
||||||
|
self = GST_STREAM_SYNCHRONIZER (parent);
|
||||||
GST_STREAM_SYNCHRONIZER_LOCK (self);
|
GST_STREAM_SYNCHRONIZER_LOCK (self);
|
||||||
stream = gst_pad_get_element_private (pad);
|
stream = gst_pad_get_element_private (pad);
|
||||||
if (!stream)
|
if (!stream)
|
||||||
|
@ -110,6 +115,7 @@ out:
|
||||||
GST_STREAM_SYNCHRONIZER_UNLOCK (self);
|
GST_STREAM_SYNCHRONIZER_UNLOCK (self);
|
||||||
gst_object_unref (self);
|
gst_object_unref (self);
|
||||||
|
|
||||||
|
exit:
|
||||||
if (!opad)
|
if (!opad)
|
||||||
GST_WARNING_OBJECT (pad, "Trying to get other pad after releasing");
|
GST_WARNING_OBJECT (pad, "Trying to get other pad after releasing");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue