webrtc: bail on invalid rtpbin names
authorMatthew Waters <matthew@centricular.com>
Thu, 8 Feb 2018 04:25:22 +0000 (15:25 +1100)
committerMatthew Waters <matthew@centricular.com>
Thu, 8 Feb 2018 04:29:56 +0000 (15:29 +1100)
If we fail parsing rtpbin pad names, someone has screwed up so critical
and return.

CID #1429142

ext/webrtc/gstwebrtcbin.c

index a834a22..453fb26 100644 (file)
@@ -2791,7 +2791,10 @@ on_rtpbin_pad_added (GstElement * rtpbin, GstPad * new_pad,
     TransportStream *stream;
     GstWebRTCBinPad *pad;
 
-    sscanf (new_pad_name, "recv_rtp_src_%u_%u_%u", &session_id, &ssrc, &pt);
+    if (sscanf (new_pad_name, "recv_rtp_src_%u_%u_%u", &session_id, &ssrc, &pt)) {
+      g_critical ("Invalid rtpbin pad name \'%s\'", new_pad_name);
+      return;
+    }
 
     stream = _find_transport_for_session (webrtc, session_id);
     if (!stream)