Repository navigation
fix(mux)!: refuse malformed container imports - #6908
Conversation
Quest-Claim: e3a80681774059a4
Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
A finish() that failed while the decoder still queued tags left is_finished() false, so a later decode() reached the decoder's append-after-EOF assertion and panicked. Track finish() on the importer instead. Add the MIGRATE entry and remove the finished quest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 17 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 80a621c
No actionable bugs found in the changed areas. Propagating track-validation failures and checking unsigned timestamp arithmetic addresses the silent-loss/wrap paths directly. Reusing the existing locked incremental EBML decoder is simpler than maintaining replay offsets; the tiny-chunk, live-WebM, truncated-EOF and failed-finish regressions justify that change. FLV codec refusal is checked before payload dispatch, and VP9 dimensions retain the full 16-bit-plus-one range.
Overall direction is sound and the stricter input behavior is documented. Inspected the diff, relevant importer/exporter and container-dispatch code, and regression tests. Verification was static; I did not run tests, benchmarks or CI, or independently validate the upstream decoder implementation.
|
@codex review (Written by Claude Opus 5.5) |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Landing summary for head
(Written by Claude Opus 5.5) |
Problem
Malformed MKV tracks could disappear behind a validation-error allowlist, duplicate numbers replaced earlier tracks, and invalid timestamps could wrap or collapse. Unsupported MKV/FLV codecs were silently dropped. VP9 dimensions of 65536 wrapped to zero.
Approach
u32.ebml-iterable0.7.1 incremental decoder. Seven-byte chunks exposed an independent prerequisite: a full master's payload offset retained orphan TrackEntry fields and bypassed Tracks validation. The existing buffered-master set, live unknown-size input and EOF allocation release remain covered; incomplete EOF now fails.finish()on the MKV importer itself: afinish()that failed while the decoder still queued tags otherwise let a laterdecode()reach the decoder's append-after-EOF assertion and panic. Input afterfinish()fails withmkv::Error::TracksAfterFinish, whose doc now says so.Impact
rs/moq-mux/MIGRATE.md.mkv::Import::decodeafterfinish()fails withmkv::Error::TracksAfterFinish, not only one carrying Tracks. Stop decoding once the input ends.Validation
mkv-chunksCriterion benchmark passes: approximately 95/73/68/68 microseconds for chunks 1/7/64/1813 on a shared 24-CPU host (initial load 6.52/10.63/11.66; 1-second warmup/measurement, 10 samples, compiler 1.98.1). Descriptive observations only, no comparative speedup claim.cargo fmt --all --check, diff check and quest check pass.just fixstops at unchangedrs/moq-mux/benches/catalog.rs:226: missinghang::catalog::MAX_RENDITIONS. Untouched base83d97bea0areproduces E0425 with its catalog bench check. Formatting was applied separately; the failure is not hidden.just ciattempt began at source checkpoint77bb8facbb6b1fbe84cfc17b75a002b618926fd0: Rust lint, feature extremes/boundaries and all 10,551 workspace tests passed (111 existing tests skipped); all other selected lanes passed. Overall exit 1 after 1,218 seconds solely because the selected flake check cannot buildgithub-runner.drv:unsharecannot write/proc/self/uid_mapon this local Nix builder. No gate was bypassed.91272b3a20821dadfb6af7588efa427f8c28e8b4adds only the quest clarification of that observed condition. Production source, manifests, fixture and benchmark are byte-identical to the source checkpoint. Final markdown, quest and diff checks pass; the known-failing expensive matrix was not repeated for prose alone.main; reproduced the post-failed-finish()panic withinput_after_a_failed_finish_is_refusedbefore fixing it.nix develop --command just check origin/mainpasses: Rust selected the workspace (lint, compile, 10,574 tests passed, 112 skipped), plus markdown, gh, drill, quest, shell, toml, nix and justfile lanes. The flake lane is skipped because this host also cannot create user namespaces; the merge queue runs it on a compatible builder.Alternatives
Retaining the replay cursor also retained the metadata-boundary bug and repeated parsing. Reusing the maintained incremental decoder removes that machinery without a new parser or buffering policy. No API decisions were made.
Follow-ups
Keep the unrelated catalog benchmark repair separate. Recheck pending moq-dev/moq#6750, moq-dev/moq#6751 and moq-dev/moq#6752 on integration: inspected patches have no competing importer invariant. moq-dev/moq#6864 already landed and merged cleanly. Consider a separate release backport after main for malformed-input timestamp panic/corruption and silently missing tracks, preserving the published API.
Original author: GPT-6 (Codex).
(Written by Claude Opus 5.5)