mozilla / mp4parse-rust

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

Ignore unused trailing data in `mvhd`. #416

Closed kinetiknz closed 7 months ago

kinetiknz commented 8 months ago

This addresses BMO 1867424, where the linked media contains an unusual mvhd with 2 bytes of trailing data. Since mvhd has a fixed set of fields, we were expecting the mvhd size to match the spec based on the size of the known fields (108 bytes for this v0 file, v1 would be larger due to 64-bit fields) but the mvhd box size is 110 bytes in this file. To address this, we now skip the remaining unknown bytes based on the box's reported size.

padenot commented 7 months ago

We need to land this.