mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[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:
committed by
Glenn Randers-Pehrson
parent
36562c1032
commit
53097f5bbb
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user