[libpng16] Fix bug in calculation of maxbits, in png_write_sBIT, introduced

in libpng-1.6.17beta01 (John Bowler).
This commit is contained in:
John Bowler 2015-03-16 16:31:13 -05:00 committed by Glenn Randers-Pehrson
parent 47e1315459
commit c9fd075c89
3 changed files with 13 additions and 5 deletions

View File

@ -1,4 +1,4 @@
Libpng 1.6.17rc04 - March 15, 2015
Libpng 1.6.17rc04 - March 16, 2015
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.
@ -39,6 +39,8 @@ Version 1.6.17beta01 [January 29, 2015]
Merged some parts of libpng-1.6.17beta01 and libpng-1.7.0beta47.
Added #ifndef __COVERITY__ where needed in png.c, pngrutil.c and
pngset.c to avoid warnings about dead code.
Added "& 0xff" to many instances of expressions that are typecast
to (png_byte), to avoid Coverity gripes.
Version 1.6.17beta02 [February 7, 2015]
Work around one more Coverity-scan dead-code warning.
@ -77,9 +79,11 @@ Version 1.6.17rc03 [March 12, 2015]
Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF
for consistency, and remove some useless tests (Alexey Petruchik).
Version 1.6.17rc04 [March 15, 2015]
Version 1.6.17rc04 [March 16, 2015]
Remove pnglibconf.h, pnglibconf.c, and pnglibconf.out instead of
pnglibconf.* in "make clean" (Cosmin).
Fix bug in calculation of maxbits, in png_write_sBIT, introduced
in libpng-1.6.17beta01 (John Bowler).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -5140,6 +5140,8 @@ Version 1.6.17beta01 [January 29, 2015]
Merged some parts of libpng-1.6.17beta01 and libpng-1.7.0beta47.
Added #ifndef __COVERITY__ where needed in png.c, pngrutil.c and
pngset.c to avoid warnings about dead code.
Added "& 0xff" to many instances of expressions that are typecast
to (png_byte), to avoid Coverity gripes.
Version 1.6.17beta02 [February 7, 2015]
Work around one more Coverity-scan dead-code warning.
@ -5178,9 +5180,11 @@ Version 1.6.17rc03 [March 12, 2015]
Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF
for consistency, and remove some useless tests (Alexey Petruchik).
Version 1.6.17rc04 [March 15, 2015]
Version 1.6.17rc04 [March 16, 2015]
Remove pnglibconf.h, pnglibconf.c, and pnglibconf.out instead of
pnglibconf.* in "make clean" (Cosmin).
Fix bug in calculation of maxbits, in png_write_sBIT, introduced
in libpng-1.6.17beta01 (John Bowler).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -1348,8 +1348,8 @@ png_write_sBIT(png_structrp png_ptr, png_const_color_8p sbit, int color_type)
{
png_byte maxbits;
maxbits = color_type==PNG_COLOR_TYPE_PALETTE ? 8 :
(png_byte)(png_ptr->usr_bit_depth & 0xff);
maxbits = (png_byte)((color_type==PNG_COLOR_TYPE_PALETTE ? 8 :
png_ptr->usr_bit_depth) & 0xff);
if (sbit->red == 0 || sbit->red > maxbits ||
sbit->green == 0 || sbit->green > maxbits ||