[libpng16] Changed png_ptr->options from a png_byte to png_uint_32, to

accomodate up to 16 options.
This commit is contained in:
Glenn Randers-Pehrson 2017-01-02 19:03:36 -06:00
parent f981826204
commit f8bdbd4d8f
5 changed files with 22 additions and 18 deletions

View File

@ -1,4 +1,4 @@
Libpng 1.6.28beta01 - January 2, 2017
Libpng 1.6.28beta01 - January 3, 2017
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.
@ -25,11 +25,13 @@ Other information:
Changes since the last public release (1.6.27):
Version 1.6.28beta01 [January 2, 2017]
Version 1.6.28beta01 [January 3, 2017]
Fixed arm/aarch64 detection in CMakeLists.txt (Gianfranco Costamagna).
Added option to Cmake build allowing a custom location of zlib to be
specified in a scenario where libpng is being built as a subproject
alongside zlib by another project (Sam Serrels).
Changed png_ptr->options from a png_byte to png_uint_32, to accomodate
up to 16 options.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -5774,11 +5774,13 @@ Version 1.6.27 [December 29, 2016]
Fixed a potential null pointer dereference in png_set_text_2() (bug report
and patch by Patrick Keshishian, CVE-2016-10087).
Version 1.6.28beta01 [January 2, 2017]
Version 1.6.28beta01 [January 3, 2017]
Fixed arm/aarch64 detection in CMakeLists.txt (Gianfranco Costamagna).
Added option to Cmake build allowing a custom location of zlib to be
specified in a scenario where libpng is being built as a subproject
alongside zlib by another project (Sam Serrels).
Changed png_ptr->options from a png_byte to png_uint_32, to accomodate
up to 16 options.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

14
png.c
View File

@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions
*
* Last changed in libpng 1.6.27 [December 29, 2016]
* Last changed in libpng 1.6.28 [(PENDING RELEASE)]
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -776,14 +776,14 @@ png_get_copyright(png_const_structrp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
"libpng version 1.6.28beta01 - December 30, 2016" PNG_STRING_NEWLINE \
"libpng version 1.6.28beta01 - January 3, 2017" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
# else
return "libpng version 1.6.28beta01 - December 30, 2016\
return "libpng version 1.6.28beta01 - January 3, 2017\
Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@ -4260,11 +4260,11 @@ png_set_option(png_structrp png_ptr, int option, int onoff)
if (png_ptr != NULL && option >= 0 && option < PNG_OPTION_NEXT &&
(option & 1) == 0)
{
int mask = 3 << option;
int setting = (2 + (onoff != 0)) << option;
int current = png_ptr->options;
png_uint_32 mask = 3 << option;
png_uint_32 setting = (2 + (onoff != 0)) << option;
png_uint_32 current = png_ptr->options;
png_ptr->options = (png_byte)(((current & ~mask) | setting) & 0xff);
png_ptr->options = (png_uint_32)(((current & ~mask) | setting) & 0xff);
return (current & mask) >> option;
}

10
png.h
View File

@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.6.28beta01, December 30, 2016
* libpng version 1.6.28beta01, January 3, 2017
*
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -12,7 +12,7 @@
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.28beta01, December 30, 2016:
* libpng versions 0.97, January 1998, through 1.6.28beta01, January 3, 2017:
* Glenn Randers-Pehrson.
* See also "Contributing Authors", below.
*/
@ -25,7 +25,7 @@
*
* This code is released under the libpng license.
*
* libpng versions 1.0.7, July 1, 2000 through 1.6.28beta01, December 30, 2016 are
* libpng versions 1.0.7, July 1, 2000 through 1.6.28beta01, January 3, 2017 are
* Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
* derived from libpng-1.0.6, and are distributed according to the same
* disclaimer and license as libpng-1.0.6 with the following individuals
@ -239,7 +239,7 @@
* Y2K compliance in libpng:
* =========================
*
* December 30, 2016
* January 3, 2017
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
@ -308,7 +308,7 @@
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.6.28beta01"
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.28beta01 - December 30, 2016\n"
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.28beta01 - January 3, 2017\n"
#define PNG_LIBPNG_VER_SONUM 16
#define PNG_LIBPNG_VER_DLLNUM 16

View File

@ -1,8 +1,8 @@
/* pngstruct.h - header file for PNG reference library
*
* Last changed in libpng 1.6.24 [August 4, 2016]
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* Last changed in libpng 1.6.28 [(PENDING RELEASE)]
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@ -353,7 +353,7 @@ struct png_struct_def
/* Options */
#ifdef PNG_SET_OPTION_SUPPORTED
png_byte options; /* On/off state (up to 4 options) */
png_uint_32 options; /* On/off state (up to 16 options) */
#endif
#if PNG_LIBPNG_VER < 10700