From: Sebastian Dröge Date: Thu, 24 Oct 2019 22:39:05 +0000 (+0300) Subject: tee: Lock mutex before reading the removed flag of the pads X-Git-Tag: 1.16.2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94c765a173e524272ce296871b5382cf4357579c;p=platform%2Fupstream%2Fgstreamer.git tee: Lock mutex before reading the removed flag of the pads Otherwise we're not guaranteed to read the very latest value that another thread might've written in there when the pad was released, and could instead work with an old value. --- diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index f933509..5b33125 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -899,12 +899,14 @@ gst_tee_handle_data (GstTee * tee, gpointer data, gboolean is_list) ret = gst_pad_push (pad, GST_BUFFER_CAST (data)); } + GST_OBJECT_LOCK (tee); if (GST_TEE_PAD_CAST (pad)->removed) ret = GST_FLOW_NOT_LINKED; if (ret == GST_FLOW_NOT_LINKED && tee->allow_not_linked) { ret = GST_FLOW_OK; } + GST_OBJECT_UNLOCK (tee); gst_object_unref (pad);