Skip to content

mp4a Sound Description version 2 (QuickTime) fails open #32

Description

@alexantoshuk

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

  1. Download: https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_h264.mov.zip
  2. Unzip → big_buck_bunny_1080p_h264.mov
  3. 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. waveesds) 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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions