mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng15] Revised test for validity of "num_unknowns" to eliminate compiler
warnings.
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
77a817bfc2
commit
bec9ca9b8a
7
pngset.c
7
pngset.c
@@ -1040,9 +1040,10 @@ png_set_unknown_chunks(png_structp png_ptr,
|
||||
return;
|
||||
|
||||
if (num_unknowns < 0 ||
|
||||
num_unknowns >= INT_MAX-info_ptr->unknown_chunks_num ||
|
||||
num_unknowns >= PNG_SIZE_MAX/png_sizeof(png_unknown_chunk)
|
||||
- info_ptr->unknown_chunks_num)
|
||||
num_unknowns > INT_MAX-info_ptr->unknown_chunks_num ||
|
||||
(unsigned int)/*SAFE*/(num_unknowns +/*SAFE*/
|
||||
info_ptr->unknown_chunks_num) >=
|
||||
PNG_SIZE_MAX/png_sizeof(png_unknown_chunk))
|
||||
np=NULL;
|
||||
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user