feat(libwebrtc): implement webrtc::rtcp::CommonHeader::Parse #13692
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13692"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by alvaroelpob on 2026-10-31T00:07:32Z.
What
Implements
webrtc::rtcp::CommonHeader::Parse(const uint8_t*, size_t)in libwebrtc, which threw and was declared without parameters.The module's WebRTC revision lies between M127 and M134, as recorded in the debt file by #13687. The parsing logic of
modules/rtp_rtcp/source/rtcp_packet/common_header.ccis the same at M127 branch-heads/6533 and M134 branch-heads/6998, andcommon_header.his identical. The only difference is that M134 drops the out-of-lineconstexprdefinition ofkHeaderSizeBytes.The function is adapted from
common_header.ccand lives insrc/RtcpCommonHeader.cpp, which starts with that file's WebRTC copyright notice and the BSD licence text from WebRTC'sLICENSEat the same revision. The debt entry says it is adapted fromcommon_header.cc.WebRtcRtcpCommonHeaderis the 16-byte layout fromcommon_header.h:packet_type_,count_or_format_andpadding_size_as bytes at 0 to 2,payload_size_asuint32_tat 4, andpayload_at 8.static_asserts check it.Parsetakesthisfirst and keeps upstream's order of checks:Each failure also writes an
RTC_LOG(LS_WARNING)upstream. libwebrtc's logging is not implemented, so that is recorded as debt. Upstream reads a null header, and a null buffer of 4 bytes or more, so both throw. The inventory drops from 409 to 408.Tested
Ubuntu 26.04 (WSL2, kernel 6.18), GCC 15.2.0, Release, full build with
BUILD_TESTING=ON.guest_webrtc_rtcp_common_headertest, starting from headers filled with 0xA5:std::invalid_argument.ctest -j16on head42087bf118: 3032/3032 pass.check_conventions.py --base upstream/mainpasses.pr_overlap.pyreports no overlap with open pull requests.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T00:24:15Z.
Review: APPROVED
Reviewed — looks good
The RTCP header parser and its tests match the pinned WebRTC implementation for valid inputs; I found no blocking issue in this stacked head.
What I ran
Reviewed head
48d996ede902cf289624b5a9e158a8ae15d6ba09against PR basef25279c0ca4cb068370df4baaa46de7b4f4741c7. The stack check previewed it cleanly against currentmain93c71cc1bbe43b5e9e9d33fdded98e77efacbdba; the declared #13687 and #13689 heads are included. Environment: Debian Linux x86-64, Python 3.11.2; no project build or local C++ tests were run.Results
passed_with_warnings; the four changed exports have matching declarations/definitions and no target-specific findings. Remaining alias warnings concern pre-existinglibwebrtcUnknown*exports.guest_webrtc_rtcp_common_headeris registered incore/libs/prx/libwebrtc/CMakeLists.txt. I inspected the assertions for layout, short/invalid headers, payload sizing, padding, and failure-state mutation.Unedited outputs
Findings
Blocking
None found in the reviewed code and evidence.
Non-blocking
The PR description says upstream “throws” for null header/buffer inputs. The pinned upstream implementation does not define an exception for those invalid pointers; a null buffer with a size of at least four is dereferenced. The new
std::invalid_argumentchecks are reasonable defensive behavior, but should be described as this implementation's behavior rather than upstream compatibility.Sources
Not verified
No local build, C++ test execution, Linux hosted build, console test, or title test was performed. The full CTest result is author-reported.