uridecodebin3: Protect against NULL uri/suburi

Fixes #1625

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3511>
This commit is contained in:
Edward Hervey 2022-12-02 15:52:56 +01:00 committed by GStreamer Marge Bot
parent 949b12c7f5
commit 36c3bb0d05

View file

@ -1672,6 +1672,9 @@ free_play_item (GstURIDecodeBin3 * dec, GstPlayItem * item)
static void static void
play_item_set_uri (GstPlayItem * item, const gchar * uri) play_item_set_uri (GstPlayItem * item, const gchar * uri)
{ {
if (!uri)
return;
if (!item->main_item) { if (!item->main_item) {
item->main_item = item->main_item =
new_source_item (item->uridecodebin, item, g_strdup (uri)); new_source_item (item->uridecodebin, item, g_strdup (uri));
@ -1683,6 +1686,9 @@ play_item_set_uri (GstPlayItem * item, const gchar * uri)
static void static void
play_item_set_suburi (GstPlayItem * item, const gchar * uri) play_item_set_suburi (GstPlayItem * item, const gchar * uri)
{ {
if (!uri)
return;
if (!item->sub_item) { if (!item->sub_item) {
item->sub_item = new_source_item (item->uridecodebin, item, g_strdup (uri)); item->sub_item = new_source_item (item->uridecodebin, item, g_strdup (uri));
} else { } else {