[libpng17] Check (png_uint_16) casts for overflow. Also removed png_muldiv_warn,

added RELEASE/!RELEASE convenience macros. png_muldiv_warn was used in
only one place, and the overflow condition is a genuine warning not
an internal error.  Four macros allow code or function parameters to be
condition on RELEASE (or not) builds and tidy up the #ifdef handling of
functions.
This commit is contained in:
John Bowler
2015-03-22 20:26:13 -05:00
committed by Glenn Randers-Pehrson
parent 36562c1032
commit 53097f5bbb
14 changed files with 265 additions and 249 deletions

View File

@@ -957,7 +957,7 @@ png_write_PLTE(png_structrp png_ptr, png_const_colorp palette,
return;
}
png_ptr->num_palette = (png_uint_16)num_pal;
png_ptr->num_palette = png_check_u16(png_ptr, num_pal);
png_debug1(3, "num_palette = %d", png_ptr->num_palette);
png_write_chunk_header(png_ptr, png_PLTE, (png_uint_32)(num_pal * 3));