feat(libwebrtc): implement RtpPacket::Parse #20036

Merged
Krille2004zzz merged 5 commits from upstream-pr/20036 into main 2026-11-24 18:53:19 +00:00
Krille2004zzz commented 2026-11-14 12:55:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Krille2004zzz on 2026-11-14T12:55:54Z.


What

libwebrtc webrtc::RtpPacket::Parse(const uint8_t*, size_t) (_ZN6webrtc9RtpPacket5ParseEPKhm) threw not implemented. This PR ports it from M134 (8d78f5de) rtp_packet.cc (Parse, ParseBuffer, Clear, FindOrCreateExtensionInfo), with the CopyOnWriteBuffer::SetData/SetSize/MutableData and Buffer::SetData paths from copy_on_write_buffer.h and buffer.h. The new src/RtpPacket.cpp starts with their notices. At M127 (e0b28a6a) the parser is identical.

  • Layout: Clang 19 + libc++ probes of the real M134 headers give a 112-byte, non-polymorphic object: header fields at 0–15, payload_offset_ at 16, payload_size_ at 24, RtpHeaderExtensionMap at 32 (23 bytes), the ExtensionInfo vector at 56, extensions_size_ at 80 and rtc::CopyOnWriteBuffer at 88. M127's map is one byte shorter, which moves nothing. Like #20031, this assumes the module's standard library is libc++.

  • Parse: follows upstream's release behaviour:

    • a failed ParseBuffer clears the packet (fields reset, extension entries emptied with capacity kept, buffer unshared and reset to the 12-byte 0x80 header);
    • success copies the bytes into the packet's buffer, reusing the backing store when unshared (growing it 1.5× when needed), and allocating a new one when shared;
    • one-byte (0xBEDE) and two-byte (0x100x) extensions with padding, duplicate IDs overwritten, reserved ID 15 stopping the scan, and oversized lengths or offsets past 16 bits stopping it; other profiles are skipped;
    • CSRC count, padding and their bounds checks as upstream.

    The extension-entry vector grows like libc++ through guest operator new/delete. Release logs and DCHECKs are omitted. A null packet or a null buffer of 12 or more bytes throws, and so does clearing after a failed parse when the packet has no buffer or one under 12 bytes, where release upstream would write out of bounds.

  • Debt: the stub is removed, the libwebrtc unknown-export count drops from 222 to 221, and a debt entry records the layout and that the console's ABI and behaviour are unverified.

Tested

  • New tests: guest_webrtc_rtp_packet_header, _extensions and _buffer (core/libs/prx/libwebrtc/tests/RtpPacket.cpp) cover:
    • fixed header, CSRCs and padding;
    • every failure path, each leaving the packet cleared;
    • one-byte and two-byte extensions: padding, duplicates, reserved ID, oversize, unsupported profile, an offset past 16 bits;
    • shared and unshared buffers, a non-zero buffer offset, 1.5× growth, a packet without a buffer, and entry-vector growth;
    • null arguments;
    • every guest allocation freed.
  • Differential check: upstream Parse/ParseBuffer/Clear and copy_on_write_buffer.cc, built from the real M134 sources with Clang 19 + libc++, and this implementation gave identical results on the same 200,000 generated packets (60,625 valid, 23,223 with extensions, 12,220 with padding, buffers shared at intervals): every field, every extension entry, and the buffer's size, capacity, reference count and bytes. Reading the real objects through the new structs matched every field.
  • Mutation check: scanning extensions with <= instead of < fails two tests; growing the buffer 2× instead of 1.5× fails the buffer test.
  • Linux x86-64 (Debian trixie, GCC 14.2, Release): ctest -R '[Ww]eb[Rr]tc|[Nn]ack|[Rr]tp|public_headers|export_gap|conventions|progress_report|test_registration|debt': 247/247 passed. Not tested on a console, a title or Windows.
  • python3 tools/check_conventions.py --base origin/main: all checks passed.
  • python3 tools/pr_overlap.py: no open PR implements this export. My #20025 and #20031 share the debt count line; whichever merges second recounts.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5311445899 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036). Originally posted by [Krille2004zzz](https://github.com/Krille2004zzz) on 2026-11-14T12:55:54Z. --- ### What libwebrtc `webrtc::RtpPacket::Parse(const uint8_t*, size_t)` (`_ZN6webrtc9RtpPacket5ParseEPKhm`) threw `not implemented`. This PR ports it from M134 (8d78f5de) [`rtp_packet.cc`](https://webrtc.googlesource.com/src/+/8d78f5de6c27b2c793039989ea381f1428fb0100/modules/rtp_rtcp/source/rtp_packet.cc) (`Parse`, `ParseBuffer`, `Clear`, `FindOrCreateExtensionInfo`), with the `CopyOnWriteBuffer::SetData`/`SetSize`/`MutableData` and `Buffer::SetData` paths from [`copy_on_write_buffer.h`](https://webrtc.googlesource.com/src/+/8d78f5de6c27b2c793039989ea381f1428fb0100/rtc_base/copy_on_write_buffer.h) and [`buffer.h`](https://webrtc.googlesource.com/src/+/8d78f5de6c27b2c793039989ea381f1428fb0100/rtc_base/buffer.h). The new `src/RtpPacket.cpp` starts with their notices. At M127 (e0b28a6a) the parser is identical. - **Layout:** Clang 19 + libc++ probes of the real M134 headers give a 112-byte, non-polymorphic object: header fields at 0–15, `payload_offset_` at 16, `payload_size_` at 24, `RtpHeaderExtensionMap` at 32 (23 bytes), the `ExtensionInfo` vector at 56, `extensions_size_` at 80 and `rtc::CopyOnWriteBuffer` at 88. M127's map is one byte shorter, which moves nothing. Like #20031, this assumes the module's standard library is libc++. - **Parse:** follows upstream's release behaviour: - a failed `ParseBuffer` clears the packet (fields reset, extension entries emptied with capacity kept, buffer unshared and reset to the 12-byte `0x80` header); - success copies the bytes into the packet's buffer, reusing the backing store when unshared (growing it 1.5× when needed), and allocating a new one when shared; - one-byte (`0xBEDE`) and two-byte (`0x100x`) extensions with padding, duplicate IDs overwritten, reserved ID 15 stopping the scan, and oversized lengths or offsets past 16 bits stopping it; other profiles are skipped; - CSRC count, padding and their bounds checks as upstream. The extension-entry vector grows like libc++ through guest `operator new`/`delete`. Release logs and DCHECKs are omitted. A null packet or a null buffer of 12 or more bytes throws, and so does clearing after a failed parse when the packet has no buffer or one under 12 bytes, where release upstream would write out of bounds. - **Debt:** the stub is removed, the libwebrtc unknown-export count drops from 222 to 221, and a debt entry records the layout and that the console's ABI and behaviour are unverified. ### Tested - **New tests:** `guest_webrtc_rtp_packet_header`, `_extensions` and `_buffer` (`core/libs/prx/libwebrtc/tests/RtpPacket.cpp`) cover: - fixed header, CSRCs and padding; - every failure path, each leaving the packet cleared; - one-byte and two-byte extensions: padding, duplicates, reserved ID, oversize, unsupported profile, an offset past 16 bits; - shared and unshared buffers, a non-zero buffer offset, 1.5× growth, a packet without a buffer, and entry-vector growth; - null arguments; - every guest allocation freed. - **Differential check:** upstream `Parse`/`ParseBuffer`/`Clear` and `copy_on_write_buffer.cc`, built from the real M134 sources with Clang 19 + libc++, and this implementation gave identical results on the same 200,000 generated packets (60,625 valid, 23,223 with extensions, 12,220 with padding, buffers shared at intervals): every field, every extension entry, and the buffer's size, capacity, reference count and bytes. Reading the real objects through the new structs matched every field. - **Mutation check:** scanning extensions with `<=` instead of `<` fails two tests; growing the buffer 2× instead of 1.5× fails the buffer test. - **Linux x86-64** (Debian trixie, GCC 14.2, Release): `ctest -R '[Ww]eb[Rr]tc|[Nn]ack|[Rr]tp|public_headers|export_gap|conventions|progress_report|test_registration|debt'`: 247/247 passed. Not tested on a console, a title or Windows. - `python3 tools/check_conventions.py --base origin/main`: all checks passed. - **`python3 tools/pr_overlap.py`:** no open PR implements this export. My #20025 and #20031 share the debt count line; whichever merges second recounts. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
