strukturag / libheif

libheif is an HEIF and AVIF file format decoder and encoder.
Other
1.71k stars 298 forks source link

MIAF compatibility flag incorrectly set #735

Closed chris0e3 closed 1 year ago

chris0e3 commented 1 year ago

I was reading the code when I spotted what looks like a typo.

https://github.com/AOMediaCodec/libavif/blob/429b005c95d7dd45298d12a99e0781de1bbeb37f/src/avif.c#L858 says the spec says “the tile_width shall be greater than or equal to 64, and should be a multiple of 64” & “the tile_height shall be greater than or equal to 64, and should be a multiple of 64”.

This makes sense. So image is NOT MIAF compatible if (width % 64 OR height % 64).

However:

https://github.com/strukturag/libheif/blob/012d77c8340ef8b6e190aea5ac4ff9262d992f0c/libheif/heif_context.cc#L2161

Should probably be || NOT &&.

farindk commented 1 year ago

Thank you for spotting this error.