AOMediaCodec / libavif

libavif - Library for encoding and decoding .avif files
Other
1.44k stars 187 forks source link

read.c: Fail if gainmap properties have more than one nclx #2191

Closed vigneshvg closed 3 weeks ago

vigneshvg commented 1 month ago

The current code simply adopts the first nclx property of the gainmap item. The right behavior seems to be to fail if there are multiple nclx properties (similar to what we do for the color image and the tonemap image).

HEIF Section 6.5.5.1:

When two ColourInformationBoxes are associated with an image
item, one shall have a colour_type value of 'rICC' or 'prof'
(providing either restricted or unrestricted ICC profiles
respectively) and the other one shall have a colour_type value of
'nclx' with colour_primaries equal to 2 and
transfer_characteristics equal to 2 (2 indicating "unspecified",
since these data are supplied by the ICC profile instead).