Skip to content

Commit

Permalink
Bug 1843113 - Vendor libwebrtc from d20849d071
Browse files Browse the repository at this point in the history
Upstream commit: https://webrtc.googlesource.com/src/+/d20849d0710783142175551d81dfe0dcbffcf2b1
    [M114] sdp: reject duplicate ssrcs in ssrc-groups

    while not really covered by
      https://www.rfc-editor.org/rfc/rfc5576.html#section-4.2
    and using the same SSRC for RTX and primary payload may work
    since payload type demuxing *could* be used is not a good idea.
    This also applies to flexfec's FEC-FR.

    For the nonstandard SIM ssrc-group duplicates make no sense.
    This rejects duplicates for unknown ssrc-groups as well.

    BUG=chromium:1454860

    (cherry picked from commit 6a38a3eb38f732b89ca0d8e36c43a434670c4ef5)

    No-Try: true
    Change-Id: I3e86101dbd5d6c4099f2fdb7b4a52d5cd0809c5f
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308820
    Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
    Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    Commit-Queue: Philipp Hancke <phancke@microsoft.com>
    Cr-Original-Commit-Position: refs/heads/main@{#40292}
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/309601
    Cr-Commit-Position: refs/branch-heads/5735@{#4}
    Cr-Branched-From: df7df199abd619e75b9f1d9a7e12fc3f3f748775-refs/heads/main@{#39949}
  • Loading branch information
mfromanmoz committed Jul 14, 2023
1 parent 1c7ccf5 commit 150ce03
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions third_party/libwebrtc/README.moz-ff-commit
Original file line number Diff line number Diff line change
Expand Up @@ -23499,3 +23499,6 @@ ecab2a49da
# MOZ_LIBWEBRTC_SRC=/home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
e46e37b6f8
# MOZ_LIBWEBRTC_SRC=/home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
d20849d071
2 changes: 2 additions & 0 deletions third_party/libwebrtc/README.mozilla
Original file line number Diff line number Diff line change
Expand Up @@ -15688,3 +15688,5 @@ libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc
libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-07-14T21:00:06.469027.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-07-14T21:01:04.634768.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-07-14T21:02:05.862286.
5 changes: 5 additions & 0 deletions third_party/libwebrtc/pc/webrtc_sdp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3542,6 +3542,11 @@ bool ParseSsrcGroupAttribute(absl::string_view line,
if (!GetValueFromString(line, fields[i], &ssrc, error)) {
return false;
}
// Reject duplicates. While not forbidden by RFC 5576,
// they don't make sense.
if (absl::c_linear_search(ssrcs, ssrc)) {
return ParseFailed(line, "Duplicate SSRC in ssrc-group", error);
}
ssrcs.push_back(ssrc);
}
ssrc_groups->push_back(SsrcGroup(semantics, ssrcs));
Expand Down
26 changes: 26 additions & 0 deletions third_party/libwebrtc/pc/webrtc_sdp_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5056,3 +5056,29 @@ TEST_F(WebRtcSdpTest, RejectSessionLevelMediaLevelExtmapMixedUsage) {
JsepSessionDescription jdesc(kDummyType);
EXPECT_FALSE(SdpDeserialize(sdp, &jdesc));
}

TEST_F(WebRtcSdpTest, RejectDuplicateSsrcInSsrcGroup) {
std::string sdp =
"v=0\r\n"
"o=- 0 3 IN IP4 127.0.0.1\r\n"
"s=-\r\n"
"t=0 0\r\n"
"a=group:BUNDLE 0\r\n"
"a=fingerprint:sha-1 "
"4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB\r\n"
"a=setup:actpass\r\n"
"a=ice-ufrag:ETEn\r\n"
"a=ice-pwd:OtSK0WpNtpUjkY4+86js7Z/l\r\n"
"m=video 9 UDP/TLS/RTP/SAVPF 96 97\r\n"
"c=IN IP4 0.0.0.0\r\n"
"a=rtcp-mux\r\n"
"a=sendonly\r\n"
"a=mid:0\r\n"
"a=rtpmap:96 VP8/90000\r\n"
"a=rtpmap:97 rtx/90000\r\n"
"a=fmtp:97 apt=96\r\n"
"a=ssrc-group:FID 1234 1234\r\n"
"a=ssrc:1234 cname:test\r\n";
JsepSessionDescription jdesc(kDummyType);
EXPECT_FALSE(SdpDeserialize(sdp, &jdesc));
}

0 comments on commit 150ce03

Please sign in to comment.