Repository navigation
fix!: read version 0 trun composition offsets as unsigned - #258
Conversation
TrunEntry.cts widens to i64 so both ranges fit. Encode keeps version 1 unless an offset only fits version 0, and refuses offsets that fit neither. 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 36 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. |
Summary
ISO/IEC 14496-12 §8.8.8 stores
sample_composition_time_offsetas anunsigned int(32)in a version 0trunand as asigned int(32)in version 1. The decoder always read it as signed, so a version 0 offset abovei32::MAXcame back negative.TrunEntry.ctswidens fromOption<i32>toOption<i64>, so both ranges are representable.u32in version 0 and asi32in version 1.i32::MAXvalues, withError::InvalidCombination.This is the remaining item from #186, after kixelated/mp4-atom#160 and kixelated/mp4-atom#254. It's the narrow follow-up promised when closing kixelated/mp4-atom#212.
Public API
Breaking: the type of
TrunEntry.cts. It belongs in the pending 0.17.0 release (kixelated/mp4-atom#247), which already breaksTrun.Testing
cargo test --all-features(addscts_version_roundtrip,cts_version_0_is_unsigned, andcts_out_of_range_is_refused)cargo clippy --all-targets --all-features -- -D warnings,cargo fmt --checkCloses #186.
(Written by Claude Opus 5.5)
🤖 Generated with Claude Code