Title: [288461] trunk/Source/ThirdParty/libwebrtc
Revision
288461
Author
[email protected]
Date
2022-01-24 12:33:52 -0800 (Mon, 24 Jan 2022)

Log Message

Reject large number of WebRTC audio channels
https://bugs.webkit.org/show_bug.cgi?id=235511

Reviewed by Eric Carlson.

Cherry-picking WebRTC upstream fix for compliance.

* Source/webrtc/pc/webrtc_sdp.cc:
* Source/webrtc/pc/webrtc_sdp_unittest.cc:

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/libwebrtc/ChangeLog (288460 => 288461)


--- trunk/Source/ThirdParty/libwebrtc/ChangeLog	2022-01-24 20:28:22 UTC (rev 288460)
+++ trunk/Source/ThirdParty/libwebrtc/ChangeLog	2022-01-24 20:33:52 UTC (rev 288461)
@@ -1,3 +1,15 @@
+2022-01-24  Youenn Fablet  <[email protected]>
+
+        Reject large number of WebRTC audio channels
+        https://bugs.webkit.org/show_bug.cgi?id=235511
+
+        Reviewed by Eric Carlson.
+
+        Cherry-picking WebRTC upstream fix for compliance.
+
+        * Source/webrtc/pc/webrtc_sdp.cc:
+        * Source/webrtc/pc/webrtc_sdp_unittest.cc:
+
 2022-01-21  Michael Saboff  <[email protected]>
 
         WebKit fails to build - error: 'webrtc/rtc_base/network.h' file not found

Modified: trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/webrtc_sdp.cc (288460 => 288461)


--- trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/webrtc_sdp.cc	2022-01-24 20:28:22 UTC (rev 288460)
+++ trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/webrtc_sdp.cc	2022-01-24 20:33:52 UTC (rev 288461)
@@ -256,6 +256,9 @@
 // types.
 const int kWildcardPayloadType = -1;
 
+// Maximum number of channels allowed.
+static const size_t kMaxNumberOfChannels = 24;
+
 struct SsrcInfo {
   uint32_t ssrc_id;
   std::string cname;
@@ -3627,6 +3630,10 @@
         return false;
       }
     }
+    if (channels > kMaxNumberOfChannels) {
+      return ParseFailed(line, "At most 24 channels are supported.", error);
+    }
+
     AudioContentDescription* audio_desc = media_desc->as_audio();
     UpdateCodec(payload_type, encoding_name, clock_rate, 0, channels,
                 audio_desc);

Modified: trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/webrtc_sdp_unittest.cc (288460 => 288461)


--- trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/webrtc_sdp_unittest.cc	2022-01-24 20:28:22 UTC (rev 288460)
+++ trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/webrtc_sdp_unittest.cc	2022-01-24 20:33:52 UTC (rev 288461)
@@ -4694,3 +4694,15 @@
   Replace("a=mid:", "a=mid:[]", &sdp);
   ExpectParseFailure(std::string(sdp), "a=mid:[]");
 }
+
+TEST_F(WebRtcSdpTest, MaxChannels) {
+  std::string sdp =
+      "v=0\r\n"
+      "o=- 11 22 IN IP4 127.0.0.1\r\n"
+      "s=-\r\n"
+      "t=0 0\r\n"
+      "m=audio 49232 RTP/AVP 108\r\n"
+      "a=rtpmap:108 ISAC/16000/512\r\n";
+
+  ExpectParseFailure(sdp, "a=rtpmap:108 ISAC/16000/512");
+}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to