PNG reference library Changelog

What's new in PNG reference library 1.6.37

Apr 15, 2019
  • This is a public release of libpng, intended for use in production code.

New in PNG reference library 1.6.36 (Dec 3, 2018)

  • Optimized png_do_expand_palette for ARM processors. Improved performance by around 10-22% on a recent ARM Chromebook. (Contributed by Richard Townsend, ARM Holdings)
  • Fixed manipulation of machine-specific optimization options. (Contributed by Vicki Pfau)
  • Used memcpy instead of manual pointer arithmetic on Intel SSE2. (Contributed by Samuel Williams)
  • Fixed build errors with MSVC on ARM64. (Contributed by Zhijie Liang)
  • Fixed detection of libm in CMakeLists. (Contributed by Cameron Cawley)
  • Fixed incorrect creation of pkg-config file in CMakeLists. (Contributed by Kyle Bentley)
  • Fixed the CMake build on Windows MSYS by avoiding symlinks.
  • Fixed a build warning on OpenBSD. (Contributed by Theo Buehler)
  • Fixed various typos in comments. (Contributed by "luz.paz")
  • Raised the minimum required CMake version from 3.0.2 to 3.1.
  • Removed yet more of the vestigial support for pre-ANSI C compilers.
  • Removed ancient makefiles for ancient systems that have been broken across all previous libpng-1.6.x versions.
  • Removed the Y2K compliance statement and the export control information.
  • Applied various code style and documentation fixes.

