From f8bdbd4d8f9da0ed6003ac786db847e9326dd986 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Mon, 2 Jan 2017 19:03:36 -0600 Subject: [PATCH] [libpng16] Changed png_ptr->options from a png_byte to png_uint_32, to accomodate up to 16 options. --- ANNOUNCE | 6 ++++-- CHANGES | 4 +++- png.c | 14 +++++++------- png.h | 10 +++++----- pngstruct.h | 6 +++--- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 0d61d831d..f3f7f9250 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -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 diff --git a/CHANGES b/CHANGES index b02c53302..d5b1913a7 100644 --- a/CHANGES +++ b/CHANGES @@ -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 diff --git a/png.c b/png.c index f67e23b8f..c8c4f9490 100644 --- a/png.c +++ b/png.c @@ -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; } diff --git a/png.h b/png.h index adefeab81..037c89f51 100644 --- a/png.h +++ b/png.h @@ -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 diff --git a/pngstruct.h b/pngstruct.h index 55516eaaa..22f97bc0f 100644 --- a/pngstruct.h +++ b/pngstruct.h @@ -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