[libpng16] fix: Update the cICP support for better compliance with PNG-3

Apply the following corrections and improvements:
 * Add a validity check in `png_set_cICP`.
 * Fix the ordering check in `png_handle_cICP`.
 * Add a multiplicity check in `png_handle_cICP`.
 * Optimize the implementation of `png_write_cICP`.
 * Remove an unnecessary preprocessor guard from pngtest.c.
 * Update the dependency declaration in pnglibconf.dfa.
 * Fix the indentation where necessary.

This is a cherry-pick of commit c2a02691df1ecf51b7c97142752a7034350cb1f6
from branch 'libpng18'.
This commit is contained in:
Cosmin Truta
2024-12-31 22:05:03 +02:00
parent 75748d93ce
commit 823c2d80dc
8 changed files with 78 additions and 66 deletions

View File

@@ -846,7 +846,7 @@ setting IDAT_READ_SIZE default PNG_ZBUF_SIZE
# Ancillary chunks
chunk bKGD
chunk cHRM enables COLORSPACE
chunk cICP
chunk cICP enables COLORSPACE, GAMMA
chunk eXIf
chunk gAMA enables GAMMA
chunk hIST