diff --git a/ANNOUNCE b/ANNOUNCE index 36b801bb2..d51e19b36 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,4 +1,4 @@ -Libpng 1.6.22beta03 - February 27, 2016 +Libpng 1.6.22beta04 - March 15, 2016 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. @@ -8,20 +8,20 @@ Files available for download: Source files with LF line endings (for Unix/Linux) and with a "configure" script - 1.6.22beta03.tar.xz (LZMA-compressed, recommended) - 1.6.22beta03.tar.gz + 1.6.22beta04.tar.xz (LZMA-compressed, recommended) + 1.6.22beta04.tar.gz Source files with CRLF line endings (for Windows), without the "configure" script - lp1622b03.7z (LZMA-compressed, recommended) - lp1622b03.zip + lp1622b04.7z (LZMA-compressed, recommended) + lp1622b04.zip Other information: - 1.6.22beta03-README.txt - 1.6.22beta03-LICENSE.txt - libpng-1.6.22beta03-*.asc (armored detached GPG signatures) + 1.6.22beta04-README.txt + 1.6.22beta04-LICENSE.txt + libpng-1.6.22beta04-*.asc (armored detached GPG signatures) Changes since the last public release (1.6.21): @@ -54,7 +54,7 @@ Version 1.6.22beta02 [February 8, 2016] extend the png_set_alpha_mode range as HDR imaging systems are starting to emerge. -Version 1.6.22beta03 [February 27, 2016] +Version 1.6.22beta03 [March 9, 2016] Added a common-law trademark notice and export control information to the LICENSE file, png.h, and the man page. Restored "& 0xff" in png_save_uint_16() and png_save_uint_32() that @@ -75,6 +75,10 @@ Version 1.6.22beta03 [February 27, 2016] that case, to apply any of the supported transforms. This makes for more realistic testing; the decoded data actually gets used in a meaningful fashion (John Bowler). + Fixed some misleading indentation (Krishnaraj Bhat). + +Version 1.6.22beta04 [March 15, 2016] + Force GCC compilation to C89 if needed (Dagobert Michelsen). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index a6044d8f6..3a40300c6 100644 --- a/CHANGES +++ b/CHANGES @@ -5063,7 +5063,8 @@ Version 1.6.15beta04 [November 4, 2014] Version 1.6.15beta05 [November 5, 2014] Use png_get_libpng_ver(NULL) instead of PNG_LIBPNG_VER_STRING in example.c, pngtest.c, and applications in the contrib directory. - Avoid out-of-bounds memory access in png_user_version_check(). + Fixed an out-of-range read in png_user_version_check() (Bug report from + Qixue Xiao, CVE-2015-8540). Simplified and future-proofed png_user_version_check(). Fixed GCC unsigned int->float warnings. Various versions of GCC seem to generate warnings when an unsigned value is implicitly @@ -5513,7 +5514,7 @@ Version 1.6.22beta02 [February 8, 2016] extend the png_set_alpha_mode range as HDR imaging systems are starting to emerge. -Version 1.6.22beta03 [February 27, 2016] +Version 1.6.22beta03 [March 9, 2016] Added a common-law trademark notice and export control information to the LICENSE file, png.h, and the man page. Restored "& 0xff" in png_save_uint_16() and png_save_uint_32() that @@ -5534,6 +5535,10 @@ Version 1.6.22beta03 [February 27, 2016] that case, to apply any of the supported transforms. This makes for more realistic testing; the decoded data actually gets used in a meaningful fashion (John Bowler). + Fixed some misleading indentation (Krishnaraj Bhat). + +Version 1.6.22beta04 [March 15, 2016] + Force GCC compilation to C89 if needed (Dagobert Michelsen). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CMakeLists.txt b/CMakeLists.txt index 3afe2154e..40f406b02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -696,7 +696,7 @@ endif(NOT WIN32 OR CYGWIN OR MINGW) # SET UP LINKS if(PNG_SHARED) set_target_properties(png PROPERTIES -# VERSION 16.${PNGLIB_RELEASE}.1.6.22beta03 +# VERSION 16.${PNGLIB_RELEASE}.1.6.22beta04 VERSION 16.${PNGLIB_RELEASE}.0 SOVERSION 16 CLEAN_DIRECT_OUTPUT 1) diff --git a/LICENSE b/LICENSE index d2bb706cb..5f8384414 100644 --- a/LICENSE +++ b/LICENSE @@ -10,7 +10,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.0.7, July 1, 2000, through 1.6.22beta03, February 19, 2016, are +libpng versions 1.0.7, July 1, 2000 through 1.6.22beta04, March 9, 2016 are Copyright (c) 2000-2002, 2004, 2006-2016 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 @@ -127,4 +127,4 @@ any encryption software. See the EAR, paragraphs 734.3(b)(3) and Glenn Randers-Pehrson glennrp at users.sourceforge.net -February 19, 2016 +March 9, 2016 diff --git a/README b/README index 4c5b0ecd3..77b8f4c5e 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -README for libpng version 1.6.22beta03 - February 8, 2016 (shared library 16.0) +README for libpng version 1.6.22beta04 - March 9, 2016 (shared library 16.0) See the note about version numbers near the top of png.h See INSTALL for instructions on how to install libpng. diff --git a/configure.ac b/configure.ac index 3d6b4a016..2dad641c2 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,7 @@ AC_PREREQ([2.68]) dnl Version number stuff here: -AC_INIT([libpng],[1.6.22beta03],[png-mng-implement@lists.sourceforge.net]) +AC_INIT([libpng],[1.6.22beta04],[png-mng-implement@lists.sourceforge.net]) AC_CONFIG_MACRO_DIR([scripts]) # libpng does not follow GNU file name conventions (hence 'foreign') @@ -46,7 +46,7 @@ dnl automake, so the following is not necessary (and is not defined anyway): dnl AM_PREREQ([1.11.2]) dnl stop configure from automagically running automake -PNGLIB_VERSION=1.6.22beta03 +PNGLIB_VERSION=1.6.22beta04 PNGLIB_MAJOR=1 PNGLIB_MINOR=6 PNGLIB_RELEASE=22 @@ -114,6 +114,25 @@ AC_ARG_ENABLE(werror, CFLAGS="$sav_CFLAGS" fi],) +# For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89 +# In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining _POSIX_SOURCE to 1 +# This is incompatible with the new default mode, so we test for that and force the +# "-std=c89" compiler option: +AC_MSG_CHECKING([if we need to force back C standard to C89]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ + [#define _POSIX_SOURCE 1] + [#include ] + ])], + AC_MSG_RESULT(no),[ + if test "x$GCC" != "xyes"; then + AC_MSG_ERROR( + [Forcing back to C89 is required but the flags are only known for GCC]) + fi + AC_MSG_RESULT(yes) + CFLAGS="$CFLAGS -std=c89" +]) + # Checks for header files. AC_HEADER_STDC diff --git a/contrib/intel/INSTALL b/contrib/intel/INSTALL index 9b4f9dc01..e4d56777f 100644 --- a/contrib/intel/INSTALL +++ b/contrib/intel/INSTALL @@ -3,23 +3,47 @@ Enabling SSE support Copyright (c) 2016 Google, Inc. Written by Mike Klein and Matt Sarett -To enable SSE support in libpng, apply intel_sse.patch in your build -directory, before running "configure". If you prefer, manually edit -configure.ac and Makefile.am, following the instructions below, then -then follow the instructions in section II of INSTALL in the main libpng -directory. - -Then configure libpng with -DPNG_INTEL_SSE in CPPFLAGS. If you only -want to optimize reading 4bpp images, also use -DPNG_NO_INTEL_SSE_3BPP. - If you have moved intel_init.c and filter_sse2_intrinsics.c to a different directory, be sure to update the '#include "../../pngpriv.h"' line in both files if necessary to point to the correct relative location of pngpriv.h with respect to the new location of those files. -If you are using a custom makefile instead of a configure-generated -makefile, you will have to update it manually to include contrib/intel/*.c -and to define PNG_INTEL_SSE and possibly PNG_NO_INTEL_SSE_3BPP. +To enable SSE support in libpng, follow the instructions in I, II, or III, +below: + +I. Using patched "configure" scripts: + +First, apply intel_sse.patch in your build directory. + + patch -i contrib/intel/intel_sse.patch -p1 + +Then, if you are not building in a new GIT clone, e.g., in a tar +distribution, remove any existing pre-built configure scripts: + + ./configure --enable-maintainer-mode + make maintainer-clean + ./autogen.sh --maintainer --clean + +Finally, configure libpng with -DPNG_INTEL_SSE in CPPFLAGS. If you only +want to optimize reading 4bpp images, also use -DPNG_NO_INTEL_SSE_3BPP: + + ./autogen.sh --maintainer + CPPFLAGS="-DPNG_INTEL_SSE -DPNG_NO_INTEL_SSE_3BPP" ./configure [options] + make + +II. Using a custom makefile: + +If you are using a custom makefile makefile, you will have to update it +manually to include contrib/intel/*.o in the dependencies, and to define +PNG_INTEL_SSE and possibly PNG_NO_INTEL_SSE_3BPP. + +III. Using manually updated "configure" scripts: + +If you prefer, manually edit configure.ac and Makefile.am, following the +instructions below, then follow the instructions in section II of INSTALL +in the main libpng directory, then configure libpng with -DPNG_INTEL_SSE +in CPPFLAGS. If you only want to optimize reading 4bpp images, also use +-DPNG_NO_INTEL_SSE_3BPP. 1. Insert the following lines above the copyright line near the top of configure.ac: diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c index c82c269fd..fa25e3961 100644 --- a/contrib/libtests/pngvalid.c +++ b/contrib/libtests/pngvalid.c @@ -3307,10 +3307,10 @@ init_standard_palette(png_store *ps, png_structp pp, png_infop pi, int npalette, for (; i<256; ++i) tRNS[i] = 24; -# ifdef PNG_WRITE_tRNS_SUPPORTED - if (j > 0) - png_set_tRNS(pp, pi, tRNS, j, 0/*color*/); -# endif +#ifdef PNG_WRITE_tRNS_SUPPORTED + if (j > 0) + png_set_tRNS(pp, pi, tRNS, j, 0/*color*/); +#endif } } @@ -7937,11 +7937,11 @@ image_transform_png_set_background_set(const image_transform *this, else back.gray = (png_uint_16)data.red; -# ifdef PNG_FLOATING_POINT_SUPPORTED - png_set_background(pp, &back, PNG_BACKGROUND_GAMMA_FILE, expand, 0); -# else - png_set_background_fixed(pp, &back, PNG_BACKGROUND_GAMMA_FILE, expand, 0); -# endif +#ifdef PNG_FLOATING_POINT_SUPPORTED + png_set_background(pp, &back, PNG_BACKGROUND_GAMMA_FILE, expand, 0); +#else + png_set_background_fixed(pp, &back, PNG_BACKGROUND_GAMMA_FILE, expand, 0); +#endif this->next->set(this->next, that, pp, pi); } diff --git a/libpng-manual.txt b/libpng-manual.txt index 9261e01fe..1bb94850e 100644 --- a/libpng-manual.txt +++ b/libpng-manual.txt @@ -1,6 +1,6 @@ libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.6.22beta03 - February 19, 2016 + libpng version 1.6.22beta04 - March 9, 2016 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2016 Glenn Randers-Pehrson @@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.6.22beta03 - February 19, 2016 + libpng versions 0.97, January 1998, through 1.6.22beta04 - March 9, 2016 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2016 Glenn Randers-Pehrson @@ -5337,7 +5337,7 @@ Since the PNG Development group is an ad-hoc body, we can't make an official declaration. This is your unofficial assurance that libpng from version 0.71 and -upward through 1.6.22beta03 are Y2K compliant. It is my belief that earlier +upward through 1.6.22beta04 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. Libpng only has two year fields. One is a 2-byte unsigned integer diff --git a/libpng.3 b/libpng.3 index 561e464cd..1a01b4724 100644 --- a/libpng.3 +++ b/libpng.3 @@ -1,6 +1,6 @@ -.TH LIBPNG 3 "February 19, 2016" +.TH LIBPNG 3 "March 9, 2016" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.6.22beta03 +libpng \- Portable Network Graphics (PNG) Reference Library 1.6.22beta04 .SH SYNOPSIS \fB #include \fP @@ -510,7 +510,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng. .SH LIBPNG.TXT libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.6.22beta03 - February 19, 2016 + libpng version 1.6.22beta04 - March 9, 2016 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2016 Glenn Randers-Pehrson @@ -521,7 +521,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.6.22beta03 - February 19, 2016 + libpng versions 0.97, January 1998, through 1.6.22beta04 - March 9, 2016 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2016 Glenn Randers-Pehrson @@ -5847,7 +5847,7 @@ Since the PNG Development group is an ad-hoc body, we can't make an official declaration. This is your unofficial assurance that libpng from version 0.71 and -upward through 1.6.22beta03 are Y2K compliant. It is my belief that earlier +upward through 1.6.22beta04 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. Libpng only has two year fields. One is a 2-byte unsigned integer @@ -6005,7 +6005,7 @@ possible without all of you. Thanks to Frank J. T. Wojcik for helping with the documentation. -Libpng version 1.6.22beta03 - February 19, 2016: +Libpng version 1.6.22beta04 - March 9, 2016: Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). @@ -6030,7 +6030,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.0.7, July 1, 2000, through 1.6.22beta03, February 19, 2016, are +libpng versions 1.0.7, July 1, 2000 through 1.6.22beta04, March 9, 2016 are Copyright (c) 2000-2002, 2004, 2006-2016 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 @@ -6155,7 +6155,7 @@ files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). Glenn Randers-Pehrson glennrp at users.sourceforge.net -February 19, 2016 +March 9, 2016 .\" end of man page diff --git a/libpngpf.3 b/libpngpf.3 index 5173d8a43..6f18b8aa1 100644 --- a/libpngpf.3 +++ b/libpngpf.3 @@ -1,6 +1,6 @@ -.TH LIBPNGPF 3 "February 8, 2016" +.TH LIBPNGPF 3 "March 9, 2016" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.6.22beta03 +libpng \- Portable Network Graphics (PNG) Reference Library 1.6.22beta04 (private functions) .SH SYNOPSIS \fB#include \fI"pngpriv.h" diff --git a/png.5 b/png.5 index f1e6c3a0d..e9d82c2a2 100644 --- a/png.5 +++ b/png.5 @@ -1,4 +1,4 @@ -.TH PNG 5 "February 8, 2016" +.TH PNG 5 "March 9, 2016" .SH NAME png \- Portable Network Graphics (PNG) format .SH DESCRIPTION diff --git a/png.c b/png.c index ea5b94ca8..c625df6d5 100644 --- a/png.c +++ b/png.c @@ -14,7 +14,7 @@ #include "pngpriv.h" /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_22beta03 Your_png_h_is_not_version_1_6_22beta03; +typedef png_libpng_version_1_6_22beta04 Your_png_h_is_not_version_1_6_22beta04; /* Tells libpng that we have already handled the first "num_bytes" bytes * of the PNG file signature. If the PNG data is embedded into another @@ -775,14 +775,14 @@ png_get_copyright(png_const_structrp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.6.22beta03 - February 8, 2016" PNG_STRING_NEWLINE \ + "libpng version 1.6.22beta04 - March 9, 2016" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2002,2004,2006-2016 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.22beta03 - February 8, 2016\ + return "libpng version 1.6.22beta04 - March 9, 2016\ Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; diff --git a/png.h b/png.h index 62a7cb7b7..0e3dd3070 100644 --- a/png.h +++ b/png.h @@ -1,7 +1,7 @@ /* png.h - header file for PNG reference library * - * libpng version 1.6.22beta03, February 19, 2016 + * libpng version 1.6.22beta04, March 9, 2016 * * Copyright (c) 1998-2002,2004,2006-2016 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.22beta03, February 19, 2016: + * libpng versions 0.97, January 1998, through 1.6.22beta04, March 9, 2016: * Glenn Randers-Pehrson. * See also "Contributing Authors", below. */ @@ -29,7 +29,7 @@ * files that are distributed with libpng have other copyright owners and * are released under other open source licenses. * - * libpng versions 1.0.7, July 1, 2000, through 1.6.22beta03, February 19, 2016, are + * libpng versions 1.0.7, July 1, 2000 through 1.6.22beta04, March 9, 2016 are * Copyright (c) 2000-2002, 2004, 2006-2016 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 @@ -245,13 +245,13 @@ * Y2K compliance in libpng: * ========================= * - * February 19, 2016 + * March 9, 2016 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. * * This is your unofficial assurance that libpng from version 0.71 and - * upward through 1.6.22beta03 are Y2K compliant. It is my belief that + * upward through 1.6.22beta04 are Y2K compliant. It is my belief that * earlier versions were also Y2K compliant. * * Libpng only has two year fields. One is a 2-byte unsigned integer @@ -313,9 +313,9 @@ */ /* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.6.22beta03" +#define PNG_LIBPNG_VER_STRING "1.6.22beta04" #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.6.22beta03 - February 19, 2016\n" + " libpng version 1.6.22beta04 - March 9, 2016\n" #define PNG_LIBPNG_VER_SONUM 16 #define PNG_LIBPNG_VER_DLLNUM 16 @@ -329,7 +329,7 @@ * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ -#define PNG_LIBPNG_VER_BUILD 03 +#define PNG_LIBPNG_VER_BUILD 04 /* Release Status */ #define PNG_LIBPNG_BUILD_ALPHA 1 @@ -464,7 +464,7 @@ extern "C" { /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ -typedef char* png_libpng_version_1_6_22beta03; +typedef char* png_libpng_version_1_6_22beta04; /* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. * diff --git a/pngconf.h b/pngconf.h index c850f5d8b..03ec615ae 100644 --- a/pngconf.h +++ b/pngconf.h @@ -1,7 +1,7 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.6.22beta03, February 8, 2016 + * libpng version 1.6.22beta04, March 9, 2016 * * Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngget.c b/pngget.c index ca44982a0..14fc7be52 100644 --- a/pngget.c +++ b/pngget.c @@ -456,11 +456,11 @@ png_get_pHYs_dpi(png_const_structrp png_ptr, png_const_inforp info_ptr, return (retval); } #endif /* pHYs */ -#endif /* INCH_CONVERSIONS */ +#endif /* INCH_CONVERSIONS */ /* png_get_channels really belongs in here, too, but it's been around longer */ -#endif /* EASY_ACCESS */ +#endif /* EASY_ACCESS */ png_byte PNGAPI @@ -1142,19 +1142,19 @@ png_get_compression_buffer_size(png_const_structrp png_ptr) return 0; #ifdef PNG_WRITE_SUPPORTED - if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0) + if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0) #endif { #ifdef PNG_SEQUENTIAL_READ_SUPPORTED - return png_ptr->IDAT_read_size; + return png_ptr->IDAT_read_size; #else - return PNG_IDAT_READ_SIZE; + return PNG_IDAT_READ_SIZE; #endif } #ifdef PNG_WRITE_SUPPORTED - else - return png_ptr->zbuffer_size; + else + return png_ptr->zbuffer_size; #endif } diff --git a/pngpriv.h b/pngpriv.h index 0ac16fadd..8893f18b9 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -1,7 +1,7 @@ /* pngpriv.h - private declarations for use inside libpng * - * Last changed in libpng 1.6.21 [(PENDING RELEASE)] + * Last changed in libpng 1.6.22 [(PENDING RELEASE)] * Copyright (c) 1998-2002,2004,2006-2015 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.) diff --git a/pngread.c b/pngread.c index 614fcd19d..64114ef11 100644 --- a/pngread.c +++ b/pngread.c @@ -3848,16 +3848,16 @@ png_image_read_direct(png_voidp argument) else filler = 255; -# ifdef PNG_FORMAT_AFIRST_SUPPORTED - if ((format & PNG_FORMAT_FLAG_AFIRST) != 0) - { - where = PNG_FILLER_BEFORE; - change &= ~PNG_FORMAT_FLAG_AFIRST; - } +#ifdef PNG_FORMAT_AFIRST_SUPPORTED + if ((format & PNG_FORMAT_FLAG_AFIRST) != 0) + { + where = PNG_FILLER_BEFORE; + change &= ~PNG_FORMAT_FLAG_AFIRST; + } - else -# endif - where = PNG_FILLER_AFTER; + else +#endif + where = PNG_FILLER_AFTER; png_set_add_alpha(png_ptr, filler, where); } @@ -3965,12 +3965,12 @@ png_image_read_direct(png_voidp argument) if (info_ptr->bit_depth == 16) info_format |= PNG_FORMAT_FLAG_LINEAR; -# ifdef PNG_FORMAT_BGR_SUPPORTED - if ((png_ptr->transformations & PNG_BGR) != 0) - info_format |= PNG_FORMAT_FLAG_BGR; -# endif +#ifdef PNG_FORMAT_BGR_SUPPORTED + if ((png_ptr->transformations & PNG_BGR) != 0) + info_format |= PNG_FORMAT_FLAG_BGR; +#endif -# ifdef PNG_FORMAT_AFIRST_SUPPORTED +#ifdef PNG_FORMAT_AFIRST_SUPPORTED if (do_local_background == 2) { if ((format & PNG_FORMAT_FLAG_AFIRST) != 0) diff --git a/pngrtran.c b/pngrtran.c index 845671481..b65abbdef 100644 --- a/pngrtran.c +++ b/pngrtran.c @@ -159,7 +159,7 @@ png_set_background(png_structrp png_ptr, png_set_background_fixed(png_ptr, background_color, background_gamma_code, need_expand, png_fixed(png_ptr, background_gamma, "png_set_background")); } -# endif /* FLOATING_POINT */ +# endif /* FLOATING_POINT */ #endif /* READ_BACKGROUND */ /* Scale 16-bit depth files to 8-bit depth. If both of these are set then the @@ -1915,7 +1915,7 @@ png_init_read_transformations(png_structrp png_ptr) png_ptr->palette[i].blue = (png_byte)component; } } -#endif /* READ_SHIFT */ +#endif /* READ_SHIFT */ } /* Modify the info structure to reflect the transformations. The diff --git a/pngset.c b/pngset.c index 2103fe632..4bd5ab3cb 100644 --- a/pngset.c +++ b/pngset.c @@ -1,7 +1,7 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.6.21 [(PENDING RELEASE)] + * Last changed in libpng 1.6.21 [January 15, 2016] * Copyright (c) 1998-2015 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.) diff --git a/pngtest.c b/pngtest.c index 40a73ffd4..a14db14ba 100644 --- a/pngtest.c +++ b/pngtest.c @@ -2079,4 +2079,4 @@ main(void) #endif /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_22beta03 Your_png_h_is_not_version_1_6_22beta03; +typedef png_libpng_version_1_6_22beta04 Your_png_h_is_not_version_1_6_22beta04; diff --git a/pngwutil.c b/pngwutil.c index aa5bda3c0..494169051 100644 --- a/pngwutil.c +++ b/pngwutil.c @@ -1,7 +1,7 @@ /* pngwutil.c - utilities to write a PNG file * - * Last changed in libpng 1.6.21 [(PENDING RELEASE)] + * Last changed in libpng 1.6.22 [(PENDING RELEASE)] * Copyright (c) 1998-2002,2004,2006-2015 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.) diff --git a/projects/vstudio/README.txt b/projects/vstudio/README.txt index 6919cc07b..8547af489 100644 --- a/projects/vstudio/README.txt +++ b/projects/vstudio/README.txt @@ -1,7 +1,7 @@ VisualStudio instructions -libpng version 1.6.22beta03 - February 8, 2016 +libpng version 1.6.22beta04 - March 9, 2016 Copyright (c) 2010,2013,2015 Glenn Randers-Pehrson diff --git a/projects/vstudio/zlib.props b/projects/vstudio/zlib.props index caf5d9c07..b7d0ab1bd 100644 --- a/projects/vstudio/zlib.props +++ b/projects/vstudio/zlib.props @@ -2,7 +2,7 @@