Commit 75fbdc91 authored by Thibault Saunier's avatar Thibault Saunier 🌵 Committed by Tim-Philipp Müller
Browse files

rtpsrc: Fix wrong/NULL URI handling

We can reset the URI to NULL and this fix a deadlock in that case or
when the URI was invalid.

Part-of: <gstreamer/gst-plugins-bad!2512>
parent 49224b9c
......@@ -165,16 +165,29 @@ gst_rtp_src_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_URI:{
GstUri *uri = NULL;
const gchar *str_uri = g_value_get_string (value);
GST_RTP_SRC_LOCK (object);
uri = gst_uri_from_string (g_value_get_string (value));
if (uri == NULL)
uri = gst_uri_from_string (str_uri);
if (uri == NULL) {
if (str_uri) {
GST_RTP_SRC_UNLOCK (object);
GST_ERROR_OBJECT (object, "Invalid uri: %s", str_uri);
break;
}
}
if (self->uri)
gst_uri_unref (self->uri);
self->uri = uri;
if (!uri) {
GST_RTP_SRC_UNLOCK (object);
break;
}
/* Recursive set to self, do not use the same lock in all property
* setters. */
g_object_set (self, "address", gst_uri_get_host (self->uri), NULL);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment