mozilla / mp4parse-rust

Parser for ISO Base Media Format aka video/mp4 written in Rust.
Mozilla Public License 2.0
411 stars 62 forks source link

Support unknown (zero) sized `mdat` boxes in AVIF. #388

Closed kinetiknz closed 1 year ago

kinetiknz commented 1 year ago

Add basic support for unknown (zero) sized mdat boxes in AVIF. Ideally, the BMFFBox contents would be limited to the remaining size of the file and everything would just work, but the file length is not available via the Mp4ParseIo interface (and may not be query-able for some streams) so it's not possible to rely on that. Instead, when encountering a zero sized mdat, read the remaining file in chunks until end of file.

This partially addresses the issue reported in BMO 1805436.