XMA: reject frame starts in packet headers #1796

Open
VlREX wants to merge 2 commits from upstream-pr/1797 into main
VlREX commented 2026-11-24 22:45:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by VlREX on 2026-11-24T22:45:12Z.


No description provided.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5481586068 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1797). Originally posted by [VlREX](https://github.com/VlREX) on 2026-11-24T22:45:12Z. --- _No description provided._
catminou4 commented 2026-11-24 23:05:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T23:05:47Z.

Review: APPROVED


Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (70564ae).

cargo test -p victory-formats --locked → 24 passed, 0 failed. frame_starts_must_be_inside_packet_payloads: XMA frame-start validation tightened to packet payloads — small, correct-looking.

<!-- greyfinch-sync:Marvisak/VIctory:review:6048825796 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1797#pullrequestreview-6048825796). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T23:05:47Z. **Review:** APPROVED --- Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (70564ae). cargo test -p victory-formats --locked → 24 passed, 0 failed. frame_starts_must_be_inside_packet_payloads: XMA frame-start validation tightened to packet payloads — small, correct-looking.
Marvisak commented 2026-11-25 02:06:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:36:29Z.


Automated triage for the maintainers.

Merge candidate. The new commit 673efe6 follows the previous review's suggestion. It drops the rejection of frame starts inside a packet header from read_frame (crates/victory-formats/src/xma.rs), along with its test, so a start at a packet boundary is again stepped over by Cursor as on main. What remains is the padding-marker fix: next_frame's walk from the packet's first frame now stops at a 0x7fff length, the same rule read_frame already applies. On main the walk would add 32767 bits, overshoot start, and count a frame that isn't there.

Tests:

  • padding_marker_before_start_ends_the_search gives next == None here. On main, reading the same data jumps to the next packet, so the test tells the two versions apart.
  • truncated_frame_and_out_of_range_starts_are_rejected pins behaviour Cursor already has.

This only matters for streams where a padding marker comes before a frame start in the same packet, which is damaged data. One thing before merging: the PR title still says "reject frame starts in packet headers", which no longer describes the change. Please retitle it, for example "XMA: the frame walk stops at the padding marker".

CI: passing.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149744126 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1797#issuecomment-7149744126). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:36:29Z. --- <!-- victory-triage v1 head=673efe616bb77dbacf841f1bf78bbf72b75c428d verdict=merge-candidate at=2026-11-25T20:22:45Z --> Automated triage for the maintainers. **Merge candidate.** The new commit `673efe6` follows the previous review's suggestion. It drops the rejection of frame starts inside a packet header from `read_frame` (`crates/victory-formats/src/xma.rs`), along with its test, so a start at a packet boundary is again stepped over by `Cursor` as on `main`. What remains is the padding-marker fix: `next_frame`'s walk from the packet's first frame now stops at a `0x7fff` length, the same rule `read_frame` already applies. On `main` the walk would add 32767 bits, overshoot `start`, and count a frame that isn't there. Tests: - `padding_marker_before_start_ends_the_search` gives `next == None` here. On `main`, reading the same data jumps to the next packet, so the test tells the two versions apart. - `truncated_frame_and_out_of_range_starts_are_rejected` pins behaviour `Cursor` already has. This only matters for streams where a padding marker comes before a frame start in the same packet, which is damaged data. One thing before merging: the PR title still says "reject frame starts in packet headers", which no longer describes the change. Please retitle it, for example "XMA: the frame walk stops at the padding marker". CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
fuzeofficlal commented 2026-11-26 19:24:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T19:24:08Z.

Review: APPROVED


Verified locally merged onto origin/main (63bcca43, Windows 11 x64, Rust 1.98.1 MSVC):

  • cargo test --locked -p victory-formats xma — 22 passed, 0 failed, 3 ignored (including padding_marker_before_start_ends_the_search and truncated_frame_and_out_of_range_starts_are_rejected)
  • cargo clippy --locked -p victory-formats --all-targets -- -D warnings (default and --all-features) — 0 warnings
  • cargo xtask policy — ok (191 files ok)

Review notes

  • The production diff at 673efe6 cleanly stops next_frame on the 0x7fff frame-length padding marker (crates/victory-formats/src/xma.rs:165) without rejecting valid payload-relative FrameOffsetInBits offsets (0..=31) or 0x7fff no-start packet headers.
  • Minor non-blocking note: the PR title still mentions rejecting frame starts in packet headers from before commit 673efe6 removed that check.
<!-- greyfinch-sync:Marvisak/VIctory:review:6079495589 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1797#pullrequestreview-6079495589). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T19:24:08Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`63bcca43`, Windows 11 x64, Rust 1.98.1 MSVC): - `cargo test --locked -p victory-formats xma` — **22 passed, 0 failed, 3 ignored** (including `padding_marker_before_start_ends_the_search` and `truncated_frame_and_out_of_range_starts_are_rejected`) - `cargo clippy --locked -p victory-formats --all-targets -- -D warnings` (default and `--all-features`) — 0 warnings - `cargo xtask policy` — ok (`191 files ok`) ### Review notes - The production diff at `673efe6` cleanly stops `next_frame` on the `0x7fff` frame-length padding marker (`crates/victory-formats/src/xma.rs:165`) without rejecting valid payload-relative `FrameOffsetInBits` offsets (`0..=31`) or `0x7fff` no-start packet headers. - Minor non-blocking note: the PR title still mentions rejecting frame starts in packet headers from before commit `673efe6` removed that check.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1797:upstream-pr/1797'
git switch 'upstream-pr/1797'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1797'
git switch 'upstream-pr/1797'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1797'
git switch 'upstream-pr/1797'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1797'
git switch 'main'
git merge --squash 'upstream-pr/1797'
git switch 'main'
git merge --ff-only 'upstream-pr/1797'
git switch 'main'
git merge 'upstream-pr/1797'
git push origin 'main'
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
Marvisak/VIctory!1796
No description provided.