[gst-cvs] gst-plugins-bad: sdpdemux: error out if no streams found in sdp message

Mark Nauwelaerts mnauw at kemper.freedesktop.org
Tue Oct 5 08:21:46 PDT 2010


Module: gst-plugins-bad
Branch: master
Commit: 216887d599f0a5961d59cfc6c7eb12881b3831fd
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=216887d599f0a5961d59cfc6c7eb12881b3831fd

Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date:   Tue Oct  5 16:56:49 2010 +0200

sdpdemux: error out if no streams found in sdp message

---

 gst/sdp/gstsdpdemux.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/gst/sdp/gstsdpdemux.c b/gst/sdp/gstsdpdemux.c
index d47440f..1dc3973 100644
--- a/gst/sdp/gstsdpdemux.c
+++ b/gst/sdp/gstsdpdemux.c
@@ -454,6 +454,9 @@ gst_sdp_demux_create_stream (GstSDPDemux * demux, GstSDPMessage * sdp, gint idx)
       goto no_connection;
   }
 
+  if (!conn->address)
+    goto no_connection;
+
   stream->destination = conn->address;
   stream->ttl = conn->ttl;
   stream->multicast = is_multicast_address (stream->destination);
@@ -1384,6 +1387,9 @@ gst_sdp_demux_start (GstSDPDemux * demux)
     for (i = 0; i < n_streams; i++) {
       stream = gst_sdp_demux_create_stream (demux, &sdp, i);
 
+      if (!stream)
+        continue;
+
       GST_DEBUG_OBJECT (demux, "configuring transport for stream %p", stream);
 
       if (!gst_sdp_demux_stream_configure_udp (demux, stream))
@@ -1391,6 +1397,9 @@ gst_sdp_demux_start (GstSDPDemux * demux)
       if (!gst_sdp_demux_stream_configure_udp_sink (demux, stream))
         goto transport_failed;
     }
+
+    if (!demux->streams)
+      goto no_streams;
   }
 
   /* set target state on session manager */
@@ -1435,6 +1444,14 @@ could_not_parse:
     GST_SDP_STREAM_UNLOCK (demux);
     return FALSE;
   }
+no_streams:
+  {
+    gst_sdp_message_uninit (&sdp);
+    GST_ELEMENT_ERROR (demux, STREAM, TYPE_NOT_FOUND, (NULL),
+        ("No streams in SDP message."));
+    GST_SDP_STREAM_UNLOCK (demux);
+    return FALSE;
+  }
 sent_redirect:
   {
     /* avoid hanging if redirect not handled */





More information about the Gstreamer-commits mailing list