Skip to content

Backport CR3 box bounds-check fixes from C++ to the Rust PIEX backend. - #8

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1013729765
Open

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1013729765

Conversation

@copybara-service

Copy link
Copy Markdown

Backport CR3 box bounds-check fixes from C++ to the Rust PIEX backend.

Port the C++ CR3 box size and containment checks from cl/1008374384 and cl/977984901 to third_party/piex/rust/src/cr3/cr3_parser.rs:

  • Reject CRAW sample entry boxes smaller than 88 bytes or extending past the enclosing stsd box boundary (InvalidPiexTest.Cr3CrawBoxTooSmall and InvalidPiexTest.Cr3CrawBoxExceedsStsdBox).
  • Reject UUID PRVW boxes with fewer than 24 payload bytes (box_header.size < 32) and UUID MOOV boxes with fewer than 16 payload bytes (box_header.size < 24).
  • Add unit tests in third_party/piex/rust/tests/unit/cr3_parser.rs covering undersized rejection, stsd boundary overflow, and exact minimum-valid box sizes.

Port the C++ CR3 box size and containment checks from cl/1008374384 and cl/977984901 to `third_party/piex/rust/src/cr3/cr3_parser.rs`:
- Reject `CRAW` sample entry boxes smaller than 88 bytes or extending past the enclosing `stsd` box boundary (`InvalidPiexTest.Cr3CrawBoxTooSmall` and `InvalidPiexTest.Cr3CrawBoxExceedsStsdBox`).
- Reject `UUID` `PRVW` boxes with fewer than 24 payload bytes (`box_header.size < 32`) and `UUID` `MOOV` boxes with fewer than 16 payload bytes (`box_header.size < 24`).
- Add unit tests in `third_party/piex/rust/tests/unit/cr3_parser.rs` covering undersized rejection, `stsd` boundary overflow, and exact minimum-valid box sizes.

PiperOrigin-RevId: 1013729765
@google-cla

google-cla Bot commented Nov 4, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants