implement track reference (tref) box#139
Conversation
WalkthroughAdds support for the 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/moov/trak/tref.rs`:
- Around line 27-37: The decode implementation for TrackReferenceTypeBox must
validate that the payload length is a multiple of 4 before decoding u32 track
IDs: inside fn decode (where Header::decode(buf)? is called and size is
computed) add a check that size % 4 == 0 and return Error::InvalidSize if not,
then compute num_entries = size / 4 and proceed to allocate track_ids and call
u32::decode(buf) for each entry; this prevents leftover bytes from being
misinterpreted as the next header and keeps the existing error type and
variables (track_ids, num_entries, Error::InvalidSize) intact.
From ISO/IEC 14496-12:2022 Section 8.3.3
99f085d to
2489258
Compare
From ISO/IEC 14496-12:2022 Section 8.3.3
Resolves #117