diff options
author | Jan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com> | 2021-05-06 13:54:46 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2021-05-06 14:59:58 +0300 |
commit | 1dcdde9fdf66780624eb88368996f0f52a7725e1 (patch) | |
tree | 087ec5a7d8ba755d1c4ff1c0cb0c2c22424a1b42 | |
parent | 0d1fad0e92b44fdd95f9cd2f48932c4734d70363 (diff) |
multiqueue: Ensure peer pad exists when iterating internal links
The pads can be NULL when we're racing with pad removal, e.g. when the
pads get removed between `gst_pad_iterate_internal_links` acquiring the
parent element and `gst_multi_queue_iterate_internal_links` locking the
multiqueue.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/811>
-rw-r--r-- | plugins/elements/gstmultiqueue.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 609298a9ae..fbb3c693cb 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -1140,11 +1140,11 @@ gst_multi_queue_iterate_internal_links (GstPad * pad, GstObject * parent) srcpad = g_weak_ref_get (&squeue->srcpad); sinkpad = g_weak_ref_get (&squeue->sinkpad); - if (sinkpad == pad) { + if (sinkpad == pad && srcpad) { opad = srcpad; gst_clear_object (&sinkpad); - } else if (srcpad == pad) { + } else if (srcpad == pad && sinkpad) { opad = sinkpad; gst_clear_object (&srcpad); |