From 48c8dbd383b42871d11d0a4977c331d550359082 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 9 Aug 2023 15:09:51 -0400 Subject: [PATCH] uridecodebin3: Protect set_uri with the PLAY_ITEMS_LOCK We access fields that are protected by the lock and this was already held in other places where we call the method. I have got cases where we get the following stack/assertion: ``` #0 g_logv (log_domain=0x7fb9d84e6cd5 "GStreamer", log_level=G_LOG_LEVEL_CRITICAL, format=, args=args@entry=0x7fb9d4de54e0) at ../glib/gmessages.c:1433 #1 0x00007fb9d802d0f3 in g_log (log_domain=, log_level=, format=) at ../glib/gmessages.c:1471 #2 0x00007fb9d845bc2c in gst_pad_send_event (pad=0x7fb98c01e050, event=0x7fb9c4105b90) at ../subprojects/gstreamer/gst/gstpad.c:6096 #3 0x00007fb9d6541c35 in gst_uri_decode_bin3_set_uri (dec=0x7fb9bc450960 [GstURIDecodeBin3], uri=0x7fb9c40f5410 "file:///var/home/thiblahute/devel/gstreamer/gstreamer/subprojects/gst-integration-testsuites/medias/defaults/mp4/mp3_h264.0.mp4") at ../subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c:1918 #4 0x00007fb9d6540c40 in gst_uri_decode_bin3_set_property (object=0x7fb9bc450960 [GstURIDecodeBin3], prop_id=1, value=0x7fb9d4de57b0, pspec=0x7fb9bcee5280 [GParamString]) at ../subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c:1569 #5 0x00007fb9d7f8f73d in object_set_property (object=0x7fb9bc450960 [GstURIDecodeBin3], pspec=0x7fb9bcee5280 [GParamString], value=0x7fb9d4de57b0, nqueue=0x7fb9c40d0c40, user_specified=) at ../gobject/gobject.c:1794 ``` Part-of: --- subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c b/subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c index b6c47c52f7..f8522a0513 100644 --- a/subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c +++ b/subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c @@ -1579,7 +1579,9 @@ gst_uri_decode_bin3_set_property (GObject * object, guint prop_id, switch (prop_id) { case PROP_URI: + PLAY_ITEMS_LOCK (dec); gst_uri_decode_bin3_set_uri (dec, g_value_get_string (value)); + PLAY_ITEMS_UNLOCK (dec); break; case PROP_SUBURI: gst_uri_decode_bin3_set_suburi (dec, g_value_get_string (value)); @@ -1911,6 +1913,7 @@ uri_src_ignore_block_probe (GstPad * pad, GstPadProbeInfo * info, return GST_PAD_PROBE_OK; } +/* PLAY_ITEMS_LOCK held */ static void gst_uri_decode_bin3_set_uri (GstURIDecodeBin3 * dec, const gchar * uri) {