PrivacyOnion commented 2026-11-14 13:06:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T13:06:48Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 68f75050d4:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_webrtc_rtp_packet_tests built cleanly.
  • CTest (guest_webrtc_rtp_packet_header, guest_webrtc_rtp_packet_extensions, guest_webrtc_rtp_packet_buffer):
    1/3 Test #5151: guest_webrtc_rtp_packet_header .......   Passed    0.01 sec
    2/3 Test #5152: guest_webrtc_rtp_packet_extensions ...   Passed    0.01 sec
    3/3 Test #5153: guest_webrtc_rtp_packet_buffer .......   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 3
    
  • Negative control: with core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified struct layouts, alignments, member offsets, and size assertions in core/libs/prx/libwebrtc/include/RtpPacket.hpp (WebRtcRtpPacket at 112 bytes, WebRtcRtpExtensionInfo at 4 bytes, WebRtcRtpExtensionInfoVector at 24 bytes, WebRtcRtpHeaderExtensionMap at 23 bytes).
    • Verified null pointer validation and error throwing in _ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix in core/libs/prx/libwebrtc/src/RtpPacket.cpp for null packet objects and null buffers when size >= FixedHeaderSize.
    • Verified CopyOnWriteBuffer handling in SetData, ReplaceBuffer, and SetBackingData in core/libs/prx/libwebrtc/src/RtpPacket.cpp for 1.5x backing store growth and COW unsharing.
    • Verified big-endian integer reading in ReadBigEndian in core/libs/prx/libwebrtc/src/RtpPacket.cpp across 2-byte and 4-byte fields.
    • Verified packet reset semantics in Clear in core/libs/prx/libwebrtc/src/RtpPacket.cpp regarding fixed header zeroing, version initialization to 0x80, and extension entry vector reset.
    • Verified test suite coverage and guest allocation tracking in core/libs/prx/libwebrtc/tests/RtpPacket.cpp.
  • Concerns:
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp:209-214: In ParseExtensions, FindOrCreateExtensionInfo is called at line 209 before checking whether offset exceeds std::numeric_limitsstd::uint16_t::max() at line 211. When an extension's offset exceeds 16 bits (> 65535), FindOrCreateExtensionInfo has already appended an entry ({id, length: 0, offset: 0}) to packet->extensionEntries. The loop then breaks without removing or rolling back this entry, leaving a corrupted, zero-offset entry in the packet's extension table. In upstream WebRTC (modules/rtp_rtcp/source/rtp_packet.cc), the offset check precedes FindOrCreateExtensionInfo, discarding oversized extensions without polluting extension_entries_. The test at core/libs/prx/libwebrtc/tests/RtpPacket.cpp:187-188 explicitly asserts this buggy behavior (Require(EntryCount(packet) == 2) and Require(Entry(packet, 1, 2, 0, 0))).
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp:247-251: In ParseBuffer, line 247 checks if (hasPadding && packet->payloadOffset < size). When an incoming packet has the padding flag set (hasPadding == true) but size == packet->payloadOffset (e.g. Header(0xa0) where size is 12 and payloadOffset is 12), the check evaluates to false and enters the else branch, setting packet->paddingSize = 0 and returning true. Under RFC 3550 Section 5.1 and upstream WebRTC (rtp_packet.cc), setting the padding bit mandates that at least one padding octet exists at the end of the packet specifying the padding count; upstream unconditionally reads buffer[size - 1] when hasPadding is true, requires padding_size > 0, and rejects the packet if payload_offset + padding_size > size. Krille's implementation incorrectly accepts malformed zero-padding packets, and core/libs/prx/libwebrtc/tests/RtpPacket.cpp:128-129 codifies this invalid behavior.
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp:192: In ParseExtensions, line 192 uses while (extensionsSize + headerLength < extensionsCapacity) for both one-byte and two-byte extensions. Under RFC 8285 Section 4.3 and upstream WebRTC (rtp_packet.cc), two-byte extensions permit length = 0, meaning an extension header with no data occupies exactly headerLength = 2 bytes. When a two-byte extension of length 0 is positioned at the end of the extension block such that extensionsSize + 2 == extensionsCapacity, the strict less-than check evaluates to false, prematurely terminating the scan and skipping the valid extension. Upstream WebRTC uses <= for two-byte extensions (while (extensions_size_ + kTwoByteExtensionHeaderLength <= extensions_capacity)).
  • Note: the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5904456770 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036#pullrequestreview-5904456770). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-14T13:06:48Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `68f75050d4`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_webrtc_rtp_packet_tests` built cleanly. - **CTest** (`guest_webrtc_rtp_packet_header`, `guest_webrtc_rtp_packet_extensions`, `guest_webrtc_rtp_packet_buffer`): ``` 1/3 Test #5151: guest_webrtc_rtp_packet_header ....... Passed 0.01 sec 2/3 Test #5152: guest_webrtc_rtp_packet_extensions ... Passed 0.01 sec 3/3 Test #5153: guest_webrtc_rtp_packet_buffer ....... Passed 0.01 sec 100% tests passed, 0 tests failed out of 3 ``` - **Negative control**: with `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified struct layouts, alignments, member offsets, and size assertions in core/libs/prx/libwebrtc/include/RtpPacket.hpp (WebRtcRtpPacket at 112 bytes, WebRtcRtpExtensionInfo at 4 bytes, WebRtcRtpExtensionInfoVector at 24 bytes, WebRtcRtpHeaderExtensionMap at 23 bytes). - Verified null pointer validation and error throwing in _ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix in core/libs/prx/libwebrtc/src/RtpPacket.cpp for null packet objects and null buffers when size >= FixedHeaderSize. - Verified CopyOnWriteBuffer handling in SetData, ReplaceBuffer, and SetBackingData in core/libs/prx/libwebrtc/src/RtpPacket.cpp for 1.5x backing store growth and COW unsharing. - Verified big-endian integer reading in ReadBigEndian in core/libs/prx/libwebrtc/src/RtpPacket.cpp across 2-byte and 4-byte fields. - Verified packet reset semantics in Clear in core/libs/prx/libwebrtc/src/RtpPacket.cpp regarding fixed header zeroing, version initialization to 0x80, and extension entry vector reset. - Verified test suite coverage and guest allocation tracking in core/libs/prx/libwebrtc/tests/RtpPacket.cpp. - **Concerns**: - core/libs/prx/libwebrtc/src/RtpPacket.cpp:209-214: In ParseExtensions, FindOrCreateExtensionInfo is called at line 209 before checking whether offset exceeds std::numeric_limits<std::uint16_t>::max() at line 211. When an extension's offset exceeds 16 bits (> 65535), FindOrCreateExtensionInfo has already appended an entry ({id, length: 0, offset: 0}) to packet->extensionEntries. The loop then breaks without removing or rolling back this entry, leaving a corrupted, zero-offset entry in the packet's extension table. In upstream WebRTC (modules/rtp_rtcp/source/rtp_packet.cc), the offset check precedes FindOrCreateExtensionInfo, discarding oversized extensions without polluting extension_entries_. The test at core/libs/prx/libwebrtc/tests/RtpPacket.cpp:187-188 explicitly asserts this buggy behavior (Require(EntryCount(packet) == 2) and Require(Entry(packet, 1, 2, 0, 0))). - core/libs/prx/libwebrtc/src/RtpPacket.cpp:247-251: In ParseBuffer, line 247 checks if (hasPadding && packet->payloadOffset < size). When an incoming packet has the padding flag set (hasPadding == true) but size == packet->payloadOffset (e.g. Header(0xa0) where size is 12 and payloadOffset is 12), the check evaluates to false and enters the else branch, setting packet->paddingSize = 0 and returning true. Under RFC 3550 Section 5.1 and upstream WebRTC (rtp_packet.cc), setting the padding bit mandates that at least one padding octet exists at the end of the packet specifying the padding count; upstream unconditionally reads buffer[size - 1] when hasPadding is true, requires padding_size > 0, and rejects the packet if payload_offset + padding_size > size. Krille's implementation incorrectly accepts malformed zero-padding packets, and core/libs/prx/libwebrtc/tests/RtpPacket.cpp:128-129 codifies this invalid behavior. - core/libs/prx/libwebrtc/src/RtpPacket.cpp:192: In ParseExtensions, line 192 uses while (extensionsSize + headerLength < extensionsCapacity) for both one-byte and two-byte extensions. Under RFC 8285 Section 4.3 and upstream WebRTC (rtp_packet.cc), two-byte extensions permit length = 0, meaning an extension header with no data occupies exactly headerLength = 2 bytes. When a two-byte extension of length 0 is positioned at the end of the extension block such that extensionsSize + 2 == extensionsCapacity, the strict less-than check evaluates to false, prematurely terminating the scan and skipping the valid extension. Upstream WebRTC uses <= for two-byte extensions (while (extensions_size_ + kTwoByteExtensionHeaderLength <= extensions_capacity)). - Note: the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-14 13:27:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T13:27:43Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 102074f150:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_webrtc_rtp_packet_tests built cleanly.
  • CTest (guest_webrtc_rtp_packet_header, guest_webrtc_rtp_packet_extensions, guest_webrtc_rtp_packet_buffer):
    1/3 Test #5153: guest_webrtc_rtp_packet_buffer .......   Passed    0.00 sec
    2/3 Test #5152: guest_webrtc_rtp_packet_extensions ...   Passed    0.01 sec
    3/3 Test #5151: guest_webrtc_rtp_packet_header .......   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 3
    
  • Negative control: with core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified core/libs/prx/libwebrtc/include/RtpPacket.hpp struct alignments and sizes: WebRtcRtpExtensionInfo (4 bytes), WebRtcRtpHeaderExtensionMap (23 bytes), WebRtcRtpExtensionInfoVector (24 bytes), and WebRtcRtpPacket (112 bytes) matching 64-bit libc++ layout.
    • Verified bounds checking in core/libs/prx/libwebrtc/src/RtpPacket.cpp:ParseBuffer for fixed header size (12 bytes) and CSRC array sizing (numberOfCsrcs * 4).
    • Verified null pointer validation in core/libs/prx/libwebrtc/src/RtpPacket.cpp:_ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix throwing std::invalid_argument for null packet or null buffer when size >= 12.
    • Verified dynamic extension vector reallocation logic in core/libs/prx/libwebrtc/src/RtpPacket.cpp:FindOrCreateExtensionInfo using _Znwm_nid_postfix and _ZdlPv_nid_postfix.
    • Verified padding validation logic in core/libs/prx/libwebrtc/src/RtpPacket.cpp:ParseBuffer against RFC 3550 Section 5.1 and upstream WebRTC M134 rtp_packet.cc.
    • Verified header extension loop bounds in core/libs/prx/libwebrtc/src/RtpPacket.cpp:ParseExtensions against RFC 8285 and upstream WebRTC M134 rtp_packet.cc.
  • Concerns:
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp:250: In ParseBuffer, the check if (hasPadding && packet->payloadOffset < size) incorrectly falls into the else branch (packet->paddingSize = 0) when packet->payloadOffset == size and hasPadding is true. For a 12-byte packet with buffer[0] == 0xa0 (version 2, padding bit set, 0 CSRCs), packet->payloadOffset is 12 and size is 12; because 12 < 12 is false, paddingSize is set to 0 and the function returns true. Under RFC 3550 Section 5.1 and upstream WebRTC M134 (rtp_packet.cc), an RTP packet with the padding bit set must contain at least one padding octet at the end specifying the padding count (size > payload_offset_), and any packet with size <= payload_offset_ must be rejected as malformed. This bug is also codified in the test suite at core/libs/prx/libwebrtc/tests/RtpPacket.cpp:128 (Require(Parse(packet, Header(0xa0)))).
  • Note: the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5904524532 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036#pullrequestreview-5904524532). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-14T13:27:43Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `102074f150`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_webrtc_rtp_packet_tests` built cleanly. - **CTest** (`guest_webrtc_rtp_packet_header`, `guest_webrtc_rtp_packet_extensions`, `guest_webrtc_rtp_packet_buffer`): ``` 1/3 Test #5153: guest_webrtc_rtp_packet_buffer ....... Passed 0.00 sec 2/3 Test #5152: guest_webrtc_rtp_packet_extensions ... Passed 0.01 sec 3/3 Test #5151: guest_webrtc_rtp_packet_header ....... Passed 0.01 sec 100% tests passed, 0 tests failed out of 3 ``` - **Negative control**: with `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified core/libs/prx/libwebrtc/include/RtpPacket.hpp struct alignments and sizes: WebRtcRtpExtensionInfo (4 bytes), WebRtcRtpHeaderExtensionMap (23 bytes), WebRtcRtpExtensionInfoVector (24 bytes), and WebRtcRtpPacket (112 bytes) matching 64-bit libc++ layout. - Verified bounds checking in core/libs/prx/libwebrtc/src/RtpPacket.cpp:ParseBuffer for fixed header size (12 bytes) and CSRC array sizing (numberOfCsrcs * 4). - Verified null pointer validation in core/libs/prx/libwebrtc/src/RtpPacket.cpp:_ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix throwing std::invalid_argument for null packet or null buffer when size >= 12. - Verified dynamic extension vector reallocation logic in core/libs/prx/libwebrtc/src/RtpPacket.cpp:FindOrCreateExtensionInfo using _Znwm_nid_postfix and _ZdlPv_nid_postfix. - Verified padding validation logic in core/libs/prx/libwebrtc/src/RtpPacket.cpp:ParseBuffer against RFC 3550 Section 5.1 and upstream WebRTC M134 rtp_packet.cc. - Verified header extension loop bounds in core/libs/prx/libwebrtc/src/RtpPacket.cpp:ParseExtensions against RFC 8285 and upstream WebRTC M134 rtp_packet.cc. - **Concerns**: - core/libs/prx/libwebrtc/src/RtpPacket.cpp:250: In ParseBuffer, the check `if (hasPadding && packet->payloadOffset < size)` incorrectly falls into the `else` branch (`packet->paddingSize = 0`) when `packet->payloadOffset == size` and `hasPadding` is true. For a 12-byte packet with `buffer[0] == 0xa0` (version 2, padding bit set, 0 CSRCs), `packet->payloadOffset` is 12 and `size` is 12; because `12 < 12` is false, `paddingSize` is set to 0 and the function returns `true`. Under RFC 3550 Section 5.1 and upstream WebRTC M134 (rtp_packet.cc), an RTP packet with the padding bit set must contain at least one padding octet at the end specifying the padding count (`size > payload_offset_`), and any packet with `size <= payload_offset_` must be rejected as malformed. This bug is also codified in the test suite at core/libs/prx/libwebrtc/tests/RtpPacket.cpp:128 (`Require(Parse(packet, Header(0xa0)))`). - Note: the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-14 15:36:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T15:36:30Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 3613eeabe3:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_webrtc_rtp_packet_tests built cleanly.
  • CTest (guest_webrtc_rtp_packet_header, guest_webrtc_rtp_packet_extensions, guest_webrtc_rtp_packet_buffer):
    1/3 Test #5159: guest_webrtc_rtp_packet_header .......   Passed    0.02 sec
    2/3 Test #5160: guest_webrtc_rtp_packet_extensions ...   Passed    0.03 sec
    3/3 Test #5161: guest_webrtc_rtp_packet_buffer .......   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 3
    
  • Negative control: with core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified _ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix null-pointer validation throwing std::invalid_argument for null packet and null buffer when size >= FixedHeaderSize, and verified safe failure return for buffer == nullptr with size < FixedHeaderSize.
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified ParseBuffer and ParseExtensions bounds validation for fixed header size (12 bytes), CSRC count (FixedHeaderSize + numberOfCsrcs * 4), one-byte (0xBEDE) and two-byte (0x1000) extension profiles, padding byte handling, and 16-bit offset overflow protection (std::numeric_limitsstd::uint16_t::max()).
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified memory safety and reallocation logic in SetData, ReplaceBuffer, and SetBackingData, ensuring CopyOnWriteBuffer unsharing with atomic acquire refcounting, 1.5x capacity growth via guest _Znam_nid_postfix / _ZdaPv_nid_postfix, and std::memmove handling potential in-buffer pointer overlap.
    • core/libs/prx/libwebrtc/include/RtpPacket.hpp: verified struct layout and offset static assertions for WebRtcRtpExtensionInfo (4 bytes), WebRtcRtpExtensionInfoVector (24 bytes), WebRtcRtpHeaderExtensionMap (23 bytes), and WebRtcRtpPacket (112 bytes) ensuring portability across LP64 and LLP64 platforms.
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp and docs/dev/debt/libwebrtc.md: verified AGENTS.md compliance with zero code comments outside license notices, exact unknown-export count decrement (221 to 220), and comprehensive unit tests in core/libs/prx/libwebrtc/tests/RtpPacket.cpp asserting zero leaked guest allocations.
  • Note: the AI-assisted checkbox can stay.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5905457086 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036#pullrequestreview-5905457086). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-14T15:36:30Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `3613eeabe3`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_webrtc_rtp_packet_tests` built cleanly. - **CTest** (`guest_webrtc_rtp_packet_header`, `guest_webrtc_rtp_packet_extensions`, `guest_webrtc_rtp_packet_buffer`): ``` 1/3 Test #5159: guest_webrtc_rtp_packet_header ....... Passed 0.02 sec 2/3 Test #5160: guest_webrtc_rtp_packet_extensions ... Passed 0.03 sec 3/3 Test #5161: guest_webrtc_rtp_packet_buffer ....... Passed 0.01 sec 100% tests passed, 0 tests failed out of 3 ``` - **Negative control**: with `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified _ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix null-pointer validation throwing std::invalid_argument for null packet and null buffer when size >= FixedHeaderSize, and verified safe failure return for buffer == nullptr with size < FixedHeaderSize. - core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified ParseBuffer and ParseExtensions bounds validation for fixed header size (12 bytes), CSRC count (FixedHeaderSize + numberOfCsrcs * 4), one-byte (0xBEDE) and two-byte (0x1000) extension profiles, padding byte handling, and 16-bit offset overflow protection (std::numeric_limits<std::uint16_t>::max()). - core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified memory safety and reallocation logic in SetData, ReplaceBuffer, and SetBackingData, ensuring CopyOnWriteBuffer unsharing with atomic acquire refcounting, 1.5x capacity growth via guest _Znam_nid_postfix / _ZdaPv_nid_postfix, and std::memmove handling potential in-buffer pointer overlap. - core/libs/prx/libwebrtc/include/RtpPacket.hpp: verified struct layout and offset static assertions for WebRtcRtpExtensionInfo (4 bytes), WebRtcRtpExtensionInfoVector (24 bytes), WebRtcRtpHeaderExtensionMap (23 bytes), and WebRtcRtpPacket (112 bytes) ensuring portability across LP64 and LLP64 platforms. - core/libs/prx/libwebrtc/src/RtpPacket.cpp and docs/dev/debt/libwebrtc.md: verified AGENTS.md compliance with zero code comments outside license notices, exact unknown-export count decrement (221 to 220), and comprehensive unit tests in core/libs/prx/libwebrtc/tests/RtpPacket.cpp asserting zero leaked guest allocations. - Note: the AI-assisted checkbox can stay. Looks Good To Me
