Summary
Opening some QuickTime .mov files fails while parsing an AAC mp4a sample entry with Sound Description version = 2. The error is:
mp4a box contains a box with a larger size than it
The file is valid (plays in VLC / QuickTime). The video track is fine; parse dies on the audio stsd entry and aborts the whole moov, so video-only consumers cannot open the file either.
Repro
- Download: https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_h264.mov.zip
- Unzip →
big_buck_bunny_1080p_h264.mov
Mp4::read_bytes / open the file with re_mp4 0.5.1
Root cause (observed)
In this file the audio mp4a has version == 2 (QTFF SoundDescriptionV2). After the ISO-style fields, the next u32 is sizeOfStructOnly (here 72); child atoms (e.g. wave → esds) start at that offset from the atom start.
Mp4aBox::read_box only skips the version 1 16-byte extension. For version 2 it continues box-walking from the wrong cursor, treats sizeOfStructOnly / the float64 sample rate as a child box header, then hits a misaligned size and returns InvalidData("mp4a box contains a box with a larger size than it").
There is also a related gap: on BoxType::WaveBox the reader does not skip/recurse into wave to find nested esds (comment mentions the layout, but the branch is empty).
Expected
- Parse QT Sound Description version 2 (
sizeOfStructOnly + skip to extensions), matching QTFF / common players.
- Prefer finding
esds inside wave when present.
- Ideally, a failure on one sample entry / audio track should not hard-fail the entire file when other tracks are usable (nice-to-have).
Environment
re_mp4 0.5.1
- File: Blender Foundation Big Buck Bunny 1080p H.264
.mov (link above)
Summary
Opening some QuickTime
.movfiles fails while parsing an AACmp4asample entry with Sound Description version = 2. The error is:The file is valid (plays in VLC / QuickTime). The video track is fine; parse dies on the audio
stsdentry and aborts the wholemoov, so video-only consumers cannot open the file either.Repro
big_buck_bunny_1080p_h264.movMp4::read_bytes/ open the file withre_mp40.5.1Root cause (observed)
In this file the audio
mp4ahasversion == 2(QTFF SoundDescriptionV2). After the ISO-style fields, the nextu32issizeOfStructOnly(here72); child atoms (e.g.wave→esds) start at that offset from the atom start.Mp4aBox::read_boxonly skips the version 1 16-byte extension. For version 2 it continues box-walking from the wrong cursor, treatssizeOfStructOnly/ the float64 sample rate as a child box header, then hits a misaligned size and returnsInvalidData("mp4a box contains a box with a larger size than it").There is also a related gap: on
BoxType::WaveBoxthe reader does not skip/recurse intowaveto find nestedesds(comment mentions the layout, but the branch is empty).Expected
sizeOfStructOnly+ skip to extensions), matching QTFF / common players.esdsinsidewavewhen present.Environment
re_mp40.5.1.mov(link above)