New in PNG reference library 1.6.35 (Jul 16, 2018)

  • Restored 21 of the contrib/pngsuite/i*.png, which do not cause test failures. Placed the remainder in contrib/pngsuite/interlaced/i*.png. Added calls to png_set_*() transforms commonly used by browsers to the fuzzer.
  • Removed some unnecessary brackets in pngrtran.c
  • Fixed miscellaneous typos (Patch by github user "luzpaz").
  • Change "ASM C" to "C ASM" in CMakeLists.txt
  • Fixed incorrect handling of bKGD chunk in sub-8-bit files (Cosmin)
  • Added hardware optimization directories to zip and 7z distributions.
  • Fixed incorrect bitmask for options.
  • Fixed many spelling typos.
  • Make png_get_iCCP consistent with man page (allow compression-type argument to be NULL, bug report by Lenard Szolnoki).
  • Replaced the remaining uses of png_size_t with size_t (Cosmin)
  • Fixed the calculation of row_factor in png_check_chunk_length (reported by Thuan Pham in SourceForge issue #278)
  • Added missing parentheses to a macro definition (suggested by "irwir" in GitHub issue #216)

New in PNG reference library 1.6.34 (Nov 3, 2017)

  • Removed contrib/pngsuite/i*.png; some of these were incorrect and caused test failures.

New in PNG reference library 1.6.29 (Apr 21, 2017)

  • Readded "include(GNUInstallDirs)" to CMakeLists.txt.
  • Moved SSE2 optimization code into the main libpng source directory.
  • Configure libpng with "configure --enable-intel-sse" or compile libpng with "-DPNG_INTEL_SSE" in CPPFLAGS to enable it.
  • Simplified conditional compilation in pngvalid.c, for AIX.
  • Avoid conditional directives that break statements in pngrutil.c.
  • The contrib/examples/pngtopng.c recovery code was in the wrong "if" branches; the comments were correct.
  • Added code for PowerPC VSX optimisation.
  • Avoid potential overflow of shift operations in png_do_expand().
  • Change test ZLIB_VERNUM >= 0x1281 to ZLIB_VERNUM >= 0x1290 in pngrutil.c because Solaris 11 distributes zlib-1.2.8.f that is older than 1.2.8.1.
  • Suppress clang warnings about implicit sign changes in png.c

New in PNG reference library 1.6.17 (Mar 27, 2015)

  • Removed duplicate PNG_SAFE_LIMITS_SUPPORTED handling from pngconf.h
  • Corrected the width limit calculation in png_check_IHDR().
  • Removed user limits from pngfix. Also pass NULL pointers to png_read_row to skip the unnecessary row de-interlace stuff.
  • Added testing of png_set_packing() to pngvalid.c
  • Regenerated configure scripts in the *.tar distributions with libtool-2.4.4
  • Implement previously untested cases of libpng transforms in pngvalid.c
  • Fixed byte order in 2-byte filler, in png_do_read_filler().
  • Made the check for out-of-range values in png_set_tRNS() detect values that are exactly 2^bit_depth, and work on 16-bit platforms.
  • 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.
  • Do not build png_product2() when it is unused. Display user limits in the output from pngtest.
  • Eliminated the PNG_SAFE_LIMITS macro and restored the 1-million-column and 1-million-row default limits in pnglibconf.dfa, that can be reset by the user at build time or run time.
  • This provides a more robust defense against DOS and as-yet undiscovered overflows.
  • Added PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED macro, on by default.
  • Allow user to call png_get_IHDR() with NULL arguments (Reuben Hawkins).
  • Rebuilt configure scripts with automake-1.15 and libtool-2.4.6
  • Moved png_set_filter() prototype into a PNG_WRITE_SUPPORTED block of png.h.
  • Avoid runtime checks when converting integer to png_byte with Visual Studio
  • Removed some comments that the configure script did not handle properly from scripts/pnglibconf.dfa and pnglibconf.h.prebuilt.
  • Free the unknown_chunks structure even when it contains no data.
  • Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF for consistency, and remove some useless tests
  • Remove pnglibconf.h, pnglibconf.c, pnglibconf.pre, pnglibconf.dfn, and pnglibconf.out instead of pnglibconf.* in "make clean".
  • Fixed simplified 8-bit-linear to sRGB alpha. The calculated alpha value was wrong. It's not clear if this affected the final stored value; in the obvious code path the upper and lower 8-bits of the alpha value were identical and the alpha was truncated to 8-bits rather than dividing by 257

New in PNG reference library 1.7.0 Beta 42 (Nov 25, 2014)

  • The macros passed in the command line to Borland make were ignored if similarly-named macros were already defined in makefiles.
  • This behavior is different from POSIX make and other make programs. Surround the macro definitions with ifndef guards (Cosmin).
  • Added "-D_CRT_SECURE_NO_WARNINGS" to CFLAGS in scripts/makefile.vcwin32.
  • Removed the obsolete $ARCH variable from scripts/makefile.darwin.
  • Merged clang no-warning fix from libpng-1.6.13: png_digit was defined but never used in pngerror.c.

New in PNG reference library 1.6.15 RC 3 (Nov 17, 2014)

  • Added "-D_CRT_SECURE_NO_WARNINGS" to CFLAGS in scripts/makefile.vcwin32. Removed the obsolete $ARCH variable from scripts/makefile.darwin.

New in PNG reference library 1.6.15 RC 2 (Nov 15, 2014)

  • The macros passed in the command line to Borland make were ignored if similarly-named macros were already defined in makefiles.
  • This behavior is different from POSIX make and other make programs. Surround the macro definitions with ifndef guards.

New in PNG reference library 1.6.14 (Oct 23, 2014)

  • Guard usage of png_ptr->options with #ifdef PNG_SET_OPTION_SUPPORTED.
  • Do not build contrib/tools/pngfix.c when PNG_SETJMP_NOT_SUPPORTED, to allow "make" to complete without setjmp support (bug report by Claudio Fontana)
  • Add "#include " to contrib/tools/pngfix.c (John Bowler)
  • Use nanosleep() instead of usleep() in contrib/gregbook/rpng2-x.c because usleep() is deprecated.
  • Define usleep() in contrib/gregbook/rpng2-x.c if not already defined in unistd.h and nanosleep() is not available; fixes error introduced in libpng-1.6.13.
  • Define FE_DIVBYZERO, FE_INVALID, and FE_OVERFLOW in pngvalid.c if not already defined (bug report by "zootus at users.sourceforge.net").
  • Fixed incorrect handling of the iTXt compression flag in pngrutil.c (bug report by Shunsaku Hirata).
  • Bug was introduced in libpng-1.6.0. Added "option READ_iCCP enables READ_COMPRESSED_TEXT" to pnglibconf.dfa
  • Removed unused "text_len" parameter from private function png_write_zTXt().
  • Conditionally compile some code in png_deflate_claim(), when PNG_WARNINGS_SUPPORTED and PNG_ERROR_TEXT_SUPPORTED are disabled.
  • Replaced repeated code in pngpread.c with PNG_PUSH_SAVE_BUFFER_IF_FULL.
  • Added "chunk iTXt enables TEXT" and "chunk zTXt enables TEXT" to pnglibconf.dfa.
  • Removed "option READ_COMPRESSED_TEXT enables READ_TEXT" from pnglibconf.dfa, to make it possible to configure a libpng that supports iCCP but not TEXT.
  • Removed "option WRITE_COMPRESSED_TEXT enables WRITE_TEXT" from pnglibconf.dfa Only mark text chunks as written after successfully writing them.
  • Fixed some typos in comments.
  • Changed png_convert_to_rfc_1123() to png_convert_to_rfc_1123_buffer() in the manual, to reflect the change made in libpng-1.6.0.
  • Updated README file to explain that direct access to the png_struct and info_struct members has not been permitted since libpng-1.5.0.

New in PNG reference library 1.6.14 Beta 3 (Sep 20, 2014)

  • Define FE_DIVBYZERO, FE_INVALID, and FE_OVERFLOW in pngvalid.c if not already defined.
  • Revert floating point exception handling in pngvalid.c to version 1.6.14beta01 behavior.

New in PNG reference library 1.6.14 Beta 2 (Sep 19, 2014)

  • Use nanosleep() instead of usleep() in contrib/gregbook/rpng2-x.c because usleep() is deprecated.
  • Define usleep() in contrib/gregbook/rpng2-x.c if not already defined in unistd.h and nanosleep() is not available; fixes error introduced in libpng-1.6.13.
  • Disable floating point exception handling in pngvalid.c when PNG_FLOATING_ARITHMETIC is not supported

New in PNG reference library 1.6.13 Beta 1 (Jul 5, 2014)

  • Quieted -Wsign-compare and -Wclobber compiler warnings in contrib/pngminus/*.c Added "(void) png_ptr;" where needed in contrib/gregbook to quiet compiler complaints about unused pointers.
  • Split a long output string in contrib/gregbook/rpng2-x.c.
  • Added "PNG_SET_OPTION" requirement for sRGB chunk support to pnglibconf.dfa, Needed for write-only support (John Bowler).
  • Changed "if defined(__ARM_NEON__)" to "if (defined(__ARM_NEON__) || defined(__ARM_NEON))" (James Wu).
  • Fixed clang no-warning builds: png_digit was defined but never used.

New in PNG reference library 1.6.12 (Jun 12, 2014)

  • Changes:
  • Relocated new code from 1.6.11 in png.c to a point after the declarations (Max Stepin).
  • Changed file permissions of contrib/tools/intgamma.sh, test-driver, and compile from 0644 to 0755 (Cosmin).
  • Ensure "__has_attribute()" macro exists before trying to use it with old clang compilers (MacPorts Ticket #43939).

New in PNG reference library 1.6.11 (Jun 6, 2014)

  • Changes:
  • Use "if (value != 0)" instead of "if (value)" consistently.
  • Changed ZlibSrcDir from 1.2.5 to 1.2.8 in projects/vstudio.
  • Moved configuration information from the manual to the INSTALL file.
  • Removed #if/#else/#endif from inside two pow() calls in pngvalid.c because they were handled improperly by Portland Group's PGI-14.1 - PGI-14.3 when using its "__builtin_pow()" function.
  • Silence 'unused parameter' build warnings.
  • $(CP) is now used alongside $(RM_F). Also, use 'copy' instead of 'cp' where applicable, and applied other minor makefile changes .
  • Don't warn about invalid dimensions exceeding user limits.
  • Allow an easy replacement of the default pre-built configuration header with a custom header, via the make PNGLIBCONF_H_PREBUILT macro .
  • Fixed a typo in pngrutil.c, introduced in libpng-1.5.6, that interferes with "blocky" expansion of sub-8-bit interlaced PNG files.
  • Made progressive reading of interlaced images consistent with the behavior of the sequential reader and consistent with the manual, by moving some code out of the PNG_READ_INTERLACING_SUPPORTED blocks. The row_callback now receives the proper pass number and unexpanded rows, when png_combine_row() isn't built or used, and png_set_interlace_handling() is not called.
  • Allow PNG_sRGB_PROFILE_CHECKING = (-1) to mean no sRGB profile checking.
  • Do not reject ICC V2 profiles that lack padding (Kai-Uwe Behrmann).
  • Relocated closing bracket of the sRGB profile test loop to avoid getting "Not recognizing known sRGB profile that has been edited" warning for ICC V2 profiles that lack the MD5 signature in the profile header.
  • Added PNG_SKIP_sRGB_CHECK_PROFILE choice for png_set_option().
  • Test ZLIB_VERNUM instead of PNG_ZLIB_VERNUM in contrib/tools/pngfix.c

New in PNG reference library 1.6.11 Beta 6 (May 20, 2014)

  • Added PNG_SKIP_sRGB_CHECK_PROFILE choice for png_set_option().

New in PNG reference library 1.6.11 Beta 5 (Apr 28, 2014)

  • Do not reject ICC V2 profiles that lack padding (Kai-Uwe Behrmann).
  • Relocated closing bracket of the sRGB profile test loop to avoid getting "Not recognizing known sRGB profile that has been edited" warning for ICC V2 profiles that lack the MD5 signature in the profile header.

New in PNG reference library 1.6.11 Beta 4 (Apr 28, 2014)

  • Made progressive reading of interlaced images consistent with the behavior of the sequential reader and consistent with the manual, by moving some code out of the PNG_READ_INTERLACING_SUPPORTED blocks.
  • The row_callback now receives the proper pass number and unexpanded rows, when png_combine_row is not used or not built, Allow PNG_sRGB_PROFILE_CHECKING = (-1) to mean no sRGB profile checking.

New in PNG reference library 1.6.11 Beta 3 (Apr 28, 2014)

  • Fixed a typo in pngrutil.c, introduced in libpng-1.5.6, that interferes with "blocky" expansion of sub-8-bit interlaced PNG files (Eric Huss).

New in PNG reference library 1.6.11 Beta 2 (Apr 28, 2014)

  • Removed #if/#else/#endif from inside two pow() calls in pngvalid.c because they were handled improperly by Portland Group's PGI-14.1 - PGI-14.3 when using its "__builtin_pow()" function.
  • Silence 'unused parameter' build warnings (Cosmin). $(CP) is now used alongside $(RM_F). Also, use 'copy' instead of 'cp' where applicable, and applied other minor makefile changes.
  • Don't warn about invalid dimensions exceeding user limits. Allow an easy replacement of the default pre-built configuration header with a custom header, via the make PNGLIBCONF_H_PREBUILT macro.

New in PNG reference library 1.6.11 Beta 1 (Apr 28, 2014)

  • Use "if (value != 0)" instead of "if (value)" consistently. Changed ZlibSrcDir from 1.2.5 to 1.2.8 in projects/vstudio. Moved configuration information from the manual to the INSTALL file.

New in PNG reference library 1.6.10 (Apr 28, 2014)

  • Fixed a large number of instances where PNGCBAPI was omitted from function definitions.
  • Added pngimage test program for png_read_png() and png_write_png() with two new test scripts.
  • Removed dependence on !PNG_READ_EXPAND_SUPPORTED for calling png_set_packing() in png_read_png().
  • Fixed combination of ~alpha with shift. On read invert alpha, processing occurred after shift processing, which causes the final values to be outside the range that should be produced by the shift. Reversing the order on read makes the two transforms work together correctly and mirrors the order used on write.
  • Do not read invalid sBIT chunks. Previously libpng only checked sBIT values on write, so a malicious PNG writer could therefore cause the read code to return an invalid sBIT chunk, which might lead to application errors or crashes. Such chunks are now skipped (with chunk_benign_error).
  • Make png_read_png() and png_write_png() prototypes in png.h depend upon PNG_READ_SUPPORTED and PNG_WRITE_SUPPORTED.
  • Support builds with unsupported PNG_TRANSFORM_* values. All of the PNG_TRANSFORM_* values are always defined in png.h and, because they are used for both read and write in some cases, it is not reliable to #if out ones that are totally unsupported. This change adds error detection in png_read_image() and png_write_image() to do a png_app_error() if the app requests something that cannot be done and it adds corresponding code to pngimage.c to handle such options by not attempting to test them.
  • Moved redefines of png_error(), png_warning(), png_chunk_error(), and png_chunk_warning() from pngpriv.h to png.h to make them visible to libpng-calling applications.
  • Moved OS dependent code from arm/arm_init.c, to allow the included implementation of the ARM NEON discovery function to be set at build-time and provide sample implementations from the current code in the contrib/arm-neon subdirectory. The __linux__ code has also been changed to compile and link on Android by using /proc/cpuinfo, and the old linux code is in contrib/arm-neon/linux-auxv.c. The new code avoids POSIX and Linux dependencies apart from opening /proc/cpuinfo and is C90 compliant.
  • Check for info_ptr == NULL early in png_read_end() so we don't need to run all the png_handle_*() and depend on them to return if info_ptr == NULL. This improves the performance of png_read_end(png_ptr, NULL) and makes it more robust against future programming errors. Check for __has_extension before using it in pngconf.h, to support older Clang versions (Jeremy Sequoia).
  • Treat CRC error handling with png_set_crc_action(), instead of with png_set_benign_errors(), which has been the case since libpng-1.6.0beta18.
  • Use a user warning handler in contrib/gregbook/readpng2.c instead of default, so warnings will be put on stderr even if libpng has CONSOLE_IO disabled.
  • Added png_ptr->process_mode = PNG_READ_IDAT_MODE in png_push_read_chunk after recognizing the IDAT chunk, which avoids an infinite loop while reading a datastream whose first IDAT chunk is of zero-length. This fixes CERT VU#684412 and CVE-2014-0333.
  • Don't recognize known sRGB profiles as sRGB if they have been hacked, but don't reject them and don't issue a copyright violation warning.
  • Moved some documentation from png.h to libpng.3 and libpng-manual.txt
  • Minor editing of contrib/arm-neon/README and contrib/examples/*.c
  • Fixed typos in the manual and in scripts/pnglibconf.dfa (CFLAGS -> CPPFLAGS and PNG_USR_CONFIG -> PNG_USER_CONFIG).
  • Un-deprecated png_data_freer().

New in PNG reference library 1.6.10 Beta 2 (Mar 3, 2014)

  • Moved redefines of png_error(), png_warning(), png_chunk_error(), and png_chunk_warning() from pngpriv.h to png.h to make them visible to libpng calling applications.
  • Check for info_ptr == NULL early in png_read_end() so we don't need to run all the png_handle_*() and depend on them to return if info_ptr == NULL.
  • This improves the performance of png_read_end(png_ptr, NULL) and makes it more robust against future programming errors.
  • Check for __has_extension before using it in pngconf.h, to support older Clang versions (Jeremy Sequoia).
  • Treat CRC error handling with png_set_crc_action(), instead of with png_set_benign_errors(), which has been the case since libpng-

New in PNG reference library 1.6.9 (Feb 7, 2014)

  • Bookkeeping: Moved functions around (no changes). Moved transform function definitions before the place where they are called so that they can be masde static. Move the intrapixel functions and the grayscale palette builder out of the png?tran.c files. The latter isn't a transform function and is no longer used internally, and the former MNG specific functions are better placed in pngread/pngwrite.c
  • Made transform implementation functions static. This makes the internal functions called by png_do_{read|write}_transformations static. On an x86-64 DLL build (Gentoo Linux) this reduces the size of the text segment of the DLL by 1208 bytes, about 0.6%. It also simplifies maintenance by removing the declarations from pngpriv.h and allowing easier changes to the internal interfaces.
  • Rebuilt configure scripts with automake-1.14.1 and autoconf-2.69 in the tar distributions.
  • Added checks for libpng 1.5 to pngvalid.c. This supports the use of this version of pngvalid in libpng 1.5
  • Merged with pngvalid.c from libpng-1.7 changes to create a single pngvalid.c
  • Removed #error macro from contrib/tools/pngfix.c (Thomas Klausner).
  • Merged pngrio.c, pngtrans.c, pngwio.c, and pngerror.c with libpng-1.7.0
  • Merged libpng-1.7.0 changes to make no-interlace configurations work with test programs.
  • Revised pngvalid.c to support libpng 1.5, which does not support the PNG_MAXIMUM_INFLATE_WINDOW option, so #define it out when appropriate in pngvalid.c
  • Allow unversioned links created on install to be disabled in configure. In configure builds 'make install' changes/adds links like png.h and libpng.a to point to the newly installed, versioned, files (e.g. libpng17/png.h and libpng17.a). Three new configure options and some rearrangement of Makefile.am allow creation of these links to be disabled.
  • Removed potentially misleading warning from png_check_IHDR().
  • Updated scripts/makefile.* to use CPPFLAGS (Cosmin).
  • Added clang attribute support (Cosmin).
  • Quiet an uninitialized memory warning from VC2013 in png_get_png().

New in PNG reference library 1.6.4 Beta 2 (Sep 12, 2013)

  • Fixed inconsistent conditional compilation of png_chunk_unknown_handling() prototype, definition, and usage. Made it depend on PNG_HANDLE_AS_UNKNOWN_SUPPORTED everywhere.

New in PNG reference library 1.6.4 Beta 1 (Sep 12, 2013)

  • Added information about png_set_options() to the manual.
  • Delay calling png_init_filter_functions() until a row with nonzero filter is found.

New in PNG reference library 1.7.0 Beta 16 (Jul 25, 2013)

  • Revised example.c to illustrate use of PNG_DEFAULT_sRGB and PNG_GAMMA_MAC_18 as parameters for png_set_gamma(). These have been available since libpng-1.5.4.
  • Renamed contrib/tools/png-fix-too-far-back.c to pngfix.c and revised it to check all compressed chunks known to libpng.
  • Updated documentation to show default behavior of benign errors correctly.
  • Added perfect hash code generation for lists of PNG chunks. This is a work in progress; checked in for use in pngfix.c
  • Ported ARM no-read patch from libpng16.
  • Ported pngfix.c patches from libpng16.

New in PNG reference library 1.7.0 Beta 15 (Jul 25, 2013)

  • Revised libpng.3 so that "doclifter" can process it.

New in PNG reference library 1.7.0 Beta 14 (Jul 25, 2013)

  • Removed a redundant test in png_set_IHDR().
  • Added set(CMAKE_CONFIGURATION_TYPES ...) to CMakeLists.txt
  • Deleted set(CMAKE_BUILD_TYPE) block from CMakeLists.txt
  • Enclose the prototypes for the simplified write API in #ifdef STDIO/#endif
  • Make ARM NEON support work at compile time (not just configure time). This moves the test on __ARM_NEON__ into pngconf.h to avoid issues when using a compiler that compiles for multiple architectures at one time.
  • Removed PNG_FILTER_OPTIMIZATIONS and PNG_ARM_NEON_SUPPORTED from pnglibconf.h, allowing more of the decisions to be made internally (pngpriv.h) during the compile. Without this, symbol prefixing is broken under certain circumstances on ARM platforms. Now only the API parts of the optimizations ('check' vs 'api') are exposed in the public header files except that the new setting PNG_ARM_NEON_OPT documents how libpng makes the decision about whether or not to use the optimizations.
  • Protect symbol prefixing against CC/CPPFLAGS/CFLAGS useage. Previous iOS/Xcode fixes for the ARM NEON optimizations moved the test on __ARM_NEON__ from configure time to compile time. This breaks symbol prefixing because the definition of the special png_init_filter_functions call was hidden at configure time if the relevant compiler arguments are passed in CFLAGS as opposed to CC. This change attempts to avoid all the confusion that would result by declaring the init function even when it is not used, so that it will always get prefixed.

New in PNG reference library 1.6.3 (Jul 25, 2013)

  • Revised stack marking in arm/filter_neon.S and configure.ac.
  • Ensure that NEON filter stuff is completely disabled when switched 'off'. Previously the ARM NEON specific files were still built if the option was switched 'off' as opposed to being explicitly disabled.
  • Test for 'arm*' not just 'arm' in the host_cpu configure variable. Rebuilt the configure scripts.
  • Expanded manual paragraph about writing private chunks, particularly the need to call png_set_keep_unknown_chunks() when writing them.
  • Avoid dereferencing NULL pointer possibly returned from png_create_write_struct().
  • Calculate our own zlib windowBits when decoding rather than trusting the CMF bytes in the PNG datastream.
  • Added an option to force maximum window size for inflating, which was the behavior of libpng15 and earlier.
  • Added png-fix-itxt and png-fix-too-far-back to the built programs and removed warnings from the source code and timepng that are revealed as a result.
  • Detect wrong libpng versions linked to png-fix-too-far-back, which currently only works with libpng versions that can be made to reliably fail when the deflate data contains an out-of-window reference. This means only 1.6 and later.
  • Fixed gnu issues: g++ needs a static_cast, gcc 4.4.7 has a broken warning message which it is easier to work round than ignore.
  • Updated contrib/pngminus/pnm2png.c: Check for EOF Ignore "#" delimited comments in input file to pnm2png.c.
  • Fixed whitespace handling Added a call to png_set_packing() Initialize dimension values so if sscanf fails at least we have known invalid values. Attempt to detect configuration issues with png-fix-too-far-back, which requires both the correct libpng and the correct zlib to function correctly.
  • Check ZLIB_VERNUM for mismatches, enclose #error in quotes
  • Added information in the documentation about problems with and fixes for the bad CRC and bad iTXt chunk situations.

New in PNG reference library 1.7.0 Beta 13 (May 21, 2013)

  • Revised contrib/pngminim/*/makefile to generate pnglibconf.h with the right zlib header files.
  • Separated CPPFLAGS and CFLAGS in contrib/pngminim/*/makefile
  • Updated contrib/pngminus/pnm2png.c: Check for EOF Ignore "#" delimited comments in input file to pnm2png.c.
  • Fixed whitespace handling
  • Added a call to png_set_packing() Initialize dimension values so if sscanf fails at least we have known invalid values.
  • Calculate our own zlib windowBits when decoding rather than trusting the CMF bytes in the PNG datastream.
  • Added an option to force maximum window size for inflating, which was the behavior of libpng15 and earlier.
  • Added png-fix-itxt and png-fix-too-far-back to the built programs and removed warnings from the source code and timepng that are revealed as a result.
  • Detect wrong libpng versions linked to png-fix-too-far-back, which currently only works with libpng versions that can be made to reliably fail when the deflate data contains an out-of-window reference. This means only 1.6 and later.
  • Attempt to detect configuration issues with png-fix-too-far-back, which requires both the correct libpng and the correct zlib to function correctly.
  • Check ZLIB_VERNUM for mismatches, enclose #error in quotes
  • Added information in the documentation about problems with and fixes for the bad CRC and bad iTXt chunk situations.

New in PNG reference library 1.6.3 Beta 6 (May 21, 2013)

  • Allow contrib/pngminus/pnm2png.c to compile without WRITE_INVERT and WRITE_PACK supported (writes error message that it can't read P1 or
  • Improved png-fix-too-far-back usage message, added --suffix option.
  • Revised contrib/pngminim/*/makefile to generate pnglibconf.h with the right zlib header files.
  • Separated CPPFLAGS and CFLAGS in contrib/pngminim/*/makefile

New in PNG reference library 1.6.3 Beta 2 (Apr 27, 2013)

  • Test for 'arm*' not just 'arm' in the host_cpu configure variable. Rebuilt the configure scripts.

New in PNG reference library 1.7.0 Beta 10 (Apr 26, 2013)

  • Attempt to fix the PNG_ARM_NEON configuration mess.

New in PNG reference library 1.6.3 Beta 1 (Apr 26, 2013)

  • Revised stack marking in arm/filter_neon.S and configure.ac.
  • Ensure that NEON filter stuff is completely disabled when switched 'off'.
  • Previously the ARM NEON specific files were still built if the option was switched 'off' as opposed to being explicitly disabled.

New in PNG reference library 1.6.2 (Apr 26, 2013)

  • Updated documentation of 1.5.x to 1.6.x changes in iCCP chunk handling. Fixed incorrect warning of excess deflate data.
  • End condition - the warning would be produced if the end of the deflate stream wasn't read in the last row. The warning is harmless.
  • Corrected the test on user transform changes on read. It was in the png_set of the transform function, but that doesn't matter unless the transform function changes the rowbuf size, and that is only valid if transform_info is called.
  • Corrected a misplaced closing bracket in contrib/libtests/pngvalid.c.
  • Corrected length written to uncompressed iTXt chunks.
  • Added contrib/tools/fixitxt.c, to repair the erroneous iTXt chunk length written by libpng-1.6.0 and 1.6.1.
  • Disallow storing sRGB information when the sRGB is not supported.
  • Merge pngtest.c with libpng-1.7.0

New in PNG reference library 1.7.0 Beta 7 (Apr 18, 2013)

  • Updated documentation of 1.5.x to 1.6.x changes in iCCP chunk handling.
  • Fixed incorrect warning of excess deflate data. End condition - the warning would be produced if the end of the deflate stream wasn't read in the last row. The warning is harmless.
  • Corrected the test on user transform changes on read. It was in the png_set of the transform function, but that doesn't matter unless the transform function changes the rowbuf size, and that is only valid if transform_info is called.
  • Corrected a misplaced closing bracket in contrib/libtests/pngvalid.c.
  • Corrected length written to uncompressed iTXt chunks.

New in PNG reference library 1.6.2 RC 01 (Apr 18, 2013)

  • Added contrib/tools/fixitxt.c, to repair the erroneous iTXt chunks.
  • Disallow storing sRGB information when the sRGB is not supported.

New in PNG reference library 1.6.1 (Mar 29, 2013)

  • Made symbol prefixing work with the ARM neon optimizations. Also allow pngpriv.h to be included for preprocessor definitions only, so it can be used in non-C/C++ files.
  • Back ported from libpng 1.7.
  • Made sRGB check numbers consistent.
  • Ported libpng 1.5 options.awk/dfn file handling to 1.6, fixed one bug.
  • Removed cc -E workround, corrected png_get_palette_max API Tested on SUN OS cc 5.9, which demonstrates the tokenization problem previously avoided by using /lib/cpp. Since all .dfn output is now protected in double quotes unless it is to be macro substituted the fix should work everywhere.
  • Enabled parallel tests - back ported from libpng-1.7. scripts/pnglibconf.dfa formatting improvements back ported from libpng17.
  • Fixed a race condition in the creation of the build 'scripts' directory while building with a parallel make.
  • Use approved/supported Android method to check for NEON, use Linux/POSIX 1003.1 API to check /proc/self/auxv avoiding buffer allocation and other library calls (ported from libpng15). Use parentheses more consistently in "#if defined(MACRO)" tests.
  • Folded long lines.
  • Reenabled code to allow zero length PLTE chunks for MNG. Fixed ALIGNED_MEMORY support.
  • Allow run-time ARM NEON checking to be disabled.
  • A new configure option: --enable-arm-neon=always will stop the run-time checks.
  • New checks within arm/arm_init.c will cause the code not to be compiled unless __ARM_NEON__ is set. This should make it fail safe (if someone asks for it on then the build will fail if it can't be done.)
  • Updated the INSTALL document.
  • Revised INSTALL to recommend using CPPFLAGS instead of INCLUDES. Revised scripts/makefile.freebsd to respect ZLIBLIB and ZLIBINC.
  • Revised scripts/dfn.awk to work with the buggy MSYS awk that has trouble with CRLF line endings.
  • Avoid a possible memory leak in contrib/gregbook/readpng.c
  • Better documentation of unknown handling API interactions.
  • Corrected Android builds and corrected libpng.vers with symbol prefixing This adds an API to set optimization options externally, providing an alternative and general solution for the non-portable run-time tests used by the ARM Neon code. It also makes those tests compile and link on Android.
  • The order of settings vs options in pnglibconf.h is reversed to allow settings to depend on options and options can now set (or override) the defaults for settings.
  • Corrected simplified API default gamma for color-mapped output, added a flag to change default. In 1.6.0 when the simplified API was used to produce color-mapped output from an input image with no gamma information the gamma assumed for the input could be different from that assumed for non-color-mapped output. In particular 16-bit depth input files were assumed to be sRGB encoded, whereas in the 'direct' case they were assumed to have linear data. This was an error. The fix makes the simplified API treat all input files the same way and adds a new flag to the png_image::flags member to allow the application/user to specify that 16-bit files contain sRGB data rather than the default linear.
  • Fixed bugs in the pngpixel and makepng test programs.
  • Fixed CMakelists.txt to allow building a single variant of the library
  • Introduced a PNG_LIB_TARGETS variable that lists all activated library targets. It is an error if this variable ends up empty, ie. you have to build at least one library variant.
  • Made the *_COPY targets only depend on library targets actually being build. Use PNG_LIB_TARGETS to unify a code path.
  • Changed the CREATE_SYMLINK macro to expect the full path to a file as the first argument. When symlinking the filename component of that path is determined and used as the link target. Use copy_if_different in the CREATE_SYMLINK macro.
  • Eliminated two warnings from the Intel C compiler. The warnings are technically valid, although a reasonable treatment of division would show it to be incorrect.

New in PNG reference library 1.7.0 Beta 6 (Mar 14, 2013)

  • Corrected simplified API default gamma for color-mapped output, added a flag to change default. In 1.6.0 when the simplified API was used to produce color-mapped output from an input image with no gamma information the gamma assumed for the input could be different from that assumed for non-color-mapped output. In particular 16-bit depth input files were assumed to be sRGB encoded, whereas in the 'direct' case they were assumed to have linear data. This was an error. The fix makes the simplified API treat all input files the same way and adds a new flag to the png_image::flags member to allow the application/user to specify that 16-bit files contain sRGB data rather than the default linear.
  • Fixed bugs in the pngpixel and makepng test programs.
  • Fixed CMakelists.txt to allow building a single variant of the library
  • Introduced a PNG_LIB_TARGETS variable that lists all activated library targets. It is an error if this variable ends up empty, ie. you have to build at least one library variant. Made the *_COPY targets only depend on library targets actually being build.
  • Use PNG_LIB_TARGETS to unify a code path.
  • Changed the CREATE_SYMLINK macro to expect the full path to a file as the first argument. When symlinking the filename component of that path is determined and used as the link target.
  • Use copy_if_different in the CREATE_SYMLINK macro.
  • Eliminated two warnings from the Intel C compiler. The warnings are technically valid, although a reasonable treatment of division would show it to be incorrect.

New in PNG reference library 1.7.0 Beta 5 (Mar 5, 2013)

  • Avoid a possible memory leak in contrib/gregbook/readpng.c
  • Changed user chunk callback API to respect global and per chunk defaults. Previously a return of 0 from a user chunk callback would result in the chunk being saved (if this was safe, even if the chunk was unsafe-to-copy); this change respects the defaults set by the application, so unknown chunks can be discarded by default and known-safe ones preserved.
  • Corrected Android builds and corrected libpng.vers with symbol prefixing. This adds an API to set optimization options externally, providing an alternative and general solution for the non-portable run-time tests used by the ARM Neon code. It also makes those tests compile and link on Android. The order of settings vs options in pnglibconf.h is reversed to allow settings to depend on options and options can now set (or override) the defaults for settings.

New in PNG reference library 1.7.0 Beta 4 (Mar 1, 2013)

  • Revised INSTALL to recommend using CPPFLAGS instead of INCLUDES.
  • Revised scripts/makefile.freebsd to respect ZLIBDIR and ZLIBINC.
  • Revised scripts/dfn.awk to work with the buggy MSYS awk that has trouble with CRLF line endings.

New in PNG reference library 1.7.0 Beta 3 (Feb 27, 2013)

  • Reenabled code to allow zero length PLTE chunks for MNG.
  • Fixed ALIGNED_MEMORY support.
  • Allow run-time ARM NEON checking to be disabled. A new configure option: --enable-arm-neon=always will stop the run-time checks. New checks within arm/arm_init.c will cause the code not to be compiled unless __ARM_NEON__ is set. This should make it fail safe (if someone asks for it on then the build will fail if it can't be done.)
  • Updated the INSTALL document.

New in PNG reference library 1.7.0 Beta 2 (Feb 20, 2013)

  • Fixed a race condition in the creation of the build 'scripts' directory while building with a parallel make.
  • Use approved/supported Android method to check for NEON, use Linux/POSIX 1003.1 API to check /proc/self/auxv avoiding buffer allocation and other library calls (ported from libpng15).
  • Use parentheses more consistently in "#if defined(MACRO)" tests.
  • Folded long lines.

New in PNG reference library 1.7.0 Beta 1 (Feb 18, 2013)

  • Enable parallel tests and rearrange TESTS order to take advantage of the massive speed improvements use a make capable of parallel builds on a multi-CPU machine and pass the right arguments to make (-j10000 for GNU make) to get the build to run in parallel.
  • Fixed previous support for Z_PREFIX in configure builds, corrected sCAL APIs; some of these use floating point arithmetic so need to be disabled if floating point arithmetic is switched off.
  • This is a quiet API change - previously it appeared that the APIs were supported if fixed point arithmetic was used internally, however they required certain APIs (floor, modf, frexp, atof) that are part of C floating point support.
  • Changed png_fixed and the gamma code specific version of the same to avoid floor(), which may be a library function (not an intrinsic).
  • Removed unused #if 0 code.
  • Fixed make distcheck to skip over the test result files. They were being included because the whole of the 'tests' directory is included, fixed to just include the actual test files and tests/pngstest.
  • Also reverted the previous erroneous change to remove the ${srcdir} from the front of contrib, scripts, projects and added an explanation of what is going on to Makefile.am
  • Fixed missing dependency in --prefix builds. The intermediate internal 'prefix.h' file can only be generated correctly after pnglibconf.h, however the dependency was not in Makefile.am.
  • The symptoms are unpredictable depending on the order make chooses to build pngprefix.h and pnglibconf.h, often the error goes unnoticed because there is a system pnglibconf.h to use instead. Accept "," as a separator in pnglibconf.dfa and allow for continuation lines.
  • This adds to the syntax of "option" and "chunk" lines, allowing the elements to be separated by a "," at the end of an element and interpreting a "," at end of line as a continuation - so the following line is read. The new syntax is optional and solely provided for readability.
  • Enclosed the new png_get_palette_max in #ifdef PNG_GET_PALETTE_MAX_SUPPORTED block, and revised pnglibconf.h and pnglibconf.h.prebuilt accordingly.

New in PNG reference library 1.6.0 (Feb 14, 2013)

  • Removed machine-generated configure files from the GIT repository (they will continue to appear in the tarball distributions and in the libpng15 and earlier GIT branches).
  • Restored the new 'simplified' API, which was started in libpng-1.5.7beta02 but later deleted from libpng-1.5.7beta05.
  • Added example programs and test program pngstest for the new 'simplified' API.
  • Added ANSI-C (C90) headers and require them, and take advantage of the change.
  • Also fixed some of the projects/* and contrib/* files that needed updates for libpng16 and the move of pngvalid.c. With this change the required ANSI-C header files are assumed to exist: the implementation must provide float.h, limits.h, stdarg.h and stddef.h and libpng relies on limits.h and stddef.h existing and behaving as defined (the other two required headers aren't used).
  • Non-ANSI systems that don't have stddef.h or limits.h will have to provide an appropriate fake containing the relevant types and #defines.
  • The use of FAR/far has been eliminated and the definition of png_alloc_size_t is now controlled by a flag so that 'small size_t' systems can select it if necessary.
  • Libpng 1.6 may not currently work on such systems -- it seems likely that it will ask 'malloc' for more than 65535 bytes with any image that has a sufficiently large row size (rather than simply failing to read such images). New tools directory containing tools used to generate libpng code.
  • Fixed race conditions in parallel make builds. With higher degrees of parallelism during 'make' the use of the same temporary file names such as 'dfn*' can result in a race where a temporary file from one arm of the build is deleted or overwritten in another arm. This changes the temporary files for suffix rules to always use $* and ensures that the non-suffix rules use unique file names.
  • Correct configure builds where build and source directories are separate. The include path of 'config.h' was erroneously made relative in pngvalid.c in libpng 1.5.7. Start-up code size improvements, error handler flexibility.
  • These changes alter how the tricky allocation of the initial png_struct and png_info structures are handled. png_info is now handled in pretty much the same way as everything else, except that the allocations handle NULL return silently. png_struct is changed in a similar way on allocation and on deallocation a 'safety' error handler is put in place (which should never be required).
  • The error handler itself is changed to permit mismatches in the application and libpng error buffer size; however, this means a silent change to the API to return the jmp_buf if the size doesn't match the size from the libpng compilation; libpng now allocates the memory and this may fail.
  • Overall these changes result in slight code size reductions; however, this is a reduction in code that is always executed so is particularly valuable.
  • Overall on a 64-bit system the libpng DLL decreases in code size by 1733 bytes. pngerror.o increases in size by about 465 bytes because of the new functionality.
  • Added png_convert_to_rfc1123_buffer() and deprecated png_convert_to_rfc1123() to avoid including a spurious buffer in the png_struct. Regenerated configure scripts with automake-1.11.2 Eliminated png_info_destroy(). It is now used only in png.c and only calls one other internal function and memset(). Enabled png_get_sCAL_fixed() if floating point APIs are enabled.
  • Previously it was disabled whenever internal fixed point arithmetic was selected, which meant it didn't exist even on systems where FP was available but not preferred.
  • Added pngvalid.c compile time checks for const APIs. Implemented 'restrict' for png_info and png_struct.
  • Because of the way libpng works both png_info and png_struct are always accessed via a single pointer. This means adding C99 'restrict' to the pointer gives the compiler some opportunity to optimize the code. This change allows that.
  • Moved AC_MSG_CHECKING([if libraries can be versioned]) later to the proper location in configure.ac.
  • Changed png_memcpy to C assignment where appropriate.
  • Changed all those uses of png_memcpy that were doing a simple assignment to assignments (all those cases where the thing being copied is a non-array C L-value).
  • Added some error checking to png_set_*() routines.
  • Removed the reference to the non-exported function png_memcpy() from example.c.
  • Fixed the Visual C 64-bit build - it requires jmp_buf to be aligned, but it had become misaligned. Revised contrib/pngminus/pnm2png.c to avoid warnings when png_uint_32 and unsigned long are of different sizes.
  • Updated manual with description of the simplified API.
  • Fix bug in pngerror.c: some long warnings were being improperly truncated (CVE-2011-3464, bug introduced in libpng-1.5.4).
  • Increased the formatted warning buffer to 192 bytes.
  • Fixed Min/GW uninstall to remove libpng.dll.a
  • Eliminated Intel icc/icl compiler warnings.
  • The Intel (GCC derived) compiler issues slightly different warnings from those issued by the current versions of GCC.
  • This eliminates those warnings by adding/removing casts and small code rewrites. Updated configure.ac from autoupdate: added --enable-werror option.
  • Also some layout regularization and removal of introduced tab characters (replaced with 3-character indentation).
  • Obsolete macros identified by autoupdate have been removed; the replacements are all in 2.59 so the pre-req hasn't been changed. --enable-werror checks for support for -Werror (or the given argument) in the compiler.
  • This mimics the gcc configure option by allowing -Werror to be turned on safely; without the option the tests written in configure itself fail compilation because they cause compiler warnings.
  • Rewrote autogen.sh to run autoreconf instead of running tools one-by-one.
  • Conditionalize the install rules for MINGW and CYGWIN in CMakeLists.txt and set CMAKE_LIBRARY_OUTPUT_DIRECTORY to "lib" on all platforms (C. Yapp). Freeze libtool files in the 'scripts' directory.
  • This version of autogen.sh attempts to dissuade people from running it when it is not, or should not, be necessary. In fact, autogen.sh does not work when run in a libpng directory extracted from a tar distribution anymore. You must run it in a GIT clone instead.
  • Added two images to contrib/pngsuite (1-bit and 2-bit transparent grayscale), and renamed three whose names were inconsistent with those in pngsuite/README.txt.
  • Check libtool/libtoolize version number (2.4.2) in configure.ac
  • Moved automake options to AM_INIT_AUTOMAKE in configure.ac
  • Added color-tests, silent-rules (Not yet implemented in Makefile.am) and version checking to configure.ac Cleaned up pngpriv.h to consistently declare all functions and data.
  • Also eliminated PNG_CONST_DATA, which is apparently not needed but we can't be sure until it is gone.
  • Added symbol prefixing that allows all the libpng external symbols to be prefixed. Updated "ftbb*.png" list in the owatcom and vstudio projects.
  • Added Z_SOLO for zlib-1.2.6+ and correct pngstest tests
  • Revised INSTALL information about autogen.sh. Updated list of test images in CMakeLists.txt Corrected estimate of error in libpng png_set_rgb_to_gray API.
  • The API is extremely inaccurate for sRGB conversions because it uses an 8-bit intermediate linear value and it does not use the sRGB transform, so it suffers from the known instability in gamma transforms for values close to 0 (see Poynton).
  • The net result is that the calculation has a maximum error of 14.99/255; 0.5/255^(1/2.2). pngstest now uses 15 for the permitted 8-bit error.
  • This may still not be enough because of arithmetic error. Removed some unused arrays (with #ifdef) from png_read_push_finish_row(). Fixed a memory overwrite bug in simplified read of RGB PNG with non-linear gamma
  • Also bugs in the error checking in pngread.c and changed quite a lot of the checks in pngstest.c to be correct; either correctly written or not over-optimistic.
  • The pngstest changes are insufficient to allow all possible RGB transforms to be passed; pngstest cmppixel needs to be rewritten to make it clearer which errors it allows and then changed to permit known inaccuracies.
  • Removed tests for no-longer-used *_EMPTY_PLTE_SUPPORTED from pngstruct.h
  • Fixed fixed/float API export conditionals. 1) If FIXED_POINT or FLOATING_POINT options were switched off, png.h ended up with lone ';' characters.
  • This is not valid ANSI-C outside a function. The ';' characters have been moved inside the definition of PNG_FP_EXPORT and PNG_FIXED_EXPORT. 2) If either option was switched off, the declaration of the corresponding functions were completely omitted, even though some of them are still used internally.
  • The result is still valid, but produces warnings from gcc with some warning options (including -Wall).
  • The fix is to cause png.h to declare the functions with PNG_INTERNAL_FUNCTION when png.h is included from pngpriv.h. Check for invalid palette index while reading paletted PNG.
  • When one is found, issue a warning.
  • Fixed CVE-2011-3026 buffer overrun bug. Deal more correctly with the test on iCCP chunk length.
  • Also removed spurious casts that may hide problems on 16-bit systems.
  • Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c; now that png_ptr->buffer is inaccessible to applications, the special handling is no longer useful.
  • Added PNG_SAFE_LIMITS feature to pnglibconf.dfa, pngpriv.h, and new pngusr.dfa to reset the user limits to safe ones if PNG_SAFE_LIMITS is defined.
  • To enable, use "CPPFLAGS=-DPNG_SAFE_LIMITS_SUPPORTED=1" on the configure command or put #define PNG_SAFE_LIMITS_SUPPORTED in pnglibconf.h.prebuilt and pnglibconf.h.
  • Added information about the new limits in the manual.
  • Removed unused "current_text" members of png_struct and the png_free() of png_ptr->current_text from pngread.c
  • Added PNG_IMAGE_FLAG_FAST for the benefit of applications that store intermediate files, or intermediate in-memory data, while processing image data with the simplified API.
  • The option makes the files larger but faster to write and read. pngstest now uses this by default; this can be disabled with the --slow option.
  • Improved pngstest fine tuning of error numbers, new test file generator.
  • The generator generates images that test the full range of sample values, allow the error numbers in pngstest to be tuned and checked. makepng also allows generation of images with extra chunks, although this is still work-in-progress.
  • Fixed some bugs in ICC profile writing. The code should now accept all potentially valid ICC profiles and reject obviously invalid ones.
  • It now uses png_error() to do so rather than casually writing a PNG without the necessary color data.
  • Removed whitespace from the end of lines in all source files and scripts.
  • Added tests for invalid palette index while reading and writing.
  • Changed png_inflate() and calling routines to avoid overflow problems. This is an intermediate check-in that solves the immediate problems and introduces one performance improvement (avoiding a copy via png_ptr->zbuf.)
  • Further changes will be made to make ICC profile handling more secure.
  • Added contrib/libtests/tarith.c to test internal arithmetic functions from png.c.
  • This is a libpng maintainer program used to validate changes to the internal arithmetic functions. Made read 'inflate' handling like write 'deflate' handling.
  • The read code now claims and releases png_ptr->zstream, like the write code.
  • The bug whereby the progressive reader failed to release the zstream is now fixed, all initialization is delayed, and the code checks for changed parameters on deflate rather than always calling deflatedEnd/deflateInit.
  • Validate the zTXt strings in pngvalid.
  • Added code to validate the windowBits value passed to deflateInit2(). If the call to deflateInit2() is wrong a png_warning will be issued (in fact this is harmless, but the PNG data produced may be sub-optimal).
  • Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition. Reject all iCCP chunks after the first, even if the first one is invalid.
  • Deflate/inflate was reworked to move common zlib calls into single functions [rw]util.c.
  • A new shared keyword check routine was also added and the 'zbuf' is no longer allocated on progressive read. It is now possible to call png_inflate() incrementally. If benign errors are disabled use maximum window on ancilliary inflate.
  • This works round a bug introduced in 1.5.4 where compressed ancillary chunks could end up with a too-small windowBits value in the deflate header.
  • Issue a png_benign_error() instead of png_warning() about bad palette index. In pngtest, treat benign errors as errors if "-strict" is present.
  • Fixed a compiler warning under Cygwin (Windows-7, 32-bit system)
  • Revised example.c to put text strings in a temporary character array instead of directly assigning string constants to png_textp members. This avoids compiler warnings when -Wwrite-strings is enabled.
  • Added output flushing to aid debugging under Visual Studio. Unfortunately this is necessary because the VS2010 output window otherwise simply loses the error messages on error (they weren't flushed to the window before the process exited, apparently!)
  • Added configuration support for benign errors and changed the read default.
  • Also changed some warnings in the iCCP and sRGB handling from to benign errors.
  • Configuration now makes read benign errors warnings and write benign errors to errors by default (thus changing the behavior on read).
  • The simplified API always forces read benign errors to warnings (regardless of the system default, unless this is disabled in which case the simplified API can't be built.) Work around for duplicate row start calls; added warning messages.
  • This turns on PNG_FLAG_DETECT_UNINITIALIZED to detect app code that fails to call one of the 'start' routines (not enabled in libpng-1.5 because it is technically an API change, since it did normally work before.)
  • It also makes duplicate calls to png_read_start_row (an internal function called at the start of the image read) benign, as they were before changes to use png_inflate_claim.
  • Somehow webkit is causing this to happen; this is probably a mis-feature in the zlib changes so this commit is only a work-round.
  • Removed erroneous setting of DETECT_UNINITIALIZED and added more checks.
  • The code now does a png_error if an attempt is made to do the row initialization twice; this is an application error and it has serious consequences because the transform data in png_struct is changed by each call.
  • Added application error reporting and added chunk names to read benign errors; also added --strict to pngstest - not enabled yet because a warning is produced.
  • Avoid the double gamma correction warning in the simplified API. This allows the --strict option to pass in the pngstest checks
  • Changed chunk handler warnings into benign errors, incrementally load iCCP
  • Added checksum-icc.c to contrib/tools Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice.
  • Recognize known sRGB ICC profiles while reading; prefer writing the iCCP profile over writing the sRGB chunk, controlled by the PNG_sRGB_PROFILE_CHECKS option.
  • Revised png_set_text_2() to avoid potential memory corruption (fixes CVE-2011-3048).
  • Revised scripts/makefile.darwin: use system zlib; remove quotes around architecture list; add missing ppc architecture; add architecture options to shared library link; don't try to create a shared lib based on missing RELEASE variable.
  • Enable png_set_check_for_invalid_index() for both read and write. Removed #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED in pngpriv.h around declaration of png_handle_unknown().
  • Added -lssp_nonshared in a comment in scripts/makefile.freebsd and changed deprecated NOOBJ and NOPROFILE to NO_OBJ and NO_PROFILE.
  • Removed need for -Wno-cast-align with clang. clang correctly warns on alignment increasing pointer casts when -Wcast-align is passed.
  • This fixes the cases that clang warns about either by eliminating the casts from png_bytep to png_uint_16p (pngread.c), or, for pngrutil.c where the cast is previously verified or pngstest.c where it is OK, by introducing new png_aligncast macros to do the cast in a way that clang accepts.
  • Revised CMakeLists.txt to not attempt to make a symlink under mingw. Made fixes for new optimization warnings from gcc 4.7.0.
  • The compiler performs an optimization which is safe; however it then warns about it.
  • Changing the type of 'palette_number' in pngvalid.c removes the warning. Do not depend upon a GCC feature macro being available for use in generating the linker mapfile symbol prefix.
  • Improved performance of new do_check_palette_indexes() function (only update the value when it actually increases, move test for whether the check is wanted out of the function.
  • Don't check palette indexes if num_palette is 0 (as it can be in MNG files).
  • Revised png_set_keep_unknown_chunks() so num_chunks < 0 means ignore all unknown chunks and all known chunks except for IHDR, PLTE, tRNS, IDAT, and IEND.
  • Previously it only meant ignore all unknown chunks, the same as num_chunks == 0. Revised png_image_skip_unused_chunks() to provide a list of chunks to be processed instead of a list of chunks to ignore.
  • Revised contrib/gregbook/readpng2.c accordingly.
  • Removed scripts/makefile.cegcc from the *.zip and *.7z distributions; it depends on configure, which is not included in those archives.
  • Moved scripts/chkfmt to contrib/tools. Changed "a+w" to "u+w" in Makefile.in to fix CVE-2012-3386. Do not compile PNG_DEPRECATED, PNG_ALLOC and PNG_PRIVATE when __GNUC__ < 3. Do not use __restrict when GNUC is signature[8] from WRITE-only builds.
  • Add some conditions for compiling png_fixed(). This is a small function but it requires "-lm" on some platforms.
  • Cause pngtest --strict to fail on any warning from libpng (not just errors) and cause it not to fail at the comparison step if libpng lacks support for writing chunks that it reads from the input (currently only implemented for compressed text chunks).
  • Make all three "make check" test programs work without READ or WRITE support. Now "make check" will succeed even if libpng is compiled with -DPNG_NO_READ or -DPNG_NO_WRITE. The tests performed are reduced, but the basic reading and writing of a PNG file is always tested by one or more of the tests.
  • Consistently use strlen(), memset(), memcpy(), and memcmp() instead of the png_strlen(), png_memset(), png_memcpy(), and png_memcmp() macros.
  • Removed the png_sizeof(), png_strlen(), png_memset(), png_memcpy(), and png_memcmp() macros. Work around gcc 3.x and Microsoft Visual Studio 2010 complaints. Both object to the split initialization of num_chunks.
  • Unknown handling fixes and clean up. This adds more correct option control of the unknown handling, corrects the pre-existing bug where the per-chunk 'keep' setting is ignored and makes it possible to skip IDAT chunks in the sequential reader (broken in earlier 1.6 versions). There is a new test program, test-unknown.c, which is a work in progress (not currently part of the test suite).
  • Comments in the header files now explain how the unknown handling works. Allow fine grain control of unknown chunk APIs. This change allows png_set_keep_unknown_chunks() to be turned off if not required and causes both read and write to behave appropriately (on read this is only possible if the user callback is used to handle unknown chunks).
  • The change also removes the support for storing unknown chunks in the info_struct if the only unknown handling enabled is via the callback, allowing libpng to be configured with callback reading and none of the unnecessary code. Corrected fix for unknown handling in pngtest. This reinstates the libpng handling of unknown chunks other than vpAg and sTER (including unsafe-to-copy chunks which were dropped before) and eliminates the repositioning of vpAg and sTER in pngtest.png by changing pngtest.png (so the chunks are where libpng would put them).
  • Added "tunknown" test and corrected a logic error in png_handle_unknown() when SAVE support is absent.
  • Moved the shell test scripts for contrib/libtests from the libpng top directory to contrib/libtests. png_handle_unknown() must always read or skip the chunk, if SAVE_UNKNOWN_CHUNKS is turned off *and* the application does not set a user callback an unknown chunk will not be read, leading to a read error, which was revealed by the "tunknown" test.
  • Cleaned up and corrected ICC profile handling. contrib/libtests/makepng: corrected 'rgb' and 'gray' cases. profile_error messages could be truncated; made a correct buffer size calculation and adjusted pngerror.c appropriately. png_icc_check_* checking improved; changed the functions to receive the correct color type of the PNG on read or write and check that it matches the color space of the profile (despite what the comments said before, there is danger in assuming the app will cope correctly with an RGB profile on a grayscale image and, since it violates the PNG spec, allowing it is certain to produce inconsistent app behavior and might even cause app crashes.) Check that profiles contain the tags needed to process the PNG (tags all required by the ICC spec).
  • Removed unused PNG_STATIC from pngpriv.h.
  • Fixed the simplified API example programs and improved the error message if the version field is not set. Updated simplified API synopses and description of the png_image structure in the manual.
  • Made makepng and pngtest produce identical PNGs, add "--relaxed" option to pngtest.
  • The "--relaxed" option turns off the benign errors that are enabled by default in pre-RC builds. makepng can now write ICC profiles where the length has not been extended to a multiple of 4, and pngtest now intercepts all libpng errors, allowing the previously-introduced "--strict test" on no warnings to actually work.
  • Added a work around for GCC 4.2 optimization bug.
  • Marked the broken (bad white point) original HP sRGB profiles correctly and correct comments.
  • Added -DZ_SOLO to contrib/pngminim/*/makefile to work with zlib-1.2.7 Use /MDd for vstudio debug builds.
  • Also added pngunkown to the vstudio builds, fixed build errors and corrected a minor exit code error in pngvalid if the 'touch' file name is invalid.
  • Add updated WARNING file to projects/vstudio from libpng 1.5/vstudio
  • Fixed build when using #define PNG_NO_READ_GAMMA in png_do_compose() in pngrtran.c. Made pngvalid so that it will build outside the libpng source tree.
  • Made PNG_NO_READ_GAMMA switch off interfaces that depend on READ_GAMMA.
  • Prior to 1.6.0 switching off READ_GAMMA did unpredictable things to the interfaces that use it (specifically, png_do_background in 1.4 would simply display composite for grayscale images but do composition with the incorrect arithmetic for color ones).
  • In 1.6 the semantic of -DPNG_NO_READ_GAMMA is changed to simply disable any interface that depends on it; this obliges people who set it to consider whether they really want it off if they happen to use any of the interfaces in question (typically most users who disable it won't).
  • Added the ability for contrib/libtests/makepng.c to make a PNG with just one color. This is useful for debugging pngstest color inaccuracy reports.
  • Made png_user_version_check() ok to use with libpng version 1.10.x and later.
  • Fixed typo in png.c (PNG_SET_CHUNK_MALLOC_MAX should be PNG_CHUNK_MALLOC_MAX) that causes the MALLOC_MAX limit not to work
  • Change png_warning() to png_app_error() in pngwrite.c and comment the fall-through condition.
  • Change png_warning() to png_app_warning() in png_write_tRNS(). Rearranged the ARM-NEON optimizations: Isolated the machine specific code to the hardware subdirectory and added comments to pngrutil.c so that implementors of other optimizations know what to do.
  • Fixed cases of unquoted DESTDIR in Makefile.am
  • Cleaned up whitespace in the synopsis portion of the manpage "libpng.3"
  • Made default Zlib compression settings be configurable. This adds #defines to pnglibconf.h to control the defaults.
  • Fixed Windows build issues, enabled ARM compilation.
  • Various warnings issued by earlier versions of GCC fixed for Cygwin and Min/GW (which both use old GCCs.)
  • ARM support is enabled by default in zlib.props (unsupported by Microsoft) and ARM compilation is made possible by deleting the check for x86. The test programs cannot be run because they are not signed.
  • Discontinued distributing libpng-1.x.x.tar.bz2. Discontinued distributing libpng-1.7.0-1.6.0-diff.txt and similar.
  • Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.12.5.
  • Fixed 'make distcheck' on SUN OS - libpng.so was not being removed
  • Fixed conceivable but difficult to repro overflow.
  • Also added two test programs to generate and test a PNG which should have the problem.
  • Added overflow detection in png_set_sPLT() and png_set_text_2().
  • Use consistent handling of overflows in text, sPLT and unknown png_set_* APIs
  • Added png_get_palette_max() function.
  • Fixed missing dependency in --prefix builds
  • The intermediate internal 'prefix.h' file can only be generated correctly after pnglibconf.h, however the dependency was not in Makefile.am.
  • The symptoms are unpredictable depending on the order make chooses to build pngprefix.h and pnglibconf.h, often the error goes unnoticed because there is a system pnglibconf.h to use instead.
  • Enclosed the new png_get_palette_max in #ifdef PNG_GET_PALETTE_MAX_SUPPORTED block, and revised pnglibconf.h and pnglibconf.h.prebuilt accordingly.

New in PNG reference library 1.6.0 RC 8 (Feb 11, 2013)

  • Fix typo in png.h #ifdef

New in PNG reference library 1.6.0 RC 7 (Feb 11, 2013)

  • Enclosed the new png_get_palette_max in #ifdef PNG_GET_PALETTE_MAX_SUPPORTED block, and revised pnglibconf.h and pnglibconf.h.prebuilt accordingly.

New in PNG reference library 1.6.0 RC 6 (Feb 11, 2013)

  • Fixed missing dependency in --prefix builds The intermediate internal 'prefix.h' file can only be generated correctly after pnglibconf.h, however the dependency was not in Makefile.am. The symptoms are unpredictable depending on the order make chooses to build pngprefix.h and pnglibconf.h, often the error goes unnoticed because there is a system pnglibconf.h to use instead.

New in PNG reference library 1.7.0 Alpha 10 (Feb 9, 2013)

  • Make symbol prefixing work with the ARM neon optimizations. Also allow pngpriv.h to be included for preprocessor definitions only, so it can be used in non-C/C++ files.
  • Added png_get_palette_max() function.
  • Changed png_size_t to size_t throughout headers, make sRGB check numbers consistent.
  • Fixed ARM support.
  • Removed stray out-of-order #endif and #ifdef.
  • Ported libpng 1.5 options.awk/dfn file handling to 1.7, fixed one bug.
  • Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.13.
  • Minor fixes to assembler changes, verified with a dummy .S file
  • Removed cc -E workround, corrected png_get_palette_max API. Tested on SUN OS cc 5.9, which demonstrates the tokenization problem previously avoided by using /lib/cpp. Since all .dfn output is now protected in double quotes unless it is to be macro substituted the fix should work everywhere.

New in PNG reference library 1.5.15 Beta 3 (Feb 9, 2013)

  • Remove SUN OS cc -E workround - no longer required
  • Turn serial tests back on (recently turned off by autotools upgrade)

New in PNG reference library 1.5.15 Beta 2 (Feb 6, 2013)

  • Made a probably general fix for the preprocessing used to generate source files. This change might make the check for a special C preprocessor unnecessary, and it also eliminates the requirement for sed in the configure build process.
  • NOTE: this is incomplete, a change must also be made to pnglibconf.mak
  • Fix typo in Makefile.am, fix scripts/pnglibconf.mak and makefile.std
  • Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.13
  • Fix 'setting' handling in options.awk and fixed palette_max API

New in PNG reference library 1.6.0 RC 2 (Feb 5, 2013)

  • Added png_get_palette_max() function.

New in PNG reference library 1.5.15 Beta 1 (Feb 5, 2013)

  • Enabled renaming of the extern (but not DLL exported) ARM filter functions.
  • Also enabled inclusion of pngpriv.h in non-C files by preventing C/C++ specific definitions if PNG_VERSION_INFO_ONLY is defined.
  • Added png_get_palette_max() function.

New in PNG reference library 1.5.14 (Jan 24, 2013)

  • Added -DZ_SOLO to contrib/pngminim/*/makefile to work with zlib-1.2.7
  • Warn about the incorrect runtime library setting for VS2010 debug DLL builds.
  • Fixed build when using #define PNG_NO_READ_GAMMA in png_do_compose() in pngrtran.c
  • Check for png_ptr==NULL earlier in png_zalloc(). Ignore, with a warning, out-of-range value of num_trans in png_set_tRNS().
  • Rearranged building of ARM NEON optimizations. The ARM specific code is split out entirely to the arm subdirectory and changes to configure.ac and Makefile.am to add new stuff are reduced.
  • Now material code changes, although for build test purposes, --enable-arm-neon now builds on non-ARM systems.
  • Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.12.5.
  • Fixed cases of unquoted DESTDIR in Makefile.am
  • Fixed a minor bug in types to malloc and major bug in handling compressed iTXt.
  • Compressed iTXt could not be handled.
  • Cleaned up whitespace in the synopsis portion of the manpage "libpng.3" Disassembled the version number in scripts/options.awk.
  • Fixed Windows build issues, enabled ARM compilation.
  • Various warnings issued by earlier versions of GCC fixed for Cygwin and Min/GW (which both use old GCCs.) ARM support is enabled by default in zlib.props (unsupported by Microsoft) and ARM compilation is made possible by deleting the check for x86. The test programs cannot be run because they are not signed.
  • De-configured build fixes to make a range of deconfiguration options (such as switching off read or write support) work in more cases.
  • Also upgraded pngtest and pngvalid to the libpng 1.6 versions (with some modifications) which provide more extensive testing.
  • Replaced pngtest.png because pngtest writes the ancillary chunks in a different order.
  • Check validity of "num_unknowns" parameter of png_set_unknown_chunks()
  • Revised test for validity of "num_unknowns" to eliminate compiler warnings.
  • Check the validity of the "nentries" parameter of png_set_sPLT() and the "num_text" parameter of png_set_text_2().

New in PNG reference library 1.7.0 Alpha 9 (Jan 23, 2013)

  • Pulled changes to multi-chunk handling from libpng-1.6.0beta40.

New in PNG reference library 1.7.0 Alpha 8 (Jan 23, 2013)

  • Corrected previous attempt at overflow detection in png_set_unknown_chunks().

New in PNG reference library 1.7.0 Alpha 7 (Jan 23, 2013)

  • Fixed conceivable but difficult to repro overflow.
  • Also added two test programs to generate and test a PNG which should have the problem.

New in PNG reference library 1.6.0 Beta 40 (Jan 23, 2013)

  • Use consistent handling of overflows in text, sPLT and unknown png_set_* APIs

New in PNG reference library 1.6.0 Beta 39 (Jan 23, 2013)

  • Again corrected attempt at overflow detection in png_set_unknown_chunks(). Added overflow detection in png_set_sPLT() and png_set_text_2().

New in PNG reference library 1.6.0 Beta 37 (Jan 23, 2013)

  • Fixed conceivable but difficult to repro overflow.
  • Also added two test programs to generate and test a PNG which should have the problem.

New in PNG reference library 1.6.0 Beta 36 (Jan 23, 2013)

  • Discontinued distributing libpng-1.x.x.tar.bz2. Discontinued distributing libpng-1.7.0-1.6.0-diff.txt and similar.
  • Rebuilt configure with autoconf-2.69 (inadvertently not done in beta33)
  • Fixed 'make distcheck' on SUN OS - libpng.so was not being removed

New in PNG reference library 1.5.14 RC 3 (Jan 23, 2013)

  • Check the validity of the "nentries" parameter of png_set_sPLT() and the "num_text" parameter of png_set_text_2().

New in PNG reference library 1.5.14 RC 2 (Jan 23, 2013)

  • Revised test for validity of "num_unknowns" to eliminate compiler warnings.

New in PNG reference library 1.7.0 Alpha 4 (Dec 27, 2012)

  • Added scripts/makefile.msys
  • default Zlib compression settings be configurable. This adds #defines to pnglibconf.h to control the defaults.
  • Fixed Windows build issues, enabled ARM compilation. Various warnings issued by earlier versions of GCC fixed for Cygwin and Min/GW (which both use old GCCs.) ARM support is enabled by default in zlib.props (unsupported by Microsoft) and ARM compilation is made possible by deleting the check for x86.
  • The test programs cannot be run because they are not signed.

New in PNG reference library 1.7.0 Alpha 3 (Dec 27, 2012)

  • Cleaned up and enhanced the configure option; libpng now correctly links and tests against zlib with a prefix; tests have been clarified; and irrelevant or obsolete things (as defined by the autotools man page) have been removed.
  • Documented new PNG_ABORT behavior in the manual and commentary in pngerror.c
  • Cleaned up whitespace in the synopsis portion of the manpage "libpng.3"
  • Fixed previous support for Z_PREFIX in configure builds, corrected sCAL APIs; some of these use floating point arithmetic so they need to be disabled if floating point arithmetic is switched off. This is a quiet API change - previously it appeared that the APIs were supported if fixed point arithmetic was used internally, however they required certain APIs (floor, modf, frexp, atof) that are part of C floating point support.
  • Changed png_fixed and the gamma code specific version of the same to avoid floor(), which may be a library function (not an intrinsic).
  • Removed unused #if 0 code.

New in PNG reference library 1.7.0 Alpha 2 (Dec 27, 2012)

  • Removed functions that were deprecated in libpng-1.6.0: png_reset_zstream(), png_info_init_3(), and png_data_freer() and its associated flags.
  • Removed some duplicated lines from contrib/tools/scale.c and png.c.
  • Changed some instances of png_warning() to png_app_error().
  • Updated some left over "1.6.0beta32" in code sources.
  • Fixed a "png_structp" prototype (should be png_structrp) in arm_init.c
  • Updated the version-number hack in pngvalid.c

New in PNG reference library 1.7.0 Alpha 1 (Dec 17, 2012)

  • Started 1.7.0 branch from libpng-1.6.0beta33.
  • Made 8-bit compose and rgb_to_grayscale accuracy improvements. These changes cause 16-bit arithmetic to be used for 8-bit data in the gamma corrected compose and grayscale operations.
  • The arithmetic errors have three sources all of which are fixed in this commit:
  • 8-bit linear calculations produce massive errors for lower intensity values.
  • The old 16-bit "16 to 8" gamma table code erroneously wrote the lowest output value into a table entry which corresponded to multiple output values (so where the value written should have been the closest to the transformed input value.)
  • In a number of cases the code to access the 16-bit table did not round; it did a simple shift, which was wrong and made the side effects of (2) even worse. The new gamma code does not have the 16-to-8 problem at the cost of slightly more calculations and the algorithm used to minimize the number of calculations has been extended to all the 16-bit tables; it has advantages for any significant gamma correction.
  • Rearranged png_struct, remove unused members, change png_set_filter handling png_struct members rearranged - partly to reorder to avoid packing, partly to put frequently accessed members at the start and partly to make the grouping more clear. png_set_filter code has been rewritten and the code shared with png_write_start_row moved to a common function.
  • Comments in png.h have been made more clear. Minor fixes to contrib/libtests/timepng.c and some of the png_*_tRNS logic, including more error detection in png_set_tRNS.
  • Cleaned up USER_LIMITS feature, removing members from png_struct when not required.
  • Rearranged ARM-NEON optimizations to isolate the machine specific code to the hardware subdirectory, and add comments to pngrutil.c so that implementors of other optimizations will know what to do.
  • Fixed cases of unquoted DESTDIR in Makefile.am.
  • Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.12.5.

New in PNG reference library 1.6.0 Beta 33 (Dec 17, 2012)

  • Fixed typo in png.c (PNG_SET_CHUNK_MALLOC_MAX should be PNG_CHUNK_MALLOC_MAX) that causes the MALLOC_MAX limit not to work (John Bowler)
  • Change png_warning() to png_app_error() in pngwrite.c and comment the fall-through condition.
  • Change png_warning() to png_app_warning() in png_write_tRNS().
  • Rearranged the ARM-NEON optimizations: Isolated the machine specific code to the hardware subdirectory and added comments to pngrutil.c so that implementors of other optimizations know what to do.
  • Fixed cases of unquoted DESTDIR in Makefile.am
  • Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.2.5.

New in PNG reference library 1.5.14 Beta 3 (Dec 17, 2012)

  • Added missing "-" in front of DNO_GZIP in contrib/pngminim/*/makefile. C
  • heck for png_ptr==NULL earlier in png_zalloc().
  • Ignore, with a warning, out-of-range value of num_trans in png_set_tRNS().
  • Rearranged building of ARM NEON optimizations. The ARM specific code is split out entirely to the arm subdirectory and changes to configure.ac and
  • Makefile.am to add new stuff are reduced. Now material code changes, although for build test purposes, --enable-arm-neon now builds on non-ARM systems.
  • Rebuilt Makefile.in, configure, etc., with autoconf-2.69 and automake-1.12.5.
  • Fixed cases of unquoted DESTDIR in Makefile.am
  • Fixed a minor bug in types to malloc and major bug in handling compressed iTXt.
  • Compressed iTXt could not be handled.

New in PNG reference library 1.6.0 Beta 30 (Oct 25, 2012)

  • Changed ICC profile matrix/vector types to not depend on array type rules.
  • By the ANSI-C standard the new types should be identical to the previous versions, and all known versions of gcc tested with the previous versions except for GCC-4.2.1 work with this version. The change makes the ANSI-C rule that const applied to an array of elements applies instead to the elements in the array moot by explicitly applying const to the base elements of the png_icc_matrix and png_icc_vector types. The accidental (harmless) 'const' previously applied to the parameters of two of the functions have also been removed.
  • Added a work around for GCC 4.2 optimization bug. Marked the broken (bad white point) original HP sRGB profiles correctly and correct comments.
  • Added -DZ_SOLO to contrib/pngminim/*/makefile to work with zlib-1.2.7
  • Use /MDd for vstudio debug builds. Also added pngunkown to the vstudio builds, fixed build errors and corrected a minor exit code error in pngvalid if the 'touch' file name is invalid.
  • Add updated WARNING file to projects/vstudio from libpng 1.5/vstudio
  • Fixed build when using #define PNG_NO_READ_GAMMA in png_do_compose() in pngrtran.c.

New in PNG reference library 1.5.14 Beta 1 (Oct 25, 2012)

  • Added -DZ_SOLO to contrib/pngminim/*/makefile to work with zlib-1.2.7
  • Warn about the incorrect runtime library setting for VS2010 debug DLL builds.
  • Fixed build when using #define PNG_NO_READ_GAMMA in png_do_compose() in pngrtran.c.

New in PNG reference library 1.5.13 (Sep 27, 2012)

  • Do not compile PNG_DEPRECATED, PNG_ALLOC and PNG_PRIVATE when __GNUC__ < 3.
  • Removed references to png_zalloc() and png_zfree() from the manual.
  • Revised PNG_FP_EXPORT and PNG_FIXED_EXPORT macros to avoid generating lone semicolons (patch ported from libpng-1.6.0beta11).
  • Corrected handling of the image array and the row_pointers array in example.c When png_set_filler is used to strip a filler channel during write, the code prior to 1.5 would ignore the case where the output required an alpha channel or when the output was a palettized PNG.
  • In libpng-1.5 the ignorance was lost and libpng proceeded to strip the channel resulting in a bad (potential memory overwrite) failure later.
  • This reverts the behavior to the pre-1.5 state but issues a warning. libpng-1.6 is expected to issue an error on the erroneous png_set_filler call.
  • Use png_memset() consistently (pngmem.c contained some bare "memset" calls).

New in PNG reference library 1.5.13 Beta 2 (Sep 17, 2012)

  • Corrected handling of the image array and the row_pointers array in example.c When png_set_filler is used to strip a filler channel during write, the code prior to 1.5 would ignore the case where the output required an alpha channel or when the output was a palettized PNG.
  • In libpng-1.5 the ignorance was lost and libpng proceeded to strip the channel resulting in a bad (potential memory overwrite) failure later. This reverts the behavior to the pre-1.5 state but issues a warning.
  • libpng-1.6 is expected to issue an error on the erroneous png_set_filler call. Use png_memset() consistently (pngmem.c contained some bare "memset" calls).

New in PNG reference library 1.6.0 Beta 29 (Sep 5, 2012)

  • Fixed the simplified API example programs and improved the error message if the version field is not set.
  • Added contrib/examples/* to the *.zip and *.7z distributions.
  • Updated simplified API synopses and description of the png_image structure in the manual.
  • Made makepng and pngtest produce identical PNGs, add "--relaxed" option to pngtest.
  • The "--relaxed" option turns off the benign errors that are enabled by default in pre-RC builds. makepng can now write ICC profiles where the length has not been extended to a multiple of 4, and pngtest now intercepts all libpng errors, allowing the previously-introduced "--strict test" on no warnings to actually work. Improved ICC profile handling including cHRM chunk generation and fixed Cygwin+MSVC build errors.
  • The ICC profile handling now includes more checking.
  • Several errors that caused rejection of the profile are now handled with a warning in such a way that the invalid profiles will be read by default in release (but not pre-RC) builds but will not be written by default.
  • The easy part of handling the cHRM chunk is written, where the ICC profile contains the required data. The more difficult part plus guessing a gAMA value requires code to pass selected RGB values through the profile.

New in PNG reference library 1.6.0 Beta 28 (Aug 30, 2012)

  • Unknown handling fixes and clean up.
  • This adds more correct option control of the unknown handling, corrects the pre-existing bug where the per-chunk 'keep' setting is ignored and makes it possible to skip IDAT chunks in the sequential reader (broken in earlier 1.6 versions).
  • There is a new test program, test-unknown.c, which is a work in progress (not currently part of the test suite).
  • Comments in the header files now explain how the unknown handling works. Allow fine grain control of unknown chunk APIs.
  • This change allows png_set_keep_unknown_chunks() to be turned off if not required and causes both read and write to behave appropriately (on read this is only possible if the user callback is used to handle unknown chunks). The change also removes the support for storing unknown chunks in the info_struct if the only unknown handling enabled is via the callback, allowing libpng to be configured with callback reading and none of the unnecessary code.
  • Corrected fix for unknown handling in pngtest. This reinstates the libpng handling of unknown chunks other than vpAg and sTER (including unsafe-to-copy chunks which were dropped before) and eliminates the repositioning of vpAg and sTER in pngtest.png by changing pngtest.png (so the chunks are where libpng would put them).
  • Added "tunknown" test and corrected a logic error in png_handle_unknown() when SAVE support is absent.
  • Moved the shell test scripts for contrib/libtests from the libpng top directory to contrib/libtests. png_handle_unknown() must always read or skip the chunk, if SAVE_UNKNOWN_CHUNKS is turned off *and* the application does not set a user callback an unknown chunk will not be read, leading to a read error, which was revealed by the "tunknown" test.
  • Cleaned up and corrected ICC profile handling. contrib/libtests/makepng: corrected 'rgb' and 'gray' cases. profile_error messages could be truncated; made a correct buffer size calculation and adjusted pngerror.c appropriately. png_icc_check_* checking improved; changed the functions to receive the correct color type of the PNG on read or write and check that it matches the color space of the profile (despite what the comments said before, there is danger in assuming the app will cope correctly with an RGB profile on a grayscale image and, since it violates the PNG spec, allowing it is certain to produce inconsistent app behavior and might even cause app crashes.) Check that profiles contain the tags needed to process the PNG (tags all required by the ICC spec).
  • Removed unused PNG_STATIC from pngpriv.h.

New in PNG reference library 1.6.0 Beta 27 (Aug 13, 2012)

  • Do not compile PNG_DEPRECATED, PNG_ALLOC and PNG_PRIVATE when __GNUC__ < 3. Do not use __restrict when GNUC is signature[8] from WRITE-only builds. Add some conditions for compiling png_fixed().
  • This is a small function but it requires "-lm" on some platforms. Cause pngtest --strict to fail on any warning from libpng (not just errors) and cause it not to fail at the comparison step if libpng lacks support for writing chunks that it reads from the input (currently only implemented for compressed text chunks).
  • Make all three "make check" test programs work without READ or WRITE support. Now "make check" will succeed even if libpng is compiled with -DPNG_NO_READ or -DPNG_NO_WRITE. The tests performed are reduced, but the basic reading and writing of a PNG file is always tested by one or more of the tests.
  • Consistently use strlen(), memset(), memcpy(), and memcmp() instead of the png_strlen(), png_memset(), png_memcpy(), and png_memcmp() macros.
  • Removed the png_sizeof(), png_strlen(), png_memset(), png_memcpy(), and png_memcmp() macros. Work around gcc 3.x and Microsoft Visual Studio 2010 complaints. Both object to the split initialization of num_chunks.

New in PNG reference library 1.5.13 Beta 1 (Aug 9, 2012)

  • Do not compile PNG_DEPRECATED, PNG_ALLOC and PNG_PRIVATE when __GNUC__ < 3.
  • Removed references to png_zalloc() and png_zfree() from the manual.
  • Revised PNG_FP_EXPORT and PNG_FIXED_EXPORT macros to avoid generating lone semicolons (patch ported from libpng-1.6.0beta11).

New in PNG reference library 1.5.12 (Jul 11, 2012)

  • Removed scripts/makefile.cegcc from the *.zip and *.7z distributions; it depends on configure, which is not included in those archives.
  • Changed "a+w" to "u+w" in Makefile.in to fix CVE-2012-3386.

New in PNG reference library 1.6.0 Beta 26 (Jul 11, 2012)

  • Removed scripts/makefile.cegcc from the *.zip and *.7z distributions; it depends on configure, which is not included in those archives.
  • Moved scripts/chkfmt to contrib/tools.
  • Changed "a+w" to "u+w" in Makefile.in to fix CVE-2012-3386.

New in PNG reference library 1.6.0 Beta 25 (Jul 2, 2012)

  • Revised png_set_keep_unknown_chunks() so num_chunks < 0 means ignore all unknown chunks and all known chunks except for IHDR, PLTE, tRNS, IDAT, and IEND.
  • Previously it only meant ignore all unknown chunks, the same as num_chunks == 0.
  • Revised png_image_skip_unused_chunks() to provide a list of chunks to be processed instead of a list of chunks to ignore.
  • Revised contrib/gregbook/readpng2.c accordingly.

New in PNG reference library 1.5.11 (Jun 15, 2012)

  • Revised scripts/makefile.darwin: use system zlib;
  • remove quotes around architecture list;
  • add missing ppc architecture;
  • add architecture options to shared library link;
  • don't try to create a shared lib based on missing RELEASE variable.
  • Enable png_set_check_for_invalid_index() for both read and write. Removed #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED/#endif in pngpriv.h around declaration of png_handle_unknown().
  • Added -lssp_nonshared in a comment in scripts/makefile.freebsd and changed deprecated NOOBJ and NOPROFILE to NO_OBJ and NO_PROFILE. Revised CMakeLists.txt to not attempt to make a symlink under mingw. Added two images to contrib/pngsuite (1-bit and 2-bit transparent grayscale), and renamed three whose names were inconsistent with those in pngsuite/README.txt.
  • Do not depend upon a GCC feature macro being available for use in generating the linker mapfile symbol prefix.
  • Made fixes for new optimization warnings from gcc 4.7.0. The compiler performed an optimization which is safe but then warned about it.
  • Changing the type of 'palette_number' in pngvalid.c removes the warning. Improved efficiency of new do_check_palette_indexes() function.
  • Don't check palette indexes if num_palette is 0 (as it can be in MNG files). Include zlib.h in contrib/gregbook and contrib/visupng examples.

New in PNG reference library 1.6.0 Beta 24 (Jun 8, 2012)

  • Don't check palette indexes if num_palette is 0 (as it can be in MNG files).

New in PNG reference library 1.6.0 Beta 23 (Jun 7, 2012)

  • Revised CMakeLists.txt to not attempt to make a symlink under mingw.
  • Made fixes for new optimization warnings from gcc 4.7.0.
  • The compiler performs an optimization which is safe; however it then warns about it.
  • Changing the type of 'palette_number' in pngvalid.c removes the warning.
  • Do not depend upon a GCC feature macro being available for use in generating the linker mapfile symbol prefix.
  • Improved performance of new do_check_palette_indexes() function (only update the value when it actually increases, move test for whether the check is wanted out of the function.

New in PNG reference library 1.5.11 RC 04 (Jun 7, 2012)

  • Improved efficiency of new do_check_palette_indexes() function.

New in PNG reference library 1.5.11 RC 03 (Jun 5, 2012)

  • Do not depend upon a GCC feature macro being available for use in generating the linker mapfile symbol prefix.
  • Made fixes for new optimization warnings from gcc 4.7.0.
  • The compiler performs an optimization which is safe; however it then warns about it.
  • Changing the type of 'palette_number' in pngvalid.c removes the warning.

New in PNG reference library 1.5.11 RC 02 (May 30, 2012)

  • Fixed some typos in comments.
  • Revised CMakeLists.txt to not attempt to make a symlink under mingw.
  • Added two images to contrib/pngsuite (1-bit and 2-bit transparent grayscale), and renamed three whose names were inconsistent with those in pngsuite/README.txt.

New in PNG reference library 1.6.0 Beta 22 (May 24, 2012)

  • Removed need for -Wno-cast-align with clang. clang correctly warns on alignment increasing pointer casts when -Wcast-align is passed.
  • This fixes the cases that clang warns about either by eliminating the casts from png_bytep to png_uint_16p (pngread.c), or, for pngrutil.c where the cast is previously verified or pngstest.c where it is OK, by introducing new png_aligncast macros to do the cast in a way that clang accepts.

New in PNG reference library 1.6.0 Beta 21 (May 23, 2012)

  • Revised scripts/makefile.darwin: use system zlib;
  • remove quotes around architecture list;
  • add missing ppc architecture; add architecture options to shared library link; don't try to create a shared lib based on missing RELEASE variable.
  • Enable png_set_check_for_invalid_index() for both read and write.
  • Removed #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED in pngpriv.h around declaration of png_handle_unknown().
  • Added -lssp_nonshared in a comment in scripts/makefile.freebsd and changed deprecated NOOBJ and NOPROFILE to NO_OBJ and NO_PROFILE.

New in PNG reference library 1.5.10 (Mar 30, 2012)

  • Removed two useless #ifdef directives from pngread.c and one from pngrutil.c
  • Always put the CMAKE_LIBRARY in "lib" (removed special WIN32 case). Removed empty vstudio/pngstest directory.
  • Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c; now that png_ptr->buffer is inaccessible to applications, the special handling is no longer useful.
  • Fixed bug with png_handle_hIST with odd chunk length.
  • Added PNG_SAFE_LIMITS feature to pnglibconf.dfa and code in pngconf.h to reset the user limits to safe ones if PNG_SAFE_LIMITS is defined. To enable, use "CPPFLAGS=-DPNG_SAFE_LIMITS_SUPPORTED" on the configure command or put "#define PNG_SAFE_LIMITS_SUPPORTED" in pnglibconf.h. Revised the SAFE_LIMITS feature to be the same as the feature in libpng16. Added information about the new limits in the manual.
  • Updated Makefile.in Removed unused "current_text" members of png_struct and the png_free() of png_ptr->current_text from pngread.c
  • Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition. Fixed CMF optimization of non-IDAT compressed chunks, which was added at libpng-1.5.4. It sometimes produced too small of a window.
  • Reject all iCCP chunks after the first, even if the first one is invalid.
  • Added palette-index checking.
  • Issue a png_benign_error() if an invalid index is found.
  • Revised example.c to put text strings in a temporary character array instead of directly assigning string constants to png_textp members. This avoids compiler warnings when -Wwrite-strings is enabled.
  • Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice.
  • Revised png_set_text_2() to avoid potential memory corruption (fixes CVE-2011-3048)

New in PNG reference library 1.6.0 Beta 20 (Mar 30, 2012)

  • Changed chunk handler warnings into benign errors, incrementally load iCCP Added checksum-icc.c to contrib/tools Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice.
  • Recognize known sRGB ICC profiles while reading; prefer writing the iCCP profile over writing the sRGB chunk, controlled by the PNG_sRGB_PROFILE_CHECKS option.
  • Revised png_set_text_2() to avoid potential memory corruption (fixes CVE-2011-3048).

New in PNG reference library 1.6.0 Beta 19 (Mar 20, 2012)

  • Work around for duplicate row start calls;
  • added warning messages. This turns on PNG_FLAG_DETECT_UNINITIALIZED to detect app code that fails to call one of the 'start' routines (not enabled in libpng-1.5 because it is technically an API change, since it did normally work before.) It also makes duplicate calls to png_read_start_row (an internal function called at the start of the image read) benign, as they were before changes to use png_inflate_claim. Somehow webkit is causing this to happen; this is probably a mis-feature in the zlib changes so this commit is only a work-round.
  • Removed erroneous setting of DETECT_UNINITIALIZED and added more checks. The code now does a png_error if an attempt is made to do the row initialization twice; this is an application error and it has serious consequences because the transform data in png_struct is changed by each call.
  • Added application error reporting and added chunk names to read benign errors; also added --strict to pngstest - not enabled yet because a warning is produced. Avoid the double gamma correction warning in the simplified API. This allows the --strict option to pass in the pngstest checks

New in PNG reference library 1.5.10 Beta 5 (Mar 17, 2012)

  • Reject all iCCP chunks after the first, even if the first one is invalid. Issue a png_benign_error() instead of png_warning() about bad palette index.
  • Fixed an off-by-one error in the palette index checking function.
  • Revised example.c to put text strings in a temporary character array instead of directly assigning string constants to png_textp members.
  • This avoids compiler warnings when -Wwrite-strings is enabled.

New in PNG reference library 1.6.0 Beta 18 (Mar 17, 2012)

  • Issue a png_benign_error() instead of png_warning() about bad palette index. In pngtest, treat benign errors as errors if "-strict" is present.
  • Fixed an off-by-one error in the palette index checking function.
  • Fixed a compiler warning under Cygwin (Windows-7, 32-bit system)
  • Revised example.c to put text strings in a temporary character array instead of directly assigning string constants to png_textp members.
  • This avoids compiler warnings when -Wwrite-strings is enabled.
  • Added output flushing to aid debugging under Visual Studio.
  • Unfortunately this is necessary because the VS2010 output window otherwise simply loses the error messages on error (they weren't flushed to the window before the process exited, apparently!)
  • Added configuration support for benign errors and changed the read default. Also changed some warnings in the iCCP and sRGB handling from to benign errors.
  • Configuration now makes read benign errors warnings and write benign errors to errors by default (thus changing the behavior on read).
  • The simplified API always forces read errors to benign errors (regardless of the system default, unless this is disabled in which case the simplified API can't be built.)

New in PNG reference library 1.5.10 Beta 4 (Mar 10, 2012)

  • Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition.
  • Fixed CMF optimization of non-IDAT compressed chunks, which was added at libpng-1.5.4. It sometimes produced too small of a window.

New in PNG reference library 1.6.0 Beta 17 (Mar 10, 2012)

  • Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition.
  • Reject all iCCP chunks after the first, even if the first one is invalid. Deflate/inflate was reworked to move common zlib calls into single functions [rw]util.c.
  • A new shared keyword check routine was also added and the 'zbuf' is no longer allocated on progressive read.
  • It is now possible to call png_inflate() incrementally. If benign errors are disabled use maximum window on ancilliary inflate.
  • This works round a bug introduced in 1.5.4 where compressed ancillary chunks could end up with a too-small windowBits value in the deflate header.

New in PNG reference library 1.5.10 Beta 3 (Mar 8, 2012)

  • Removed unused "current_text" members of png_struct and the png_free() of png_ptr->current_text from pngread.c Added palette-index checking.

New in PNG reference library 1.6.0 Beta 16 (Mar 6, 2012)

  • Relocated palette-index checking function from pngrutil.c to pngtrans.c Added palette-index checking while writing.
  • Changed png_inflate() and calling routines to avoid overflow problems.
  • This is an intermediate check-in that solves the immediate problems and introduces one performance improvement (avoiding a copy via png_ptr->zbuf.)
  • Further changes will be made to make ICC profile handling more secure. Fixed build warnings (MSVC, GCC, GCC v3). Cygwin GCC with default options declares 'index' as a global, causing a warning if it is used as a local variable.
  • GCC 64-bit warns about assigning a (size_t) (unsigned 64-bit) to an (int) (signed 32-bit). MSVC, however, warns about using the unary '-' operator on an unsigned value (even though it is well defined by ANSI-C to be ~x+1). The padding calculation was changed to use a different method.
  • Removed the tests on png_ptr->pass.
  • Added contrib/libtests/tarith.c to test internal arithmetic functions from png.c. This is a libpng maintainer program used to validate changes to the internal arithmetic functions. Made read 'inflate' handling like write 'deflate' handling. The read code now claims and releases png_ptr->zstream, like the write code.
  • The bug whereby the progressive reader failed to release the zstream is now fixed, all initialization is delayed, and the code checks for changed parameters on deflate rather than always calling deflatedEnd/deflateInit. Validate the zTXt strings in pngvalid.
  • Added code to validate the windowBits value passed to deflateInit2(). If the call to deflateInit2() is wrong a png_warning will be issued (in fact this is harmless, but the PNG data produced may be sub-optimal).

New in PNG reference library 1.6.0 Beta 15 (Mar 6, 2012)

  • Removed unused "current_text" members of png_struct and the png_free() of png_ptr->current_text from pngread.c
  • Rewrote pngstest.c for substantial speed improvement.
  • Fixed transparent pixel and 16-bit rgb tests in pngstest and removed a spurious check in pngwrite.c
  • Added PNG_IMAGE_FLAG_FAST for the benefit of applications that store intermediate files, or intermediate in-memory data, while processing image data with the simplified API.
  • The option makes the files larger but faster to write and read. pngstest now uses this by default; this can be disabled with the --slow option.
  • Improved pngstest fine tuning of error numbers, new test file generator.
  • The generator generates images that test the full range of sample values, allow the error numbers in pngstest to be tuned and checked. makepng also allows generation of images with extra chunks, although this is still work-in-progress.
  • Added tests for invalid palette index while reading and writing (work in progress, the latter isn't finished).
  • Fixed some bugs in ICC profile writing.
  • The code should now accept all potentially valid ICC profiles and reject obviously invalid ones.
  • It now uses png_error() to do so rather than casually writing a PNG without the necessary color data. Removed whitespace from the end of lines in all source files and scripts.

New in PNG reference library 1.6.0 Beta 14 (Mar 6, 2012)

  • Added information about the new limits in the manual.
  • Updated Makefile.in

New in PNG reference library 1.5.10 Beta 2 (Feb 27, 2012)

  • Updated Makefile.in

New in PNG reference library 1.6.0 Beta 13 (Feb 25, 2012)

  • Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c; now that png_ptr->buffer is inaccessible to applications, the special handling is no longer useful.
  • Added PNG_SAFE_LIMITS feature to pnglibconf.dfa, pngpriv.h, and new pngusr.dfa to reset the user limits to safe ones if PNG_SAFE_LIMITS is defined. To enable, use CPPFLAGS=-DPNG_SAFE_LIMITS on the configure command or put #define PNG_SAFE_LIMITS_SUPPORTED in pnglibconf.h.prebuilt.

New in PNG reference library 1.5.10 Beta 1 (Feb 25, 2012)

  • Removed two useless #ifdef directives from pngread.c and one from pngrutil.c Always put the CMAKE_LIBRARY in "lib" (removed special WIN32 case). Removed empty vstudio/pngstest directory.
  • Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c; now that png_ptr->buffer is inaccessible to applications, the special handling is no longer useful. Fixed bug with png_handle_hIST with odd chunk length.
  • Added PNG_SAFE_LIMITS feature to pnglibconf.dfa and code in pngconf.h to reset the user limits to safe ones if PNG_SAFE_LIMITS is defined.
  • To enable, use "CPPFLAGS=-DPNG_SAFE_LIMITS_SUPPORTED=" on the configure command or put "#define PNG_SAFE_LIMITS_SUPPORTED" in pnglibconf.h.
  • Revised the SAFE_LIMITS feature to be the same as the feature in libpng16. Added information about the new limits in the manual.

New in PNG reference library 1.5.9 (Feb 20, 2012)

  • Rebuilt configure scripts in the tar distributions.
  • Removed two unused definitions from scripts/pnglibconf.h.prebuilt
  • Removed some unused arrays (with #ifdef) from png_read_push_finish_row(). Removed tests for no-longer-used *_EMPTY_PLTE_SUPPORTED from pngstruct.h Fixed CVE-2011-3026 buffer overrun bug.
  • Deal more correctly with the test on iCCP chunk length.
  • Also removed spurious casts that may hide problems on 16-bit systems.

New in PNG reference library 1.6.0 Beta 12 (Feb 18, 2012)

  • Do not increase num_palette on invalid_index.
  • Relocated check for invalid palette index to pngrtran.c, after unpacking the sub-8-bit pixels. Fixed CVE-2011-3026 buffer overrun bug.
  • Deal more correctly with the test on iCCP chunk length.
  • Also removed spurious casts that may hide problems on 16-bit systems.

New in PNG reference library 1.5.9 RC 1 (Feb 18, 2012)

  • Fixed CVE-2011-3026 buffer overrun bug. Deal more correctly with the test on iCCP chunk length. Also removed spurious casts that may hide problems on 16-bit systems.

New in PNG reference library 1.6.0 Beta 11 (Feb 17, 2012)

  • Fix character count in pngstest command in projects/owatcom/pngstest.tgt Revised test-pngstest.sh to report PASS/FAIL for each image. Updated documentation about the simplified API. Corrected estimate of error in libpng png_set_rgb_to_gray API. The API is extremely inaccurate for sRGB conversions because it uses an 8-bit intermediate linear value and it does not use the sRGB transform, so it suffers from the known instability in gamma transforms for values close to 0 (see Poynton). The net result is that the calculation has a maximum error of 14.99/255; 0.5/255^(1/2.2). pngstest now uses 15 for the permitted 8-bit error. This may still not be enough because of arithmetic error. Removed some unused arrays (with #ifdef) from png_read_push_finish_row(). Fixed a memory overwrite bug in simplified read of RGB PNG with non-linear gamma Also bugs in the error checking in pngread.c and changed quite a lot of the checks in pngstest.c to be correct; either correctly written or not over-optimistic. The pngstest changes are insufficient to allow all possible RGB transforms to be passed; pngstest cmppixel needs to be rewritten to make it clearer which errors it allows and then changed to permit known inaccuracies. Removed tests for no-longer-used *_EMPTY_PLTE_SUPPORTED from pngstruct.h Fixed fixed/float API export conditionals. 1) If FIXED_POINT or FLOATING_POINT options were switched off, png.h ended up with lone ';' characters. This is not valid ANSI-C outside a function. The ';' characters have been moved inside the definition of PNG_FP_EXPORT and PNG_FIXED_EXPORT. 2) If either option was switched off, the declaration of the corresponding functions were completely omitted, even though some of them are still used internally. The result is still valid, but produces warnings from gcc with some warning options (including -Wall). The fix is to cause png.h to declare the functions with PNG_INTERNAL_FUNCTION when png.h is included from pngpriv.h. Check for invalid palette index while reading paletted PNG. When one is found, issue a warning and increase png_ptr->num_palette accordingly. Apps are responsible for checking to see if that happened.

New in PNG reference library 1.5.9 Beta 1 (Feb 4, 2012)

  • Rebuilt configure scripts in the tar distributions.

New in PNG reference library 1.6.0 Beta 10 (Feb 3, 2012)

  • Added Z_SOLO for zlib-1.2.6+ and correct pngstest tests
  • Updated list of test images in CMakeLists.txt
  • Updated the prebuilt configure files to current condition.

New in PNG reference library 1.6.0 Beta 9 (Feb 2, 2012)

  • Reverted the prebuilt configure files to libpng-1.6.0beta05.

New in PNG reference library 1.6.0 Beta 8 (Feb 2, 2012)

  • Fixed Image::colormap misalignment in pngstest.c Check libtool/libtoolize version number (2.4.2) in configure.ac Divide test-pngstest.sh into separate pngstest runs for basic and transparent images. Moved automake options to AM_INIT_AUTOMAKE in configure.ac Added color-tests, silent-rules (Not yet implemented in Makefile.am) and version checking to configure.ac Improved pngstest speed by not doing redundant tests and add const to the background parameter of png_image_finish_read. The --background option is now done automagically only when required, so that commandline option no longer exists. Cleaned up pngpriv.h to consistently declare all functions and data. Also eliminated PNG_CONST_DATA, which is apparently not needed but we can't be sure until it is gone. Added symbol prefixing that allows all the libpng external symbols to be prefixed (suggested by Reuben Hawkins). Updated "ftbb*.png" list in the owatcom and vstudio projects. Fixed 'prefix' builds on clean systems. The generation of pngprefix.h should not require itself. Updated INSTALL to explain that autogen.sh must be run in a GIT clone, not in a libpng directory extracted from a tar distribution.

New in PNG reference library 1.5.8 (Feb 1, 2012)

  • Removed '#include config.h"' from contrib/libtests/pngvalid.c. It's not needed and causes trouble for VPATH building. Moved AC_MSG_CHECKING([if libraries can be versioned]) later to the proper location in configure.ac (Gilles Espinasse). Fix bug in pngerror.c: some long warnings were being improperly truncated (bug introduced in libpng-1.5.4). Fixed Min/GW uninstall to remove libpng.dll.a Conditionalize the install rules for MINGW and CYGWIN in CMakeLists.txt

New in PNG reference library 1.6.0 Beta 7 (Jan 28, 2012)

  • Eliminated Intel icc/icl compiler warnings. The Intel (GCC derived) compiler issues slightly different warnings from those issued by the current vesions of GCC. This eliminates those warnings by adding/removing casts and small code rewrites. Updated configure.ac from autoupdate: added --enable-werror option. Also some layout regularization and removal of introduced tab characters (replaced with 3-character indentation). Obsolete macros identified by autoupdate have been removed; the replacements are all in 2.59 so the pre-req hasn't been changed. --enable-werror checks for support for -Werror (or the given argument) in the compiler. This mimics the gcc configure option by allowing -Werror to be turned on safely; without the option the tests written in configure itself fail compilation because they cause compiler warnings. Rewrote autogen.sh to run autoreconf instead of running tools one-by-one. Conditionalize the install rules for MINGW and CYGWIN in CMakeLists.txt and set CMAKE_LIBRARY_OUTPUT_DIRECTORY to "lib" on all platforms (C. Yapp). Freeze libtool files in the 'scripts' directory. This version of autogen.sh attempts to dissuade people from running it when it is not, or should not, be necessary. Added two images to contrib/pngsuite (1-bit and 2-bit transparent grayscale), and renamed three whose names were inconsistent with those in pngsuite/README.txt.

New in PNG reference library 1.5.8 RC 2 (Jan 26, 2012)

  • Fixed Min/GW uninstall to remove libpng.dll.a Conditionalize the install rules for MINGW and CYGWIN in CMakeLists.txt

New in PNG reference library 1.6.0 Beta 6 (Jan 24, 2012)

  • Added palette support to the simplified APIs.
  • This commit changes some of the macro definitions in png.h, app code may need corresponding changes.
  • Increased the formatted warning buffer to 192 bytes.
  • Added color-map support to simplified API.
  • This is an initial version for review; the documentation has not yet been updated.
  • Fixed Min/GW uninstall to remove libpng.dll.a

New in PNG reference library 1.6.0 Beta 5 (Jan 16, 2012)

  • Updated manual with description of the simplified API (copied from png.h)
  • Fix bug in pngerror.c: some long warnings were being improperly truncated (bug introduced in libpng-1.5.3beta05)

New in PNG reference library 1.6.0 Beta 4 (Dec 30, 2011)

  • Removed machine-generated configure files from the GIT repository (they will continue to appear in the tarball distributions). Restored the new 'simplified' API, which was started in libpng-1.5.7beta02 but later deleted from libpng-1.5.7beta05. Added example programs for the new 'simplified' API. Added ANSI-C (C90) headers and require them, and take advantage of the change. Also fixed some of the projects/* and contrib/* files that needed updates for libpng16 and the move of pngvalid.c. With this change the required ANSI-C header files are assumed to exist: the implementation must provide float.h, limits.h, stdarg.h and stddef.h and libpng relies on limits.h and stddef.h existing and behaving as defined (the other two required headers aren't used). Non-ANSI systems that don't have stddef.h or limits.h will have to provide an appropriate fake containing the relevant types and #defines. The use of FAR/far has been eliminated and the definition of png_alloc_size_t is now controlled by a flag so that 'small size_t' systems can select it if necessary. Libpng 1.6 may not currently work on such systems -- it seems likely that it will ask 'malloc' for more than 65535 bytes with any image that has a sufficiently large row size (rather than simply failing to read such images). New tools directory containing tools used to generate libpng code. Fixed race conditions in parallel make builds. With higher degrees of parallelism during 'make' the use of the same temporary file names such as 'dfn*' can result in a race where a temporary file from one arm of the build is deleted or overwritten in another arm. This changes the temporary files for suffix rules to always use $* and ensures that the non-suffix rules use unique file names. Version 1.6.0beta02 [December 21, 2011] Correct configure builds where build and source directories are separate. The include path of 'config.h' was erroneously made relative in pngvalid.c in libpng 1.5.7.

New in PNG reference library 1.6.0 Beta 3 (Dec 30, 2011)

  • Start-up code size improvements, error handler flexibility. These changes alter how the tricky allocation of the initial png_struct and png_info structures are handled. png_info is now handled in pretty much the same way as everything else, except that the allocations handle NULL return silently. png_struct is changed in a similar way on allocation and on deallocation a 'safety' error handler is put in place (which should never be required). The error handler itself is changed to permit mismatches in the application and libpng error buffer size; however, this means a silent change to the API to return the jmp_buf if the size doesn't match the size from the libpng compilation; libpng now allocates the memory and this may fail. Overall these changes result in slight code size reductions; however, this is a reduction in code that is always executed so is particularly valuable. Overall on a 64-bit system the libpng DLL decreases in code size by 1733 bytes. pngerror.o increases in size by about 465 bytes because of the new functionality.

New in PNG reference library 1.6.0 Beta 2 (Dec 22, 2011)

  • Correct configure builds where build and source directories are separate.
  • The include path of 'config.h' was erroneously made relative in pngvalid.c in libpng 1.5.7.

New in PNG reference library 1.6.0 Beta 1 (Dec 22, 2011)

  • Removed machine-generated configure files from the GIT repository (they will continue to appear in the tarball distributions).
  • Restored the new 'simplified' API, which was deleted from libpng-1.5.7. Added example programs for the new 'simplified' API.
  • Added ANSI-C (C90) headers and require them, and take advantage of the change.
  • Also fixed some of the projects/* and contrib/* files that needed updates for libpng16 and the move of pngvalid.c.
  • With this change the required ANSI-C header files are assumed to exist: the implementation must provide float.h, limits.h, stdarg.h and stddef.h and libpng relies on limits.h and stddef.h existing and behaving as defined (the other two required headers aren't used).
  • Non-ANSI systems that don't have stddef.h or limits.h will have to provide an appropriate fake containing the relevant types and #defines.
  • The use of FAR/far has been eliminated and the definition of png_alloc_size_t is now controlled by a flag so that 'small size_t' systems can select it if necessary.
  • Libpng 1.6 may not currently work on such systems -- it seems likely that it will ask 'malloc' for more than 65535 bytes with any image that has a sufficiently large row size (rather than simply failing to read such images). New tools directory containing tools used to generate libpng code.
  • Fixed race conditions in parallel make builds.
  • With higher degrees of parallelism during 'make' the use of the same temporary file names such as 'dfn*' can result in a race where a temporary file from one arm of the build is deleted or overwritten in another arm.
  • This changes the temporary files for suffix rules to always use $* and ensures that the non-suffix rules use unique file names.

New in PNG reference library 1.5.7 RC 2 (Dec 6, 2011)

  • Revised project files and contrib/pngvalid/pngvalid.c to account for the relocation of pngvalid into contrib/libtests. Revised pngconf.h to use " __declspec(restrict)" only when MSC_VER >= 1400, as in libpng-1.5.4. Put CRLF line endings in the owatcom project files.

New in PNG reference library 1.5.7 RC 1 (Dec 1, 2011)

  • Replaced an "#if" with "#ifdef" in pngrtran.c Revised #if PNG_DO_BC block in png.c (use #ifdef and add #else)

New in PNG reference library 1.5.7 Beta 5 (Nov 25, 2011)

  • Removed "zTXt" from warning in generic chunk decompression function. Validate time settings passed to pngset() and png_convert_to_rfc1123()
  • Added MINGW support to CMakeLists.txt Reject invalid compression flag or method when reading the iTXt chunk.
  • Backed out 'simplified' API changes.
  • The API seems too complex and there is a lack of consensus or enthusiasm for the proposals.
  • The API also reveals significant bugs inside libpng (double gamma correction and the known bug of being unable to retrieve a corrected palette).
  • It seems better to wait until the bugs, at least, are corrected.
  • Moved pngvalid.c into contrib/libtests Rebuilt Makefile.in, configure, etc., with autoconf-2.68

New in PNG reference library 1.5.7 Beta 4 (Nov 18, 2011)

  • Since the gcc driver does not recognize the --noexecstack flag, we must use the Wa prefix to have it passed through to the assembler.
  • Also removed a duplicate setting of this flag.
  • Added files that were omitted from the libpng-1.5.7beta03 zip distribution.

New in PNG reference library 1.5.7 Beta 3 (Nov 17, 2011)

  • Removed PNG_CONST from the sRGB table declarations in pngpriv.h and png.c Added run-time detection of NEON support.
  • Added contrib/libtests; includes simplified API test and timing test and a color conversion utility for rapid checking of failed 'pngstest' results.
  • Multiple transform bug fixes plus a work-round for double gamma correction. libpng does not support more than one transform that requires linear data at once - if this is tried typically the results is double gamma correction. Since the simplified APIs can need rgb to gray combined with a compose operation it is necessary to do one of these outside the main libpng transform code. This check-in also contains fixes to various bugs in the simplified APIs themselves and to some bugs in compose and rgb to gray (on palette) itself.
  • Fixes for C++ compilation using g++ When libpng source is compiled using g++.
  • The compiler imposes C++ rules on the C source; thus it is desireable to make the source work with either C or C++ rules without throwing away useful error information. This change adds png_voidcast to allow C semantic (void*) cases or the corresponding C++ static_cast operation, as appropriate.
  • Added --noexecstack to assembler file compilation. GCC does not set this on assembler compilation, even though it does on C compilation.
  • This creates security issues if assembler code is enabled; the work-around is to set it by default in the flags for $(CCAS)
  • Work around compilers that don't support declaration of const data. Some compilers fault 'extern const' data declarations (because the data is not initialized); this turns on const-ness only for compilers where this is known to work.

New in PNG reference library 1.5.7 Beta 2 (Nov 12, 2011)

  • Check compression_type parameter in png_get_iCCP and remove spurious casts. The compression_type parameter is always assigned to, so must be non-NULL. The cast of the profile length potentially truncated the value unnecessarily on a 16-bit int system, so the cast of the (byte) compression type to (int) is specified by ANSI-C anyway. Fixed FP division by zero in pngvalid.c; the 'test_pixel' code left the sBIT fields in the test pixel as 0, which resulted in a floating point division by zero which was irrelevant but causes systems where FP exceptions cause a crash. Added code to pngvalid to turn on FP exceptions if the appropriate glibc support is there to ensure this is tested in the future. Updated scripts/pnglibconf.mak and scripts/makefile.std to handle the new PNG_JOIN macro. Added versioning to pnglibconf.h comments. Simplified read/write API initial version; basic read/write tested on a variety of images, limited documentation (in the header file.) Installed more accurate linear to sRGB conversion tables. The slightly modified tables reduce the number of 16-bit values that convert to an off-by-one 8-bit value. The "makesRGB.c" code that was used to generate the tables is now in a contrib/sRGBtables sub-directory.

New in PNG reference library 1.5.7 Beta 1 (Nov 5, 2011)

  • Added support for ARM processor
  • Fixed bug in pngvalid on early allocation failure; fixed type cast in pngmem.c; pngvalid would attempt to call png_error() if the allocation of a png_struct or png_info failed. This would probably have led to a crash.
  • The pngmem.c implementation of png_malloc() included a cast to png_size_t which would fail on large allocations on 16-bit systems.
  • Fix for the preprocessor of the Intel C compiler. The preprocessor splits adjacent @ signs with a space; this changes the concatentation token from @@@ to PNG_JOIN; that should work with all compiler preprocessors. Paeth filter speed improvements.This changes the 'Paeth' reconstruction function to improve the GCC code generation on x86.
  • The changes are only part of the suggested ones; just the changes that definitely improve speed and remain simple.
  • The changes also slightly increase the clarity of the code.

New in PNG reference library 1.5.6 RC 3 (Oct 28, 2011)

  • Renamed the LSR() macro to PNG_LSR() and added PNG_LSL() macro. Fixed compiler warnings with Intel and MSYS compilers. The logical shift fix for Microsoft Visual C is required by other compilers, so this enables that fix for all compilers when using compile-time constants. Under MSYS 'byte' is a name declared in a system header file, so we changed the name of a local variable to avoid the warnings that result. Added #define PNG_ALIGN_TYPE PNG_ALIGN_NONE to contrib/pngminim/*/pngusr.h

New in PNG reference library 1.5.6 RC 2 (Oct 28, 2011)

  • Added LSR() macro to defend against buggy compilers that evaluate non-taken code branches and complain about out-of-range shifts.

New in PNG reference library 1.5.6 RC 1 (Oct 26, 2011)

  • Changed misleading "Missing PLTE before cHRM" warning to "Out of place cHRM"

New in PNG reference library 1.5.6 Beta 7 (Oct 21, 2011)

  • Made png_ptr->prev_row an aligned pointer into png_ptr->big_prev_row

New in PNG reference library 1.5.6 Beta 6 (Oct 18, 2011)

  • Removed two redundant tests for uninitialized row.
  • Fixed a relatively harmless memory overwrite in compressed text writing with a 1 byte zlib buffer.
  • Add ability to call png_read_update_info multiple times to pngvalid.c
  • Fixes for multiple calls to png_read_update_info.
  • These fixes attend to most of the errors revealed in pngvalid, however doing the gamma work twice results in inaccuracies that can't be easily fixed.
  • There is now a warning in the code if this is going to happen.
  • Turned on multiple png_read_update_info in pngvalid transform tests.
  • Prevent libpng from overwriting unused bits at the end of the image when it is not byte aligned, while reading.
  • Prior to libpng-1.5.6 libpng would overwrite the end of the image if the row width is not an exact multiple of 8 bits and the image is not interlaced.

New in PNG reference library 1.5.6 Beta 5 (Oct 12, 2011)

  • Speed up png_combine_row(for interlaced images.
  • This reduces the generality of the code, allowing it to be optimized for Adam7 interlace.
  • The masks passed to png_combine_row(are now generated internally, avoiding some code duplication and localizing the interlace handling somewhat.
  • Align png_struct::row_buf - previously it was always unaligned, caused by a bug in the code that attempted to align it; the code needs to subtract one from the pointer to take account of the filter byte prepended to each row.
  • Optimized png_combine_row(when rows are aligned. This gains a small percentage for 16-bit and 32-bit pixels in the typical case where the output row buffers are appropriately aligned.
  • The optimization was not previously possible because the png_struct buffer was always misaligned. Fixed bug in png_write_chunk_header(debug print, introduced in 1.5.6bet01.

New in PNG reference library 1.5.6 Beta 4 (Oct 6, 2011)

  • Fixed typo in Makefile.in and Makefile.am ("-M Wl" should be "-M -Wl").

New in PNG reference library 1.5.6 Beta 3 (Oct 6, 2011)

  • Revised test-pngtest.sh to report FAIL when pngtest fails.
  • Added "--strict" option to pngtest, to report FAIL when the failure is only because the resulting valid files are different.
  • Revised CMakeLists.txt to work with mingw and removed some material from CMakeLists.txt that is no longer useful in libpng-1.5.

New in PNG reference library 1.5.6 Beta 2 (Sep 27, 2011)

  • Added a note in the manual the png_read_update_info() must be called only once with a particular info_ptr. Fixed a typo in the definition of the new PNG_STRING_FROM_CHUNK(s,c) macro.

New in PNG reference library 1.5.6 Beta 1 (Sep 27, 2011)

  • Fixed some 64-bit type conversion warnings in pngrtran.c Moved row_info from png_struct to a local variable. The various interlace mask arrays have been made into arrays of bytes and made PNG_CONST and static (previously some arrays were marked PNG_CONST and some weren't). Additional checks have been added to the transform code to validate the pixel depths after the transforms on both read and write. Removed some redundant code from pngwrite.c, in png_desgtroy_write_struct(). Changed chunk reading/writing code to use png_uint_32 instead of png_byte[4]. This removes the need to allocate temporary strings for chunk names on the stack in the read/write code. Unknown chunk handling still uses the string form because this is exposed in the API.

New in PNG reference library 1.5.5 RC 01 (Sep 15, 2011)

  • Removed "L" suffixes from constants in pngpriv.h

New in PNG reference library 1.5.5 Beta 8 (Sep 10, 2011)

  • Fixed 64-bit compilation errors (gcc). The errors fixed relate to conditions where types that are 32 bits in the GCC 32-bit world (uLong and png_size_t) become 64 bits in the 64-bit world. This produces potential truncation errors which the compiler correctly flags. Relocated new HAVE_SOLARIS_LD definition in configure.ac Constant changes for 64-bit compatibility (removal of L suffixes). The 16-bit cases still use "L" as we don't have a 16-bit test system.

New in PNG reference library 1.5.5 Beta 7 (Sep 9, 2011)

  • Added "$(ARCH)" option to makefile.darwin Added SunOS support to configure.ac and Makefile.am Changed png_chunk_benign_error() to png_warning() in png.c, in png_XYZ_from_xy_checked

New in PNG reference library 1.5.5 Beta 6 (Aug 26, 2011)

  • Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set in CMakeLists.txt (Clifford Yap)
  • Fixes to rgb_to_gray and cHRM XYZ APIs (John Bowler): The rgb_to_gray code had errors when combined with gamma correction. Some pixels were treated as true grey when they weren't and such pixels and true grey ones were not gamma corrected (the original value of the red component was used instead). APIs to get and set cHRM using color space end points have been added and the rgb_to_gray code that defaults based on cHRM (introduced in 1.5.4) has been corrected.
  • A considerable number of tests has been added to pngvalid for the rgb_to_gray transform.
  • Arithmetic errors in rgb_to_gray whereby the calculated gray value was truncated to the bit depth rather than rounded have been fixed except in the 8-bit non-gamma-corrected case (where consistency seems more important than correctness.)
  • The code still has considerable inaccuracies in the 8-bit case because 8-bit linear arithmetic is used.

New in PNG reference library 1.5.5 Beta 5 (Aug 17, 2011)

  • Prevent unexpected API exports from non-libpng DLLs on Windows.
  • The "_DLL" is removed from the test of whether a DLL is being built (this erroneously caused the libpng APIs to be marked as DLL exports in static builds under Microsoft Visual Studio).
  • Almost all of the libpng building configuration is moved from pngconf.h to pngpriv.h, but PNG_DLL_EXPORT remains in pngconf.h, though, so that it is colocated with the import definition (it is no longer used anywhere in the installed headers).
  • The VStudio project definitions have been cleaned up: "_USRDLL" has been removed from the static library builds (this was incorrect), and PNG_USE_DLL has been added to pngvalid to test the functionality (pngtest does not supply it, deliberately).
  • The spurious "_EXPORTS" has been removed from the libpng build (all these errors were a result of copy/paste between project configurations.)
  • Added new types and internal functions for CIE RGB end point handling to pngpriv.h (functions yet to be implemented).

New in PNG reference library 1.5.5 Beta 4 (Jul 30, 2011)

  • Revised CMakeLists.txt (Clifford Yapp) Updated commentary about the png_rgb_to_gray() default coefficients in the manual and in pngrtran.c

New in PNG reference library 1.5.5 Beta 3 (Jul 30, 2011)

  • Enabled compilation with g++ compiler. This compiler does not recognize the file extension, so it always compiles with C++ rules. Made minor changes to pngrutil.c to cast results where C++ expects it but C does not. Minor editing of libpng.3 and libpng-manual.txt.

New in PNG reference library 1.5.5 Beta 2 (Jul 15, 2011)

  • Revised Makefile.am and Makefile.in to look in the right directory for pnglibconf.h.prebuilt

New in PNG reference library 1.5.5 Beta 1 (Jul 15, 2011)

  • Fixed some typos and made other minor changes in the manual.

New in PNG reference library 1.5.4 Beta 2 (Jun 15, 2011)

  • Fixed and clarified LEGACY 16-to-8 scaling code.
  • Added png_set_chop_16() API, to match inaccurate results from previous libpng versions.
  • Removed the ACCURATE and LEGACY options (they are no longer useable)
  • Use the old scaling method for background if png_set_chop_16() was called. Made png_set_chop_16() API removeable by disabling PNG_CHOP_16_TO_8_SUPPORTED

New in PNG reference library 1.5.4 Beta 1 (Jun 14, 2011)

  • Made it possible to undefine PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED to get the same (inaccurate) output as libpng-1.5.2 and earlier. Moved definitions of PNG_HAVE_IHDR, PNG_AFTER_IDAT, and PNG_HAVE_PLTE outside of an unknown-chunk block in png.h because they are also needed for other uses.