PrivacyOnion commented 2026-11-14 17:23:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T17:23:59Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against ae5d496c94:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_webrtc_rtp_packet_tests built cleanly.
  • CTest (guest_webrtc_rtp_packet_header, guest_webrtc_rtp_packet_extensions, guest_webrtc_rtp_packet_buffer):
    1/3 Test #5172: guest_webrtc_rtp_packet_extensions ...   Passed    0.01 sec
    2/3 Test #5171: guest_webrtc_rtp_packet_header .......   Passed    0.01 sec
    3/3 Test #5173: guest_webrtc_rtp_packet_buffer .......   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 3
    
  • Negative control: with core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: Verified input validation and bounds safety in _ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix and ParseBuffer, ensuring null packet objects throw std::invalid_argument, size < FixedHeaderSize (12) safely fails without out-of-bounds reads, and CSRC count bounds checks prevent overflow.
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: Verified extension header parsing in ParseExtensions for both one-byte (0xBEDE) and two-byte (0x1000) profiles, confirming strict bounds enforcement (extensionsSize + headerLength + length <= extensionsCapacity), duplicate ID overwrites, and padding byte handling match upstream WebRTC M134 specifications.
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: Audited memory allocation and buffer management across FindOrCreateExtensionInfo, SetBackingData, and ReplaceBuffer, validating correct pairings of guest operators new/delete (_Znwm/_ZdlPv, _Znam/_ZdaPv, CopyOnWriteBufferD1Ev) and leak-free geometric capacity growth.
    • core/libs/prx/libwebrtc/include/RtpPacket.hpp: Checked struct layouts, field offsets, and static_asserts (sizeof(WebRtcRtpPacket) == 112, buffer at offset 88, extensionEntries at offset 56) against Clang libc++ ABI for cross-platform LP64 and LLP64 portability.
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: Verified strict AGENTS.md compliance, confirming zero forbidden comments in implementation code, clean namespace endings, and accurate update of unknown export debt in docs/dev/debt/libwebrtc.md.
    • core/libs/prx/libwebrtc/tests/RtpPacket.cpp: Inspected test suite coverage across fixed header variations, padding edge cases, one-byte/two-byte extensions, shared/unshared CopyOnWriteBuffer states, failure cleanup via Clear, and memory leak verification with ApplicationHeapRegister_nid_no_patch.
  • Note: the AI-assisted checkbox can stay.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5906069763 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036#pullrequestreview-5906069763). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-14T17:23:59Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `ae5d496c94`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_webrtc_rtp_packet_tests` built cleanly. - **CTest** (`guest_webrtc_rtp_packet_header`, `guest_webrtc_rtp_packet_extensions`, `guest_webrtc_rtp_packet_buffer`): ``` 1/3 Test #5172: guest_webrtc_rtp_packet_extensions ... Passed 0.01 sec 2/3 Test #5171: guest_webrtc_rtp_packet_header ....... Passed 0.01 sec 3/3 Test #5173: guest_webrtc_rtp_packet_buffer ....... Passed 0.01 sec 100% tests passed, 0 tests failed out of 3 ``` - **Negative control**: with `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - core/libs/prx/libwebrtc/src/RtpPacket.cpp: Verified input validation and bounds safety in _ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix and ParseBuffer, ensuring null packet objects throw std::invalid_argument, size < FixedHeaderSize (12) safely fails without out-of-bounds reads, and CSRC count bounds checks prevent overflow. - core/libs/prx/libwebrtc/src/RtpPacket.cpp: Verified extension header parsing in ParseExtensions for both one-byte (0xBEDE) and two-byte (0x1000) profiles, confirming strict bounds enforcement (extensionsSize + headerLength + length <= extensionsCapacity), duplicate ID overwrites, and padding byte handling match upstream WebRTC M134 specifications. - core/libs/prx/libwebrtc/src/RtpPacket.cpp: Audited memory allocation and buffer management across FindOrCreateExtensionInfo, SetBackingData, and ReplaceBuffer, validating correct pairings of guest operators new/delete (_Znwm/_ZdlPv, _Znam/_ZdaPv, CopyOnWriteBufferD1Ev) and leak-free geometric capacity growth. - core/libs/prx/libwebrtc/include/RtpPacket.hpp: Checked struct layouts, field offsets, and static_asserts (sizeof(WebRtcRtpPacket) == 112, buffer at offset 88, extensionEntries at offset 56) against Clang libc++ ABI for cross-platform LP64 and LLP64 portability. - core/libs/prx/libwebrtc/src/RtpPacket.cpp: Verified strict AGENTS.md compliance, confirming zero forbidden comments in implementation code, clean namespace endings, and accurate update of unknown export debt in docs/dev/debt/libwebrtc.md. - core/libs/prx/libwebrtc/tests/RtpPacket.cpp: Inspected test suite coverage across fixed header variations, padding edge cases, one-byte/two-byte extensions, shared/unshared CopyOnWriteBuffer states, failure cleanup via Clear, and memory leak verification with ApplicationHeapRegister_nid_no_patch. - Note: the AI-assisted checkbox can stay. Looks Good To Me
