gpac / ComplianceWarden

A pluggable compliance checker (ISOBMFF, HEIF/MIAF/AVIF, AV1 HDR10+)
https://gpac.github.io/ComplianceWarden-wasm/
Other
16 stars 7 forks source link

avif: Fix av1AlphaTrackFirstOffset computation #42

Closed vigneshvg closed 1 year ago

vigneshvg commented 1 year ago

The current code has a bug where it will populate the offset of the last frame in the alpha track as opposed to the first. Since the current code loops over all the chunk_offsets, the last value populated for the track would be the offset of the last frame.

If that last frame is not a key frame (likely the case for most practical AVIF sequences), then this would erroneously trigger a "Missing sequence header in mdat box" error.

This PR ensures that the sequence header check is performed only for the first frame in the alpha track.

Also, fix a typo in the variable name "Aplha" => "Alpha".

rbouqueau commented 1 year ago

LGTM. Thank you!