From 0a128155b385fc02891671a1cea80714ae33dfd2 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Fri, 31 Jan 2020 17:25:08 -0800 Subject: [PATCH] sdpdemux: check if connections are available on media entry before get Otherwise we trigger an assert. --- gst/sdp/gstsdpdemux.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gst/sdp/gstsdpdemux.c b/gst/sdp/gstsdpdemux.c index 4fc316d99a..98aebdf834 100644 --- a/gst/sdp/gstsdpdemux.c +++ b/gst/sdp/gstsdpdemux.c @@ -410,9 +410,16 @@ gst_sdp_demux_create_stream (GstSDPDemux * demux, GstSDPMessage * sdp, gint idx) } } } - if (!(conn = gst_sdp_media_get_connection (media, 0))) { - if (!(conn = gst_sdp_message_get_connection (sdp))) + + if (gst_sdp_media_connections_len (media) > 0) { + if (!(conn = gst_sdp_media_get_connection (media, 0))) { + /* We should not reach this based on the check above */ goto no_connection; + } + } else { + if (!(conn = gst_sdp_message_get_connection (sdp))) { + goto no_connection; + } } if (!conn->address)