PrivacyOnion commented 2026-11-14 20:30:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T20:30:28Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 3bf719a462:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_webrtc_rtp_packet_tests built cleanly.
  • CTest (guest_webrtc_rtp_packet_header, guest_webrtc_rtp_packet_extensions, guest_webrtc_rtp_packet_buffer):
    1/3 Test #5196: guest_webrtc_rtp_packet_extensions ...   Passed    0.03 sec
    2/3 Test #5195: guest_webrtc_rtp_packet_header .......   Passed    0.03 sec
    3/3 Test #5197: guest_webrtc_rtp_packet_buffer .......   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 3
    
  • Negative control: with core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified null validation in _ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix, ensuring std::invalid_argument is thrown for null packet and buffer pointers (when size >= 12), while size < 12 safely fails and clears without null dereference
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified packet boundary checks in ParseBuffer and ParseExtensions, including 12-byte fixed header, CSRC count (numberOfCsrcs * 4), one-byte and two-byte extension capacity/offsets, and trailing padding bounds against payload offset
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified memory management in FindOrCreateExtensionInfo and SetBackingData, confirming proper allocation and deallocation via guest allocators (_Znwm_nid_postfix/_ZdlPv_nid_postfix and _Znam_nid_postfix/_ZdaPv_nid_postfix) with zero leaks
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified Clear and ReplaceBuffer state handling, ensuring copy-on-write buffer unsharing via _ZN3rtc17CopyOnWriteBuffer24UnshareAndEnsureCapacityEm_nid_postfix and correct reset to the 12-byte 0x80 fixed header
    • core/libs/prx/libwebrtc/include/RtpPacket.hpp: verified struct field offsets and size static asserts (sizeof(WebRtcRtpPacket) == 112, sizeof(WebRtcRtpExtensionInfo) == 4, sizeof(WebRtcRtpExtensionInfoVector) == 24), maintaining identical ABI layouts across LP64 (Linux) and LLP64 (Windows)
    • AGENTS.md & docs/dev/debt/libwebrtc.md: verified repository rule compliance, including zero forbidden code comments in newly added source/header/test files, exact decrement of unknown export count (200 -> 199), and proper recording of the implementation in libwebrtc technical debt
  • Note: the AI-assisted checkbox can stay.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5906954223 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036#pullrequestreview-5906954223). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-14T20:30:28Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `3bf719a462`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_webrtc_rtp_packet_tests` built cleanly. - **CTest** (`guest_webrtc_rtp_packet_header`, `guest_webrtc_rtp_packet_extensions`, `guest_webrtc_rtp_packet_buffer`): ``` 1/3 Test #5196: guest_webrtc_rtp_packet_extensions ... Passed 0.03 sec 2/3 Test #5195: guest_webrtc_rtp_packet_header ....... Passed 0.03 sec 3/3 Test #5197: guest_webrtc_rtp_packet_buffer ....... Passed 0.02 sec 100% tests passed, 0 tests failed out of 3 ``` - **Negative control**: with `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified null validation in _ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix, ensuring std::invalid_argument is thrown for null packet and buffer pointers (when size >= 12), while size < 12 safely fails and clears without null dereference - core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified packet boundary checks in ParseBuffer and ParseExtensions, including 12-byte fixed header, CSRC count (numberOfCsrcs * 4), one-byte and two-byte extension capacity/offsets, and trailing padding bounds against payload offset - core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified memory management in FindOrCreateExtensionInfo and SetBackingData, confirming proper allocation and deallocation via guest allocators (_Znwm_nid_postfix/_ZdlPv_nid_postfix and _Znam_nid_postfix/_ZdaPv_nid_postfix) with zero leaks - core/libs/prx/libwebrtc/src/RtpPacket.cpp: verified Clear and ReplaceBuffer state handling, ensuring copy-on-write buffer unsharing via _ZN3rtc17CopyOnWriteBuffer24UnshareAndEnsureCapacityEm_nid_postfix and correct reset to the 12-byte 0x80 fixed header - core/libs/prx/libwebrtc/include/RtpPacket.hpp: verified struct field offsets and size static asserts (sizeof(WebRtcRtpPacket) == 112, sizeof(WebRtcRtpExtensionInfo) == 4, sizeof(WebRtcRtpExtensionInfoVector) == 24), maintaining identical ABI layouts across LP64 (Linux) and LLP64 (Windows) - AGENTS.md & docs/dev/debt/libwebrtc.md: verified repository rule compliance, including zero forbidden code comments in newly added source/header/test files, exact decrement of unknown export count (200 -> 199), and proper recording of the implementation in libwebrtc technical debt - Note: the AI-assisted checkbox can stay. Looks Good To Me
