strukturag / libheif

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

Add files from tests to fuzzing corpus to improve coverage. #1258

Closed fancycode closed 3 months ago

fancycode commented 3 months ago

@farindk not sure if the bpp check is fine or if values < 8 should be supported here.

farindk commented 3 months ago

The problem is that we never considered <8 bits before and thus 8 bit color conversions use hard-coded constants at all kind of places. Simply replacing (bitdepth != 8) with (bitdepth <= 8) will lead to wrong conversions, but bitdepth != 8 will lead to misclassifying this as HDR. Both are wrong and we should instead disable the color-conversions for bitdepth < 8 until this is supported. I'll merge this and add the required tests.