webrtcbin: Stop transceivers update after first SDP error on data channel

When invalid SDP is supplied, _update_data_channel_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.

This change is similar to the one applied in
064428cb34.
See also #1595

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2356>
This commit is contained in:
Philippe Normand 2021-06-24 12:28:11 +01:00 committed by GStreamer Marge Bot
parent 71052f0321
commit 0f492a39c9

View file

@ -4872,6 +4872,8 @@ _update_transceivers_from_sdp (GstWebRTCBin * webrtc, SDPSource source,
} else if (_message_media_is_datachannel (sdp->sdp, i)) {
_update_data_channel_from_sdp_media (webrtc, sdp->sdp, i, stream,
error);
if (error && *error)
goto done;
} else {
GST_ERROR_OBJECT (webrtc, "Unknown media type in SDP at index %u", i);
}