AVIF Parsing: Handling Unrecognized ISOBMFF Boxes

When an AVIF parser encounters an unrecognized ISOBMFF (ISO Base Media File Format) box, standard-compliant behavior dictates that the parser safely skips the box and continues reading the rest of the file. Because AVIF relies on the hierarchical, length-delimited structure of ISOBMFF, unknown boxes do not automatically halt processing or invalidate the image. Instead, this design guarantees forward and backward compatibility across different software versions and feature specifications, allowing readers to extract and render the image as long as core structural elements remain intact.

The Box Header and Skipping Mechanism

Every ISOBMFF box starts with a standard header that contains two primary fields:

  1. Size (32-bit or 64-bit integer): Specifies the total byte length of the box, including the header and any nested payload.
  2. Type (FourCC): A four-character code (such as ftyp, meta, or mdat) identifying the purpose of the box.

Because the box length is established before the type is processed, a parser does not need to understand the contents of a box to navigate around it. If the FourCC represents an unknown or proprietary box type, the parser reads the size field, advances its file offset by that number of bytes from the start of the header, and resumes evaluation at the next sibling box.

Impact on Image Decoding

The practical outcome of skipping an unknown box depends on whether the box contains non-essential metadata or vital decoding parameters:

Malformed Files vs. Unknown Extensions

Standard AVIF parsing distinguishes between unknown boxes and syntactically malformed boxes: