[libpng15] Fix incorrect calculation of maximum number of unknown chunks or

sPLT chunks to be stored (John Bowler).
This commit is contained in:
Glenn Randers-Pehrson 2015-03-16 16:03:54 -05:00
parent ca9e4e3a3b
commit 88c83a2030
3 changed files with 9 additions and 5 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.5.22rc04 - March 15, 2015 Libpng 1.5.22rc04 - March 16, 2015
This is not intended to be a public release. It will be replaced This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version. within a few weeks by a public version or by another test version.
@ -61,9 +61,11 @@ Version 1.5.22rc03 [March 12, 2015]
Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF
for consistency, and remove some useless tests (Alexey Petruchik). for consistency, and remove some useless tests (Alexey Petruchik).
Version 1.5.22rc04 [March 15, 2015] Version 1.5.22rc04 [March 16, 2015]
Remove pnglibconf.h, pnglibconf.c, and pnglibconf.out instead of Remove pnglibconf.h, pnglibconf.c, and pnglibconf.out instead of
pnglibconf.* in "make clean" (Cosmin). pnglibconf.* in "make clean" (Cosmin).
Fix incorrect calculation of maximum number of unknown chunks or
sPLT chunks to be stored (John Bowler).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -4325,9 +4325,11 @@ Version 1.5.22rc03 [March 12, 2015]
Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF
for consistency, and remove some useless tests (Alexey Petruchik). for consistency, and remove some useless tests (Alexey Petruchik).
Version 1.5.22rc04 [March 15, 2015] Version 1.5.22rc04 [March 16, 2015]
Remove pnglibconf.h, pnglibconf.c, and pnglibconf.out instead of Remove pnglibconf.h, pnglibconf.c, and pnglibconf.out instead of
pnglibconf.* in "make clean" (Cosmin). pnglibconf.* in "make clean" (Cosmin).
Fix incorrect calculation of maximum number of unknown chunks or
sPLT chunks to be stored (John Bowler).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -977,7 +977,7 @@ png_set_sPLT(png_structp png_ptr,
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
element_size = PNG_SIZE_MAX/png_sizeof(png_sPLT_t); element_size = png_sizeof(png_sPLT_t);
if (nentries < 0 || if (nentries < 0 ||
nentries > INT_MAX-info_ptr->splt_palettes_num || nentries > INT_MAX-info_ptr->splt_palettes_num ||
(unsigned int)/*SAFE*/(nentries +/*SAFE*/ (unsigned int)/*SAFE*/(nentries +/*SAFE*/
@ -1058,7 +1058,7 @@ png_set_unknown_chunks(png_structp png_ptr,
if (png_ptr == NULL || info_ptr == NULL || num_unknowns == 0) if (png_ptr == NULL || info_ptr == NULL || num_unknowns == 0)
return; return;
element_size = PNG_SIZE_MAX/png_sizeof(png_unknown_chunk); element_size = png_sizeof(png_unknown_chunk);
if (num_unknowns < 0 || if (num_unknowns < 0 ||
num_unknowns > INT_MAX-info_ptr->unknown_chunks_num || num_unknowns > INT_MAX-info_ptr->unknown_chunks_num ||
(unsigned int)/*SAFE*/(num_unknowns +/*SAFE*/ (unsigned int)/*SAFE*/(num_unknowns +/*SAFE*/