mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[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:
15
pngwrite.c
15
pngwrite.c
@@ -237,13 +237,14 @@ png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_cICP_SUPPORTED
|
||||
if ((info_ptr->valid & PNG_INFO_cICP) != 0)
|
||||
{
|
||||
png_write_cICP(png_ptr, info_ptr->cicp_colour_primaries,
|
||||
info_ptr->cicp_transfer_function,
|
||||
info_ptr->cicp_matrix_coefficients,
|
||||
info_ptr->cicp_video_full_range_flag);
|
||||
}
|
||||
if ((info_ptr->valid & PNG_INFO_cICP) != 0)
|
||||
{
|
||||
png_write_cICP(png_ptr,
|
||||
info_ptr->cicp_colour_primaries,
|
||||
info_ptr->cicp_transfer_function,
|
||||
info_ptr->cicp_matrix_coefficients,
|
||||
info_ptr->cicp_video_full_range_flag);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_eXIf_SUPPORTED
|
||||
|
||||
Reference in New Issue
Block a user