webrtcbin: Stop transceivers update after first SDP error
authorPhilippe Normand <philn@igalia.com>
Mon, 17 May 2021 09:49:41 +0000 (10:49 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sun, 30 May 2021 00:16:10 +0000 (00:16 +0000)
When invalid SDP is supplied, _update_transceiver_from_sdp_media() sets the
GError, so it is invalid to continue any further SDP processing, we have to exit
early when the first error is raised.

Fixes #1595

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2254>

ext/webrtc/gstwebrtcbin.c

index 07b3734..df5bc8e 100644 (file)
@@ -4865,6 +4865,8 @@ _update_transceivers_from_sdp (GstWebRTCBin * webrtc, SDPSource source,
 
         _update_transceiver_from_sdp_media (webrtc, sdp->sdp, i, stream,
             trans, bundled, bundle_idx, error);
+        if (error && *error)
+          goto done;
       } else if (_message_media_is_datachannel (sdp->sdp, i)) {
         _update_data_channel_from_sdp_media (webrtc, sdp->sdp, i, stream,
             error);