[M102-LTS] Disallow invalid arguments in RestoreEncodingLayers.

Changing DCHECK into CHECK for good measure.

(cherry picked from commit 2b1f509f3a05035a17917061a71b16114e8c72dc)

Bug: chromium:1343889
Change-Id: I2cede85dc2d2a4238739f73afe25275047f4aa50
No-Try: True
No-Presubmit: True
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268460
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Original-Commit-Position: refs/heads/main@{#37511}
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271024
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/branch-heads/5005@{#10}
Cr-Branched-From: 8f9b44ba38c134e1c69126196e4d9e566ca5d5e3-refs/heads/main@{#36552}
diff --git a/pc/rtp_sender.cc b/pc/rtp_sender.cc
index 58fef40..3604d19 100644
--- a/pc/rtp_sender.cc
+++ b/pc/rtp_sender.cc
@@ -75,8 +75,8 @@
     const RtpParameters& parameters,
     const std::vector<std::string>& removed_rids,
     const std::vector<RtpEncodingParameters>& all_layers) {
-  RTC_DCHECK_EQ(parameters.encodings.size() + removed_rids.size(),
-                all_layers.size());
+  RTC_CHECK_EQ(parameters.encodings.size() + removed_rids.size(),
+               all_layers.size());
   RtpParameters result(parameters);
   result.encodings.clear();
   size_t index = 0;