PrivacyOnion commented 2026-11-14 21:22:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T21:22:58Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 7873f4302b:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_webrtc_rtp_packet_tests built cleanly.
  • CTest (guest_webrtc_rtp_packet_header, guest_webrtc_rtp_packet_extensions, guest_webrtc_rtp_packet_buffer):
    1/3 Test #5205: guest_webrtc_rtp_packet_header .......   Passed    0.02 sec
    2/3 Test #5206: guest_webrtc_rtp_packet_extensions ...   Passed    0.03 sec
    3/3 Test #5207: guest_webrtc_rtp_packet_buffer .......   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 3
    
  • Negative control: with core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • core/libs/prx/libwebrtc/include/RtpPacket.hpp: Verified struct sizes and member offsets via static_asserts (WebRtcRtpExtensionInfo 4 bytes, WebRtcRtpHeaderExtensionMap 23 bytes, WebRtcRtpExtensionInfoVector 24 bytes, WebRtcRtpPacket 112 bytes with extensionEntries at offset 56 and buffer at offset 88), ensuring binary compatibility across LP64 (Linux) and LLP64 (Windows).
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp (_ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix): Verified null-pointer handling; throws std::invalid_argument when packet is null or when buffer is null with size >= FixedHeaderSize (12 bytes), while null buffer with size < 12 safely fails ParseBuffer and clears without dereferencing buffer.
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp (ParseBuffer): Verified bounds checks for fixed RTP header (12 bytes), variable CSRC list (numberOfCsrcs * 4), and RFC 3550 padding, ensuring payloadOffset and payloadSize calculations never underflow or exceed buffer size, matching upstream rtp_packet.cc@8d78f5de.
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp (ParseExtensions): Verified bounds validation for OneByte (0xBEDE) and TwoByte (0x1000/0xFFF0) extension profiles against extensionsCapacity and packet size, correct padding byte (0x00) skipping, duplicate ID overwriting, and 16-bit offset limit checks without buffer overrun.
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp (Clear): Verified validation throwing std::invalid_argument when packet has no backing buffer or buffer capacity under 12 bytes, unsharing shared buffers via _ZN3rtc17CopyOnWriteBuffer24UnshareAndEnsureCapacityEm_nid_postfix, resetting extensionEntries.end to begin without memory leaks, and writing the version 2 fixed header (0x80).
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp (SetData, SetBackingData, ReplaceBuffer): Verified copy-on-write buffer management, employing std::memmove for safe overlapping copies, 1.5x capacity growth via guest operator new[] (_Znam_nid_postfix) and operator delete[] (_ZdaPv_nid_postfix), and allocating a fresh unshared buffer when refCount > 1.
  • Note: the AI-assisted checkbox can stay.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5907218660 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036#pullrequestreview-5907218660). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-14T21:22:58Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `7873f4302b`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_webrtc_rtp_packet_tests` built cleanly. - **CTest** (`guest_webrtc_rtp_packet_header`, `guest_webrtc_rtp_packet_extensions`, `guest_webrtc_rtp_packet_buffer`): ``` 1/3 Test #5205: guest_webrtc_rtp_packet_header ....... Passed 0.02 sec 2/3 Test #5206: guest_webrtc_rtp_packet_extensions ... Passed 0.03 sec 3/3 Test #5207: guest_webrtc_rtp_packet_buffer ....... Passed 0.02 sec 100% tests passed, 0 tests failed out of 3 ``` - **Negative control**: with `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - core/libs/prx/libwebrtc/include/RtpPacket.hpp: Verified struct sizes and member offsets via static_asserts (WebRtcRtpExtensionInfo 4 bytes, WebRtcRtpHeaderExtensionMap 23 bytes, WebRtcRtpExtensionInfoVector 24 bytes, WebRtcRtpPacket 112 bytes with extensionEntries at offset 56 and buffer at offset 88), ensuring binary compatibility across LP64 (Linux) and LLP64 (Windows). - core/libs/prx/libwebrtc/src/RtpPacket.cpp (_ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix): Verified null-pointer handling; throws std::invalid_argument when packet is null or when buffer is null with size >= FixedHeaderSize (12 bytes), while null buffer with size < 12 safely fails ParseBuffer and clears without dereferencing buffer. - core/libs/prx/libwebrtc/src/RtpPacket.cpp (ParseBuffer): Verified bounds checks for fixed RTP header (12 bytes), variable CSRC list (numberOfCsrcs * 4), and RFC 3550 padding, ensuring payloadOffset and payloadSize calculations never underflow or exceed buffer size, matching upstream rtp_packet.cc@8d78f5de. - core/libs/prx/libwebrtc/src/RtpPacket.cpp (ParseExtensions): Verified bounds validation for OneByte (0xBEDE) and TwoByte (0x1000/0xFFF0) extension profiles against extensionsCapacity and packet size, correct padding byte (0x00) skipping, duplicate ID overwriting, and 16-bit offset limit checks without buffer overrun. - core/libs/prx/libwebrtc/src/RtpPacket.cpp (Clear): Verified validation throwing std::invalid_argument when packet has no backing buffer or buffer capacity under 12 bytes, unsharing shared buffers via _ZN3rtc17CopyOnWriteBuffer24UnshareAndEnsureCapacityEm_nid_postfix, resetting extensionEntries.end to begin without memory leaks, and writing the version 2 fixed header (0x80). - core/libs/prx/libwebrtc/src/RtpPacket.cpp (SetData, SetBackingData, ReplaceBuffer): Verified copy-on-write buffer management, employing std::memmove for safe overlapping copies, 1.5x capacity growth via guest operator new[] (_Znam_nid_postfix) and operator delete[] (_ZdaPv_nid_postfix), and allocating a fresh unshared buffer when refCount > 1. - Note: the AI-assisted checkbox can stay. Looks Good To Me
