sdp: reject BUNDLE with RTP header extension id collisions

after measurements have shown this is quite rare. Rollout is guarded by
  WebRTC-PreventBundleHeaderExtensionIdCollision
which acts as a killswitch.

BUG=webrtc:14782,chromium:1447758

Change-Id: Ib314c2c8099c05ace761710fdf0e01a77fc89f76
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306223
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40177}
diff --git a/pc/sdp_offer_answer.cc b/pc/sdp_offer_answer.cc
index c87b6ec..cf22cf3 100644
--- a/pc/sdp_offer_answer.cc
+++ b/pc/sdp_offer_answer.cc
@@ -501,7 +501,7 @@
     return RTCError(
         RTCErrorType::INVALID_PARAMETER,
         "A BUNDLE group contains a codec collision for "
-        "header extension id='" +
+        "header extension id=" +
             rtc::ToString(extension.id) +
             ". The id must be the same across all bundled media descriptions");
   }
@@ -3530,9 +3530,13 @@
 
   // Validate that there are no collisions of bundled header extensions ids.
   error = ValidateBundledRtpHeaderExtensions(*sdesc->description());
-  // TODO(bugs.webrtc.org/14782): actually reject.
   RTC_HISTOGRAM_BOOLEAN("WebRTC.PeerConnection.ValidBundledExtensionIds",
                         error.ok());
+  // TODO(bugs.webrtc.org/14782): remove killswitch after rollout.
+  if (!error.ok() && !pc_->trials().IsDisabled(
+                         "WebRTC-PreventBundleHeaderExtensionIdCollision")) {
+    return error;
+  }
 
   if (!pc_->ValidateBundleSettings(sdesc->description(),
                                    bundle_groups_by_mid)) {