After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796810 - webrtc SDP RTX processing bug with no ssrc
webrtc SDP RTX processing bug with no ssrc
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-07-14 13:14 UTC by Jan Schmidt
Modified: 2018-11-03 14:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jan Schmidt 2018-07-14 13:14:19 UTC
The unit test for webrtc encounters a case where it uses an uninitialised variable here in sdp_media_from_transceiver(), because the caps it generates for type == GST_WEBRTC_SDP_TYPE_OFFER don't contain an ssrc.

This patch adds a warning when that happens, but I'm not sure why it's happening:

diff --git a/ext/webrtc/gstwebrtcbin.c b/ext/webrtc/gstwebrtcbin.c
index 9baebede3..ffe0bb1c7 100644
--- a/ext/webrtc/gstwebrtcbin.c
+++ b/ext/webrtc/gstwebrtcbin.c
@@ -1701,15 +1701,17 @@ sdp_media_from_transceiver (GstWebRTCBin * webrtc, GstSDPMedia * media,
     gint clockrate = -1;
     gint rtx_target_pt;
     gint original_rtx_target_pt;        /* Workaround chrome bug: https://bugs.chromium.org/p/webrtc/issues/detail?id=6196 */
-    guint rtx_target_ssrc;
+    guint rtx_target_ssrc = -1;
 
     if (gst_structure_get_int (s, "payload", &rtx_target_pt))
       g_array_append_val (reserved_pts, rtx_target_pt);
 
     original_rtx_target_pt = rtx_target_pt;
 
-    gst_structure_get_int (s, "clock-rate", &clockrate);
-    gst_structure_get_uint (s, "ssrc", &rtx_target_ssrc);
+    if (!gst_structure_get_int (s, "clock-rate", &clockrate))
+      GST_WARNING_OBJECT (webrtc, "Caps %" GST_PTR_FORMAT " are missing clock-rate", caps);
+    if (!gst_structure_get_uint (s, "ssrc", &rtx_target_ssrc))
+      GST_WARNING_OBJECT (webrtc, "Caps %" GST_PTR_FORMAT " are missing ssrc", caps);
 
     _pick_fec_payload_types (webrtc, WEBRTC_TRANSCEIVER (trans), reserved_pts,
         clockrate, &rtx_target_pt, media);


Here's the warning:

0:00:00.874198556 16302      0x1976720 WARN               webrtcbin gstwebrtcbin.c:1714:sdp_media_from_transceiver:<webrtcbin0> Caps application/x-rtp, payload=(int)96, encoding-name=(string)OPUS, media=(string)audio, clock-rate=(int)48000, rtcp-fb-nack-pli=(boolean)true are missing ssrc
Comment 1 Jan Schmidt 2018-07-15 13:09:18 UTC
The lack of ssrc in the caps is the unit test's fault. Adding ssrc there makes the warning go away. I'm not sure if webrtcbin should do something more in this case - not try to generate the RTX info perhaps?

Pushed 2 commits to fix the unit test and at least not use uninitialised memory if ssrc isn't available:

commit 0af199e25ec7732c7a8462bae4e62219badb313c (HEAD -> master)
Author: Jan Schmidt <jan@centricular.com>
Date:   Sun Jul 15 23:05:26 2018 +1000

    webrtc: Add some ssrc to caps in the unit test.
    
    The unit test uses incomplete caps to test webrtcbin,
    causing some weirdness generating RTX stream mappings.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=796810

commit e6a564216d9adabf11e99a1cdbe6c20545d1dd57
Author: Jan Schmidt <jan@centricular.com>
Date:   Sat Jul 14 23:15:02 2018 +1000

    webrtc: Add a warning in sdp_media_from_transceiver()
    
    When generating caps with no ssrc, at least throw a
    warning instead of using an uninitialised stack variable
    
    https://bugzilla.gnome.org/show_bug.cgi?id=796810
Comment 2 GStreamer system administrator 2018-11-03 14:27:54 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/751.