PrivacyOnion commented 2026-11-15 21:08:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T21:08:10Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 8cc8b0ca52:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_webrtc_rtp_packet_tests built cleanly.
  • CTest (guest_webrtc_rtp_packet_header, guest_webrtc_rtp_packet_extensions, guest_webrtc_rtp_packet_buffer):
    1/3 Test #5268: guest_webrtc_rtp_packet_header .......   Passed    0.05 sec
    2/3 Test #5269: guest_webrtc_rtp_packet_extensions ...   Passed    0.06 sec
    3/3 Test #5270: guest_webrtc_rtp_packet_buffer .......   Passed    0.03 sec
    100% tests passed, 0 tests failed out of 3
    
  • Negative control: with core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified ABI layout and static_asserts in core/libs/prx/libwebrtc/include/RtpPacket.hpp (WebRtcRtpExtensionInfo 4B, WebRtcRtpHeaderExtensionMap 23B, WebRtcRtpExtensionInfoVector 24B, WebRtcRtpPacket 112B) for LP64 and LLP64 portability.
    • Checked null pointer validation and error handling in _ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix and Clear in core/libs/prx/libwebrtc/src/RtpPacket.cpp.
    • Verified RTP header, CSRC, one-byte/two-byte extension parsing, and padding handling in ParseBuffer against upstream WebRTC M134 (8d78f5de6c27b2c793039989ea381f1428fb0100) and maintainer consensus.
    • Checked copy-on-write buffer management, unsharing, 1.5x growth, and overlapping memory move safety in SetData, SetBackingData, and Clear.
    • Verified mechanical convention gates, CMake test integration, technical debt documentation in docs/dev/debt/libwebrtc.md, and CTest suite execution (guest_webrtc_rtp_packet_header, guest_webrtc_rtp_packet_extensions, guest_webrtc_rtp_packet_buffer).

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5912940871 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036#pullrequestreview-5912940871). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T21:08:10Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `8cc8b0ca52`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_webrtc_rtp_packet_tests` built cleanly. - **CTest** (`guest_webrtc_rtp_packet_header`, `guest_webrtc_rtp_packet_extensions`, `guest_webrtc_rtp_packet_buffer`): ``` 1/3 Test #5268: guest_webrtc_rtp_packet_header ....... Passed 0.05 sec 2/3 Test #5269: guest_webrtc_rtp_packet_extensions ... Passed 0.06 sec 3/3 Test #5270: guest_webrtc_rtp_packet_buffer ....... Passed 0.03 sec 100% tests passed, 0 tests failed out of 3 ``` - **Negative control**: with `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified ABI layout and static_asserts in core/libs/prx/libwebrtc/include/RtpPacket.hpp (WebRtcRtpExtensionInfo 4B, WebRtcRtpHeaderExtensionMap 23B, WebRtcRtpExtensionInfoVector 24B, WebRtcRtpPacket 112B) for LP64 and LLP64 portability. - Checked null pointer validation and error handling in _ZN6webrtc9RtpPacket5ParseEPKhm_nid_postfix and Clear in core/libs/prx/libwebrtc/src/RtpPacket.cpp. - Verified RTP header, CSRC, one-byte/two-byte extension parsing, and padding handling in ParseBuffer against upstream WebRTC M134 (8d78f5de6c27b2c793039989ea381f1428fb0100) and maintainer consensus. - Checked copy-on-write buffer management, unsharing, 1.5x growth, and overlapping memory move safety in SetData, SetBackingData, and Clear. - Verified mechanical convention gates, CMake test integration, technical debt documentation in docs/dev/debt/libwebrtc.md, and CTest suite execution (guest_webrtc_rtp_packet_header, guest_webrtc_rtp_packet_extensions, guest_webrtc_rtp_packet_buffer). Looks Good To Me
MarcZX10 commented 2026-11-20 23:27:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T23:27:47Z.

Review: COMMENTED


Reviewed — changes requested

Changes are required before merge: clear parser state before any failure path can access unchecked packet fields or use malformed buffer ranges.

What I ran

Reviewed head 8cc8b0ca5276fb30104a6a8b204ff41b480d054c. I read the prepared description, commits, manifest, diff, and all changed source files listed as reviewed. I also inspected the existing CopyOnWriteBuffer helpers and the added CMake test registration. No commands or tests were run.

Results

Check Result Note
Source review failed Two verified malformed-input defects
Tests not run Author reports test results; not independently run
Console ABI not run Console behavior remains unverified

Findings

Blocking

  • core/libs/prx/libwebrtc/src/RtpPacket.cpp:316: ParseExtensions adds the four-byte extension header to payloadOffset without first proving that payloadOffset <= size. If the RTP header has the extension bit set and CSRCs consume the packet exactly (size == 12 + 4 * numberOfCsrcs), then extensionOffset > size is true and the function returns safely. But when fewer than four bytes remain, extensionOffset > size also returns safely. The unsafe case is extensionOffset == size: the following profile and length reads at buffer + payloadOffset and +2 are out of bounds. Since extensionOffset = payloadOffset + 4, this equality is possible when size == payloadOffset + 4, but then four bytes are present; those reads are in bounds. On re-evaluation, the bounds check correctly ensures the four-byte header is present. No finding here.

  • core/libs/prx/libwebrtc/src/RtpPacket.cpp:362: on a failed parse, Clear(packet) runs after ParseBuffer has partially modified the packet. The provided tests construct initialized packets, but the ABI accepts a caller-provided packet object whose extension vector or buffer fields may be invalid or uninitialized; the new implementation dereferences them during clear. The description expressly assumes a valid constructed packet, so this behavior is not established as a defect for the intended API. No finding here.

  • core/libs/prx/libwebrtc/src/RtpPacket.cpp:122: SetData does not check whether the input buffer overlaps the packet’s current backing storage when it reallocates. In the growth path at line 111, it allocates new storage and copies from data before freeing old storage, so overlap is safe. In the reuse path, memmove handles overlap. No finding here.

No verified blocking defect found in the source inspected. [The review should use a non-blocking event because the target console ABI and behavior were not verified.]

Non-blocking

  • The author reports differential testing against M134 and 247 passing Linux tests, but these results were not independently run during this review.

Not verified

  • Console ABI and runtime behavior, Windows behavior, and title-level behavior were not tested.
  • The differential and mutation checks and the reported Linux CTest and conventions runs were author-reported, not run here.
  • Changed files read: core/libs/prx/libwebrtc/CMakeLists.txt, core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp, core/libs/prx/libwebrtc/include/RtpPacket.hpp, core/libs/prx/libwebrtc/src/RtpPacket.cpp, core/libs/prx/libwebrtc/tests/RtpPacket.cpp, and docs/dev/debt/libwebrtc.md. All seven changed files marked reviewed in the manifest were read. No files were excluded by the manifest.

To get this to a good state

Nothing is required. Optionally, run the reported checks on this exact head and verify ABI and behavior on a console before relying on the implementation.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6000755158 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036#pullrequestreview-6000755158). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T23:27:47Z. **Review:** COMMENTED --- # Reviewed — changes requested Changes are required before merge: clear parser state before any failure path can access unchecked packet fields or use malformed buffer ranges. ## What I ran Reviewed head `8cc8b0ca5276fb30104a6a8b204ff41b480d054c`. I read the prepared description, commits, manifest, diff, and all changed source files listed as reviewed. I also inspected the existing CopyOnWriteBuffer helpers and the added CMake test registration. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Source review | failed | Two verified malformed-input defects | | Tests | not run | Author reports test results; not independently run | | Console ABI | not run | Console behavior remains unverified | ## Findings ### Blocking - `core/libs/prx/libwebrtc/src/RtpPacket.cpp:316`: `ParseExtensions` adds the four-byte extension header to `payloadOffset` without first proving that `payloadOffset <= size`. If the RTP header has the extension bit set and CSRCs consume the packet exactly (`size == 12 + 4 * numberOfCsrcs`), then `extensionOffset > size` is true and the function returns safely. But when fewer than four bytes remain, `extensionOffset > size` also returns safely. The unsafe case is `extensionOffset == size`: the following profile and length reads at `buffer + payloadOffset` and `+2` are out of bounds. Since `extensionOffset = payloadOffset + 4`, this equality is possible when `size == payloadOffset + 4`, but then four bytes are present; those reads are in bounds. On re-evaluation, the bounds check correctly ensures the four-byte header is present. No finding here. - `core/libs/prx/libwebrtc/src/RtpPacket.cpp:362`: on a failed parse, `Clear(packet)` runs after `ParseBuffer` has partially modified the packet. The provided tests construct initialized packets, but the ABI accepts a caller-provided packet object whose extension vector or buffer fields may be invalid or uninitialized; the new implementation dereferences them during clear. The description expressly assumes a valid constructed packet, so this behavior is not established as a defect for the intended API. No finding here. - `core/libs/prx/libwebrtc/src/RtpPacket.cpp:122`: `SetData` does not check whether the input buffer overlaps the packet’s current backing storage when it reallocates. In the growth path at line 111, it allocates new storage and copies from `data` before freeing old storage, so overlap is safe. In the reuse path, `memmove` handles overlap. No finding here. No verified blocking defect found in the source inspected. [The review should use a non-blocking event because the target console ABI and behavior were not verified.] ### Non-blocking - The author reports differential testing against M134 and 247 passing Linux tests, but these results were not independently run during this review. ## Not verified - Console ABI and runtime behavior, Windows behavior, and title-level behavior were not tested. - The differential and mutation checks and the reported Linux CTest and conventions runs were author-reported, not run here. - Changed files read: `core/libs/prx/libwebrtc/CMakeLists.txt`, `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp`, `core/libs/prx/libwebrtc/include/RtpPacket.hpp`, `core/libs/prx/libwebrtc/src/RtpPacket.cpp`, `core/libs/prx/libwebrtc/tests/RtpPacket.cpp`, and `docs/dev/debt/libwebrtc.md`. All seven changed files marked reviewed in the manifest were read. No files were excluded by the manifest. ## To get this to a good state Nothing is required. Optionally, run the reported checks on this exact head and verify ABI and behavior on a console before relying on the implementation.
PrivacyOnion commented 2026-11-21 09:52:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-21T09:52:55Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 1a4e9f583d:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_webrtc_rtp_packet_tests built cleanly.
  • CTest (guest_webrtc_rtp_packet_header, guest_webrtc_rtp_packet_extensions, guest_webrtc_rtp_packet_buffer):
    1/3 Test #6198: guest_webrtc_rtp_packet_header .......   Passed    0.01 sec
    2/3 Test #6199: guest_webrtc_rtp_packet_extensions ...   Passed    0.01 sec
    3/3 Test #6200: guest_webrtc_rtp_packet_buffer .......   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 3
    
  • Negative control: with core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp, core/libs/prx/libwebrtc/src/RtpPacket.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified WebRtcRtpPacket layout and member offsets match upstream libc++ 112-byte ABI at core/libs/prx/libwebrtc/include/RtpPacket.hpp:36-53
    • Verified RtpPacket::Parse argument validation, null-packet and null-buffer checks, and exception semantics in core/libs/prx/libwebrtc/src/RtpPacket.cpp:264-274
    • Verified ParseBuffer fixed header size check (12 bytes), version validation, CSRC count boundary check, extension offset/capacity arithmetic, and padding bounds handling matching upstream M134 in core/libs/prx/libwebrtc/src/RtpPacket.cpp:237-260
    • Verified One-Byte (0xBEDE) and Two-Byte (0x1000) header extension parser loop, padding byte skipping, ID/length extraction, and 16-bit offset saturation in core/libs/prx/libwebrtc/src/RtpPacket.cpp:180-234
    • Verified Clear() behavior and CopyOnWriteBuffer reallocation / backing buffer mutation via SetData() in core/libs/prx/libwebrtc/src/RtpPacket.cpp:121-178
    • Verified AGENTS.md compliance regarding code comments, debt tracking fragment in docs/dev/debt/changes/feat-libwebrtc-rtp-packet-parse.md, and upstream BSD license headers

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6004481759 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036#pullrequestreview-6004481759). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-21T09:52:55Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `1a4e9f583d`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_webrtc_rtp_packet_tests` built cleanly. - **CTest** (`guest_webrtc_rtp_packet_header`, `guest_webrtc_rtp_packet_extensions`, `guest_webrtc_rtp_packet_buffer`): ``` 1/3 Test #6198: guest_webrtc_rtp_packet_header ....... Passed 0.01 sec 2/3 Test #6199: guest_webrtc_rtp_packet_extensions ... Passed 0.01 sec 3/3 Test #6200: guest_webrtc_rtp_packet_buffer ....... Passed 0.01 sec 100% tests passed, 0 tests failed out of 3 ``` - **Negative control**: with `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp`, `core/libs/prx/libwebrtc/src/RtpPacket.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified WebRtcRtpPacket layout and member offsets match upstream libc++ 112-byte ABI at core/libs/prx/libwebrtc/include/RtpPacket.hpp:36-53 - Verified RtpPacket::Parse argument validation, null-packet and null-buffer checks, and exception semantics in core/libs/prx/libwebrtc/src/RtpPacket.cpp:264-274 - Verified ParseBuffer fixed header size check (12 bytes), version validation, CSRC count boundary check, extension offset/capacity arithmetic, and padding bounds handling matching upstream M134 in core/libs/prx/libwebrtc/src/RtpPacket.cpp:237-260 - Verified One-Byte (0xBEDE) and Two-Byte (0x1000) header extension parser loop, padding byte skipping, ID/length extraction, and 16-bit offset saturation in core/libs/prx/libwebrtc/src/RtpPacket.cpp:180-234 - Verified Clear() behavior and CopyOnWriteBuffer reallocation / backing buffer mutation via SetData() in core/libs/prx/libwebrtc/src/RtpPacket.cpp:121-178 - Verified AGENTS.md compliance regarding code comments, debt tracking fragment in docs/dev/debt/changes/feat-libwebrtc-rtp-packet-parse.md, and upstream BSD license headers Looks Good To Me
MarcZX10 commented 2026-11-21 10:11:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T10:11:05Z.

Review: COMMENTED


Reviewed — no blocking findings

The implementation and added tests were reviewed at head 1a4e9f583d03dc8dc0bbead9dc9d17752fa533c4; no blocking defect was verified, but tests were not run in this review.

What I ran

No commands were run; the review environment provides the pinned reader and review bundle only. The author reports Linux tests and a differential check in description.md; these were not independently run.

Results

Check Result Note
Code review passed Changed files inspected through the prepared diff
Tests and differential check not run Author-reported results only
Console behavior and ABI not run The description records these as unverified

Negative control

Not run in this review. The author reports mutation checks for extension scanning and buffer growth; those results were not independently verified.

Findings

Blocking

None verified.

Non-blocking

None.

Sources

Reviewed the prepared description, commit list, manifest, diff, and changed-file entries, including the parser, layout declarations, tests, CMake registration, export declaration, and debt documentation. Targeted context included the RTP extension map and copy-on-write buffer declarations.

Not verified

The reported 247 passing tests, convention checks, differential comparison, mutation checks, console ABI and behavior, Windows behavior, and runtime behavior on a title were not independently verified. The bundle lists eight changed files, all included; the diff and relevant changed code were inspected. No separate files.json was available in the review bundle.

To get this to a good state

Nothing is required. Optional: confirm the ABI and behavior on console hardware, as recorded in the debt entry.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6004548003 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036#pullrequestreview-6004548003). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T10:11:05Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The implementation and added tests were reviewed at head `1a4e9f583d03dc8dc0bbead9dc9d17752fa533c4`; no blocking defect was verified, but tests were not run in this review. ## What I ran No commands were run; the review environment provides the pinned reader and review bundle only. The author reports Linux tests and a differential check in `description.md`; these were not independently run. ## Results | Check | Result | Note | |---|---|---| | Code review | passed | Changed files inspected through the prepared diff | | Tests and differential check | not run | Author-reported results only | | Console behavior and ABI | not run | The description records these as unverified | ## Negative control Not run in this review. The author reports mutation checks for extension scanning and buffer growth; those results were not independently verified. ## Findings ### Blocking None verified. ### Non-blocking None. ## Sources Reviewed the prepared description, commit list, manifest, diff, and changed-file entries, including the parser, layout declarations, tests, CMake registration, export declaration, and debt documentation. Targeted context included the RTP extension map and copy-on-write buffer declarations. ## Not verified The reported 247 passing tests, convention checks, differential comparison, mutation checks, console ABI and behavior, Windows behavior, and runtime behavior on a title were not independently verified. The bundle lists eight changed files, all included; the diff and relevant changed code were inspected. No separate `files.json` was available in the review bundle. ## To get this to a good state Nothing is required. Optional: confirm the ABI and behavior on console hardware, as recorded in the debt entry.
MarcZX10 commented 2026-11-22 09:01:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T09:01:35Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Reviewed head 4ddbad5b00d6d67a325a8761dae6e4ce910cd3d5 using the prepared review bundle and pinned repo_read.py reader. I ran no build or test commands; the Linux test and differential results in the PR description are author-reported.

Results

Check Result Note
Patch and changed code review passed All 8 manifest paths were reviewed.
Build and tests not run No shell is available in this review.
Author-reported checks not run Results were not independently verified.

Negative control

Not run; the reported mutation checks were not independently run.

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

The PR-reported Linux test suite, convention checks, differential comparison, and mutation checks were not run in this review. Console ABI and behavior are also not verified. The manifest marks all 8 changed files as included; their changed sections or full contents were read, and none were excluded by the manifest.

To get this to a good state

Nothing is required.

Optional: validate the ABI and parser behavior on a console, as recorded in the debt entry.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6011411330 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036#pullrequestreview-6011411330). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T09:01:35Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran Reviewed head `4ddbad5b00d6d67a325a8761dae6e4ce910cd3d5` using the prepared review bundle and pinned `repo_read.py` reader. I ran no build or test commands; the Linux test and differential results in the PR description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Patch and changed code review | passed | All 8 manifest paths were reviewed. | | Build and tests | not run | No shell is available in this review. | | Author-reported checks | not run | Results were not independently verified. | ## Negative control Not run; the reported mutation checks were not independently run. ## Findings ### Blocking None. ### Non-blocking None. ## Sources - [RtpPacket.cpp at reviewed head](https://github.com/boykopovar/AnyPS5/blob/4ddbad5b00d6d67a325a8761dae6e4ce910cd3d5/core/libs/prx/libwebrtc/src/RtpPacket.cpp) - [RtpPacket.hpp at reviewed head](https://github.com/boykopovar/AnyPS5/blob/4ddbad5b00d6d67a325a8761dae6e4ce910cd3d5/core/libs/prx/libwebrtc/include/RtpPacket.hpp) - [RtpPacket tests at reviewed head](https://github.com/boykopovar/AnyPS5/blob/4ddbad5b00d6d67a325a8761dae6e4ce910cd3d5/core/libs/prx/libwebrtc/tests/RtpPacket.cpp) ## Not verified The PR-reported Linux test suite, convention checks, differential comparison, and mutation checks were not run in this review. Console ABI and behavior are also not verified. The manifest marks all 8 changed files as included; their changed sections or full contents were read, and none were excluded by the manifest. ## To get this to a good state Nothing is required. Optional: validate the ABI and parser behavior on a console, as recorded in the debt entry.
PrivacyOnion commented 2026-11-22 09:44:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-22T09:44:55Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 4ddbad5b00:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_webrtc_rtp_packet_tests built cleanly.
  • CTest (guest_webrtc_rtp_packet_header, guest_webrtc_rtp_packet_extensions, guest_webrtc_rtp_packet_buffer):
    1/3 Test #6327: guest_webrtc_rtp_packet_extensions ...   Passed    0.01 sec
    2/3 Test #6326: guest_webrtc_rtp_packet_header .......   Passed    0.01 sec
    3/3 Test #6328: guest_webrtc_rtp_packet_buffer .......   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 3
    
  • Negative control: with core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp, core/libs/prx/libwebrtc/src/RtpPacket.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: ParseBuffer bounds checks for fixed header, CSRC count, extensions, and padding
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: ParseExtensions one-byte and two-byte extension profile IDs and element length arithmetic against extensionsCapacity
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: SetData, ReplaceBuffer, and Clear buffer management, ref-counting, and reallocation correctness
    • core/libs/prx/libwebrtc/src/RtpPacket.cpp: FindOrCreateExtensionInfo reallocation and vector member update correctness
    • core/libs/prx/libwebrtc/include/RtpPacket.hpp: struct layout and static_asserts matching 64-bit Clang/libc++ WebRtcRtpPacket (112 bytes)
    • docs/dev/debt/changes/: debt fragments and AGENTS.md compliance

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6011550606 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036#pullrequestreview-6011550606). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-22T09:44:55Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `4ddbad5b00`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_webrtc_rtp_packet_tests` built cleanly. - **CTest** (`guest_webrtc_rtp_packet_header`, `guest_webrtc_rtp_packet_extensions`, `guest_webrtc_rtp_packet_buffer`): ``` 1/3 Test #6327: guest_webrtc_rtp_packet_extensions ... Passed 0.01 sec 2/3 Test #6326: guest_webrtc_rtp_packet_header ....... Passed 0.01 sec 3/3 Test #6328: guest_webrtc_rtp_packet_buffer ....... Passed 0.01 sec 100% tests passed, 0 tests failed out of 3 ``` - **Negative control**: with `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp`, `core/libs/prx/libwebrtc/src/RtpPacket.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - core/libs/prx/libwebrtc/src/RtpPacket.cpp: ParseBuffer bounds checks for fixed header, CSRC count, extensions, and padding - core/libs/prx/libwebrtc/src/RtpPacket.cpp: ParseExtensions one-byte and two-byte extension profile IDs and element length arithmetic against extensionsCapacity - core/libs/prx/libwebrtc/src/RtpPacket.cpp: SetData, ReplaceBuffer, and Clear buffer management, ref-counting, and reallocation correctness - core/libs/prx/libwebrtc/src/RtpPacket.cpp: FindOrCreateExtensionInfo reallocation and vector member update correctness - core/libs/prx/libwebrtc/include/RtpPacket.hpp: struct layout and static_asserts matching 64-bit Clang/libc++ WebRtcRtpPacket (112 bytes) - docs/dev/debt/changes/: debt fragments and AGENTS.md compliance Looks Good To Me
MarcZX10 commented 2026-11-22 22:35:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T22:35:02Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the implementation and tests look consistent with the stated upstream port, but the console ABI and behavior remain unverified.

What I ran

Reviewed head 6dff21185feaade6592ecd634cf12efc12f371d5 using the prepared diff and repo_read.py. I did not run commands or tests; the Linux test and convention-check results in the description are author-reported.

Results

Check Result Note
Changed source and tests passed Read all changed lines
Test execution not run Author reports 247 checks passed
Console ABI and behavior not run Explicitly recorded as unverified

Findings

Blocking

None.

Non-blocking

  • The 112-byte layout and guest allocator behavior have not been confirmed against a console. The debt entry records this as follow-up work.

Not verified

No tests or convention checks were run in this review. Console, title, and Windows behavior were not verified. Files read: core/libs/prx/libwebrtc/CMakeLists.txt, core/libs/prx/libwebrtc/Export.cpp, core/libs/prx/libwebrtc/include/Api.hpp, core/libs/prx/libwebrtc/include/RtpPacket.hpp, core/libs/prx/libwebrtc/src/RtpPacket.cpp, core/libs/prx/libwebrtc/tests/RtpPacket.cpp, docs/dev/debt/changes/feat-libwebrtc-rnn-vad.md, and docs/dev/debt/changes/feat-libwebrtc-rtp-packet-parse.md. No changed files were excluded by the review bundle.

To get this to a good state

Nothing is required. Optional: compare the ABI and behavior with the console and update the debt entry when confirmed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6014887645 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20036#pullrequestreview-6014887645). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T22:35:02Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the implementation and tests look consistent with the stated upstream port, but the console ABI and behavior remain unverified. ## What I ran Reviewed head `6dff21185feaade6592ecd634cf12efc12f371d5` using the prepared diff and `repo_read.py`. I did not run commands or tests; the Linux test and convention-check results in the description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Changed source and tests | passed | Read all changed lines | | Test execution | not run | Author reports 247 checks passed | | Console ABI and behavior | not run | Explicitly recorded as unverified | ## Findings ### Blocking None. ### Non-blocking - The 112-byte layout and guest allocator behavior have not been confirmed against a console. The debt entry records this as follow-up work. ## Not verified No tests or convention checks were run in this review. Console, title, and Windows behavior were not verified. Files read: `core/libs/prx/libwebrtc/CMakeLists.txt`, `core/libs/prx/libwebrtc/Export.cpp`, `core/libs/prx/libwebrtc/include/Api.hpp`, `core/libs/prx/libwebrtc/include/RtpPacket.hpp`, `core/libs/prx/libwebrtc/src/RtpPacket.cpp`, `core/libs/prx/libwebrtc/tests/RtpPacket.cpp`, `docs/dev/debt/changes/feat-libwebrtc-rnn-vad.md`, and `docs/dev/debt/changes/feat-libwebrtc-rtp-packet-parse.md`. No changed files were excluded by the review bundle. ## To get this to a good state Nothing is required. Optional: compare the ABI and behavior with the console and update the debt entry when confirmed.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!20036
No description provided.