1 /*
   2  * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #if 0
  27 CHANGES - changes for libpng
  28 
  29 version 0.1 [March 29, 1995]
  30   initial work-in-progress release
  31 
  32 version 0.2 [April 1, 1995]
  33   added reader into png.h
  34   fixed small problems in stub file
  35 
  36 version 0.3 [April 8, 1995]
  37   added pull reader
  38   split up pngwrite.c to several files
  39   added pnglib.txt
  40   added example.c
  41   cleaned up writer, adding a few new transformations
  42   fixed some bugs in writer
  43   interfaced with zlib 0.5
  44   added K&R support
  45   added check for 64 KB blocks for 16 bit machines
  46 
  47 version 0.4 [April 26, 1995]
  48   cleaned up code and commented code
  49   simplified time handling into png_time
  50   created png_color_16 and png_color_8 to handle color needs
  51   cleaned up color type defines
  52   fixed various bugs
  53   made various names more consistent
  54   interfaced with zlib 0.71
  55   cleaned up zTXt reader and writer (using zlib's Reset functions)
  56   split transformations into pngrtran.c and pngwtran.c
  57 
  58 version 0.5 [April 30, 1995]
  59   interfaced with zlib 0.8
  60   fixed many reading and writing bugs
  61   saved using 3 spaces instead of tabs
  62 
  63 version 0.6 [May 1, 1995]
  64   first beta release
  65   added png_large_malloc() and png_large_free()
  66   added png_size_t
  67   cleaned up some compiler warnings
  68   added png_start_read_image()
  69 
  70 version 0.7 [June 24, 1995]
  71   cleaned up lots of bugs
  72   finished dithering and other stuff
  73   added test program
  74   changed name from pnglib to libpng
  75 
  76 version 0.71 [June 26, 1995]
  77   changed pngtest.png for zlib 0.93
  78   fixed error in libpng.txt and example.c
  79 
  80 version 0.8 [August 20, 1995]
  81   cleaned up some bugs
  82   added png_set_filler()
  83   split up pngstub.c into pngmem.c, pngio.c, and pngerror.c
  84   added #define's to remove unwanted code
  85   moved png_info_init() to png.c
  86   added old_size into png_realloc()
  87   added functions to manually set filtering and compression info
  88   changed compression parameters based on image type
  89   optimized filter selection code
  90   added version info
  91   changed external functions passing floats to doubles (k&r problems?)
  92   put all the configurable stuff in pngconf.h
  93   enabled png_set_shift to work with paletted images on read
  94   added png_read_update_info() - updates info structure with transformations
  95 
  96 Version 0.81 [August, 1995]
  97   incorporated Tim Wegner's medium model code (thanks, Tim)
  98 
  99 Version 0.82 [September, 1995]
 100   [unspecified changes]
 101 
 102 Version 0.85 [December, 1995]
 103   added more medium model code (almost everything's a far)
 104   added i/o, error, and memory callback functions
 105   fixed some bugs (16-bit, 4-bit interlaced, etc.)
 106   added first run progressive reader (barely tested)
 107 
 108 Version 0.86 [January, 1996]
 109   fixed bugs
 110   improved documentation
 111 
 112 Version 0.87 [January, 1996]
 113   fixed medium model bugs
 114   fixed other bugs introduced in 0.85 and 0.86
 115   added some minor documentation
 116 
 117 Version 0.88 [January, 1996]
 118   fixed progressive bugs
 119   replaced tabs with spaces
 120   cleaned up documentation
 121   added callbacks for read/write and warning/error functions
 122 
 123 Version 0.89 [June 5, 1996]
 124   Added new initialization API to make libpng work better with shared libs
 125     we now have png_create_read_struct(), png_create_write_struct(),
 126     png_create_info_struct(), png_destroy_read_struct(), and
 127     png_destroy_write_struct() instead of the separate calls to
 128     malloc and png_read_init(), png_info_init(), and png_write_init()
 129   Changed warning/error callback functions to fix bug - this means you
 130     should use the new initialization API if you were using the old
 131     png_set_message_fn() calls, and that the old API no longer exists
 132     so that people are aware that they need to change their code
 133   Changed filter selection API to allow selection of multiple filters
 134     since it didn't work in previous versions of libpng anyways
 135   Optimized filter selection code
 136   Fixed png_set_background() to allow using an arbitrary RGB color for
 137     paletted images
 138   Fixed gamma and background correction for paletted images, so
 139     png_correct_palette is not needed unless you are correcting an
 140     external palette (you will need to #define PNG_CORRECT_PALETTE_SUPPORTED
 141     in pngconf.h) - if nobody uses this, it may disappear in the future.
 142   Fixed bug with Borland 64K memory allocation (Alexander Lehmann)
 143   Fixed bug in interlace handling (Smarasderagd, I think)
 144   Added more error checking for writing and image to reduce invalid files
 145   Separated read and write functions so that they won't both be linked
 146     into a binary when only reading or writing functionality is used
 147   New pngtest image also has interlacing and zTXt
 148   Updated documentation to reflect new API
 149 
 150 Version 0.89c [June 17, 1996]
 151   Bug fixes.
 152 
 153 Version 0.90 [January, 1997]
 154   Made CRC errors/warnings on critical and ancillary chunks configurable
 155   libpng will use the zlib CRC routines by (compile-time) default
 156   Changed DOS small/medium model memory support - needs zlib 1.04 (Tim Wegner)
 157   Added external C++ wrapper statements to png.h (Gilles Dauphin)
 158   Allow PNG file to be read when some or all of file signature has already
 159     been read from the beginning of the stream.  ****This affects the size
 160     of info_struct and invalidates all programs that use a shared libpng****
 161   Fixed png_filler() declarations
 162   Fixed? background color conversions
 163   Fixed order of error function pointers to match documentation
 164   Current chunk name is now available in png_struct to reduce the number
 165     of nearly identical error messages (will simplify multi-lingual
 166     support when available)
 167   Try to get ready for unknown-chunk callback functions:
 168     - previously read critical chunks are flagged, so the chunk handling
 169       routines can determine if the chunk is in the right place
 170     - all chunk handling routines have the same prototypes, so we will
 171       be able to handle all chunks via a callback mechanism
 172   Try to fix Linux "setjmp" buffer size problems
 173   Removed png_large_malloc, png_large_free, and png_realloc functions.
 174 
 175 Version 0.95 [March, 1997]
 176   Fixed bug in pngwutil.c allocating "up_row" twice and "avg_row" never
 177   Fixed bug in PNG file signature compares when start != 0
 178   Changed parameter type of png_set_filler(...filler...) from png_byte
 179     to png_uint_32
 180   Added test for MACOS to ensure that both math.h and fp.h are not #included
 181   Added macros for libpng to be compiled as a Windows DLL (Andreas Kupries)
 182   Added "packswap" transformation, which changes the endianness of
 183     packed-pixel bytes (Kevin Bracey)
 184   Added "strip_alpha" transformation, which removes the alpha channel of
 185     input images without using it (not necessarily a good idea)
 186   Added "swap_alpha" transformation, which puts the alpha channel in front
 187     of the color bytes instead of after
 188   Removed all implicit variable tests which assume NULL == 0 (I think)
 189   Changed several variables to "png_size_t" to show 16/32-bit limitations
 190   Added new pCAL chunk read/write support
 191   Added experimental filter selection weighting (Greg Roelofs)
 192   Removed old png_set_rgbx() and png_set_xrgb() functions that have been
 193     obsolete for about 2 years now (use png_set_filler() instead)
 194   Added macros to read 16- and 32-bit ints directly from buffer, to be
 195     used only on those systems that support it (namely PowerPC and 680x0)
 196     With some testing, this may become the default for MACOS/PPC systems.
 197   Only calculate CRC on data if we are going to use it
 198   Added macros for zTXt compression type PNG_zTXt_COMPRESSION_???
 199   Added macros for simple libpng debugging output selectable at compile time
 200   Removed PNG_READ_END_MODE in progressive reader (Smarasderagd)
 201   More description of info_struct in libpng.txt and png.h
 202   More instructions in example.c
 203   More chunk types tested in pngtest.c
 204   Renamed pngrcb.c to pngset.c, and all png_read_<chunk> functions to be
 205     png_set_<chunk>.  We now have corresponding png_get_<chunk>
 206     functions in pngget.c to get information in info_ptr.  This isolates
 207     the application from the internal organization of png_info_struct
 208     (good for shared library implementations).
 209 
 210 Version 0.96 [May, 1997]
 211   Fixed serious bug with < 8bpp images introduced in 0.95
 212   Fixed 256-color transparency bug (Greg Roelofs)
 213   Fixed up documentation (Greg Roelofs, Laszlo Nyul)
 214   Fixed "error" in pngconf.h for Linux setjmp() behavior
 215   Fixed DOS medium model support (Tim Wegner)
 216   Fixed png_check_keyword() for case with error in static string text
 217   Added read of CRC after IEND chunk for embedded PNGs (Laszlo Nyul)
 218   Added typecasts to quiet compiler errors
 219   Added more debugging info
 220 
 221 Version 0.97 [January, 1998]
 222   Removed PNG_USE_OWN_CRC capability
 223   Relocated png_set_crc_action from pngrutil.c to pngrtran.c
 224   Fixed typecasts of "new_key", etc. (Andreas Dilger)
 225   Added RFC 1152 [sic] date support
 226   Fixed bug in gamma handling of 4-bit grayscale
 227   Added 2-bit grayscale gamma handling (Glenn R-P)
 228   Added more typecasts. 65536L becomes (png_uint_32)65536L, etc. (Glenn R-P)
 229   Minor corrections in libpng.txt
 230   Added simple sRGB support (Glenn R-P)
 231   Easier conditional compiling, e.g.,
 232     define PNG_READ/WRITE_NOT_FULLY_SUPPORTED;
 233     all configurable options can be selected from command-line instead
 234     of having to edit pngconf.h (Glenn R-P)
 235   Fixed memory leak in pngwrite.c (free info_ptr->text) (Glenn R-P)
 236   Added more conditions for png_do_background, to avoid changing
 237     black pixels to background when a background is supplied and
 238     no pixels are transparent
 239   Repaired PNG_NO_STDIO behavior
 240   Tested NODIV support and made it default behavior (Greg Roelofs)
 241   Added "-m" option and PNGTEST_DEBUG_MEMORY to pngtest (John Bowler)
 242   Regularized version numbering scheme and bumped shared-library major
 243     version number to 2 to avoid problems with libpng 0.89 apps
 244     (Greg Roelofs)
 245 
 246 Version 0.98 [January, 1998]
 247   Cleaned up some typos in libpng.txt and in code documentation
 248   Fixed memory leaks in pCAL chunk processing (Glenn R-P and John Bowler)
 249   Cosmetic change "display_gamma" to "screen_gamma" in pngrtran.c
 250   Changed recommendation about file_gamma for PC images to .51 from .45,
 251     in example.c and libpng.txt, added comments to distinguish between
 252     screen_gamma, viewing_gamma, and display_gamma.
 253   Changed all references to RFC1152 to read RFC1123 and changed the
 254     PNG_TIME_RFC1152_SUPPORTED macro to PNG_TIME_RFC1123_SUPPORTED
 255   Added png_invert_alpha capability (Glenn R-P -- suggestion by Jon Vincent)
 256   Changed srgb_intent from png_byte to int to avoid compiler bugs
 257 
 258 Version 0.99 [January 30, 1998]
 259   Free info_ptr->text instead of end_info_ptr->text in pngread.c (John Bowler)
 260   Fixed a longstanding "packswap" bug in pngtrans.c
 261   Fixed some inconsistencies in pngconf.h that prevented compiling with
 262     PNG_READ_GAMMA_SUPPORTED and PNG_READ_hIST_SUPPORTED undefined
 263   Fixed some typos and made other minor rearrangement of libpng.txt (Andreas)
 264   Changed recommendation about file_gamma for PC images to .50 from .51 in
 265     example.c and libpng.txt, and changed file_gamma for sRGB images to .45
 266   Added a number of functions to access information from the png structure
 267     png_get_image_height(), etc. (Glenn R-P, suggestion by Brad Pettit)
 268   Added TARGET_MACOS similar to zlib-1.0.8
 269   Define PNG_ALWAYS_EXTERN when __MWERKS__ && WIN32 are defined
 270   Added type casting to all png_malloc() function calls
 271 
 272 Version 0.99a [January 31, 1998]
 273   Added type casts and parentheses to all returns that return a value.(Tim W.)
 274 
 275 Version 0.99b [February 4, 1998]
 276   Added type cast png_uint_32 on malloc function calls where needed.
 277   Changed type of num_hist from png_uint_32 to int (same as num_palette).
 278   Added checks for rowbytes overflow, in case png_size_t is less than 32 bits.
 279   Renamed makefile.elf to makefile.lnx.
 280 
 281 Version 0.99c [February 7, 1998]
 282   More type casting.  Removed erroneous overflow test in pngmem.c.
 283   Added png_buffered_memcpy() and png_buffered_memset(), apply them to rowbytes.
 284   Added UNIX manual pages libpng.3 (incorporating libpng.txt) and  png.5.
 285 
 286 Version 0.99d [February 11, 1998]
 287   Renamed "far_to_near()" "png_far_to_near()"
 288   Revised libpng.3
 289   Version 99c "buffered" operations didn't work as intended.  Replaced them
 290     with png_memcpy_check() and png_memset_check().
 291   Added many "if (png_ptr == NULL) return" to quell compiler warnings about
 292     unused png_ptr, mostly in pngget.c and pngset.c.
 293   Check for overlength tRNS chunk present when indexed-color PLTE is read.
 294   Cleaned up spelling errors in libpng.3/libpng.txt
 295   Corrected a problem with png_get_tRNS() which returned undefined trans array
 296 
 297 Version 0.99e [February 28, 1998]
 298   Corrected png_get_tRNS() again.
 299   Add parentheses for easier reading of pngget.c, fixed "||" should be "&&".
 300   Touched up example.c to make more of it compileable, although the entire
 301     file still can't be compiled (Willem van Schaik)
 302   Fixed a bug in png_do_shift() (Bryan Tsai)
 303   Added a space in png.h prototype for png_write_chunk_start()
 304   Replaced pngtest.png with one created with zlib 1.1.1
 305   Changed pngtest to report PASS even when file size is different (Jean-loup G.)
 306   Corrected some logic errors in png_do_invert_alpha() (Chris Patterson)
 307 
 308 Version 0.99f [March 5, 1998]
 309   Corrected a bug in pngpread() introduced in version 99c (Kevin Bracey)
 310   Moved makefiles into a "scripts" directory, and added INSTALL instruction file
 311   Added makefile.os2 and pngos2.def (A. Zabolotny) and makefile.s2x (W. Sebok)
 312   Added pointers to "note on libpng versions" in makefile.lnx and README
 313   Added row callback feature when reading and writing nonprogressive rows
 314     and added a test of this feature in pngtest.c
 315   Added user transform callbacks, with test of the feature in pngtest.c
 316 
 317 Version 0.99g [March 6, 1998, morning]
 318   Minor changes to pngtest.c to suppress compiler warnings.
 319   Removed "beta" language from documentation.
 320 
 321 Version 0.99h [March 6, 1998, evening]
 322   Minor changes to previous minor changes to pngtest.c
 323   Changed PNG_READ_NOT_FULLY_SUPPORTED to PNG_READ_TRANSFORMS_NOT_SUPPORTED
 324     and added PNG_PROGRESSIVE_READ_NOT_SUPPORTED macro
 325   Added user transform capability
 326 
 327 Version 1.00 [March 7, 1998]
 328   Changed several typedefs in pngrutil.c
 329   Added makefile.wat (Pawel Mrochen), updated makefile.tc3 (Willem van Schaik)
 330   Replaced "while(1)" with "for(;;)"
 331   Added PNGARG() to prototypes in pngtest.c and removed some prototypes
 332   Updated some of the makefiles (Tom Lane)
 333   Changed some typedefs (s_start, etc.) in pngrutil.c
 334   Fixed dimensions of "short_months" array in pngwrite.c
 335   Replaced ansi2knr.c with the one from jpeg-v6
 336 
 337 Version 1.0.0 [March 8, 1998]
 338   Changed name from 1.00 to 1.0.0 (Adam Costello)
 339   Added smakefile.ppc (with SCOPTIONS.ppc) for Amiga PPC (Andreas Kleinert)
 340 
 341 Version 1.0.0a [March 9, 1998]
 342   Fixed three bugs in pngrtran.c to make gamma+background handling consistent
 343     (Greg Roelofs)
 344   Changed format of the PNG_LIBPNG_VER integer to xyyzz instead of xyz
 345     for major, minor, and bugfix releases.  This is 10001. (Adam Costello,
 346     Tom Lane)
 347   Make months range from 1-12 in png_convert_to_rfc1123
 348 
 349 Version 1.0.0b [March 13, 1998]
 350   Quieted compiler complaints about two empty "for" loops in pngrutil.c
 351   Minor changes to makefile.s2x
 352   Removed #ifdef/#endif around a png_free() in pngread.c
 353 
 354 Version 1.0.1 [March 14, 1998]
 355   Changed makefile.s2x to reduce security risk of using a relative pathname
 356   Fixed some typos in the documentation (Greg).
 357   Fixed a problem with value of "channels" returned by png_read_update_info()
 358 
 359 Version 1.0.1a [April 21, 1998]
 360   Optimized Paeth calculations by replacing abs() function calls with intrinsics
 361   plus other loop optimizations. Improves avg decoding speed by about 20%.
 362   Commented out i386istic "align" compiler flags in makefile.lnx.
 363   Reduced the default warning level in some makefiles, to make them consistent.
 364   Removed references to IJG and JPEG in the ansi2knr.c copyright statement.
 365   Fixed a bug in png_do_strip_filler with XXRRGGBB => RRGGBB transformation.
 366   Added grayscale and 16-bit capability to png_do_read_filler().
 367   Fixed a bug in pngset.c, introduced in version 0.99c, that sets rowbytes
 368     too large when writing an image with bit_depth < 8 (Bob Dellaca).
 369   Corrected some bugs in the experimental weighted filtering heuristics.
 370   Moved a misplaced pngrutil code block that truncates tRNS if it has more
 371     than num_palette entries -- test was done before num_palette was defined.
 372   Fixed a png_convert_to_rfc1123() bug that converts day 31 to 0 (Steve Eddins).
 373   Changed compiler flags in makefile.wat for better optimization
 374     (Pawel Mrochen).
 375 
 376 Version 1.0.1b [May 2, 1998]
 377   Relocated png_do_gray_to_rgb() within png_do_read_transformations() (Greg).
 378   Relocated the png_composite macros from pngrtran.c to png.h (Greg).
 379   Added makefile.sco (contributed by Mike Hopkirk).
 380   Fixed two bugs (missing definitions of "istop") introduced in libpng-1.0.1a.
 381   Fixed a bug in pngrtran.c that would set channels=5 under some circumstances.
 382   More work on the Paeth-filtering, achieving imperceptible speedup
 383     (A Kleinert).
 384   More work on loop optimization which may help when compiled with C++
 385     compilers.
 386   Added warnings when people try to use transforms they've defined out.
 387   Collapsed 4 "i" and "c" loops into single "i" loops in pngrtran and pngwtran.
 388   Revised paragraph about png_set_expand() in libpng.txt and libpng.3 (Greg)
 389 
 390 Version 1.0.1c [May 11, 1998]
 391   Fixed a bug in pngrtran.c (introduced in libpng-1.0.1a) where the masks for
 392     filler bytes should have been 0xff instead of 0xf.
 393   Added max_pixel_depth=32 in pngrutil.c when using FILLER with palette images.
 394   Moved PNG_WRITE_WEIGHTED_FILTER_SUPPORTED and PNG_WRITE_FLUSH_SUPPORTED
 395     out of the PNG_WRITE_TRANSFORMS_NOT_SUPPORTED block of pngconf.h
 396   Added "PNG_NO_WRITE_TRANSFORMS" etc., as alternatives for *_NOT_SUPPORTED,
 397     for consistency, in pngconf.h
 398   Added individual "ifndef PNG_NO_[CAPABILITY]" in pngconf.h to make it easier
 399     to remove unwanted capabilities via the compile line
 400   Made some corrections to grammar (which, it's) in documentation (Greg).
 401   Corrected example.c, use of row_pointers in png_write_image().
 402 
 403 Version 1.0.1d [May 24, 1998]
 404   Corrected several statements that used side effects illegally in pngrutil.c
 405     and pngtrans.c, that were introduced in version 1.0.1b
 406   Revised png_read_rows() to avoid repeated if-testing for NULL (A Kleinert)
 407   More corrections to example.c, use of row_pointers in png_write_image()
 408     and png_read_rows().
 409   Added pngdll.mak and pngdef.pas to scripts directory, contributed by
 410     Bob Dellaca, to make a png32bd.dll with Borland C++ 4.5
 411   Fixed error in example.c with png_set_text: num_text is 3, not 2 (Guido V.)
 412   Changed several loops from count-down to count-up, for consistency.
 413 
 414 Version 1.0.1e [June 6, 1998]
 415   Revised libpng.txt and libpng.3 description of png_set_read|write_fn(), and
 416     added warnings when people try to set png_read_fn and png_write_fn in
 417     the same structure.
 418   Added a test such that png_do_gamma will be done when num_trans==0
 419     for truecolor images that have defined a background.  This corrects an
 420     error that was introduced in libpng-0.90 that can cause gamma processing
 421     to be skipped.
 422   Added tests in png.h to include "trans" and "trans_values" in structures
 423     when PNG_READ_BACKGROUND_SUPPORTED or PNG_READ_EXPAND_SUPPORTED is defined.
 424   Add png_free(png_ptr->time_buffer) in png_destroy_read_struct()
 425   Moved png_convert_to_rfc_1123() from pngwrite.c to png.c
 426   Added capability for user-provided malloc_fn() and free_fn() functions,
 427     and revised pngtest.c to demonstrate their use, replacing the
 428     PNGTEST_DEBUG_MEM feature.
 429   Added makefile.w32, for Microsoft C++ 4.0 and later (Tim Wegner).
 430 
 431 Version 1.0.2 [June 14, 1998]
 432   Fixed two bugs in makefile.bor .
 433 
 434 Version 1.0.2a [December 30, 1998]
 435   Replaced and extended code that was removed from png_set_filler() in 1.0.1a.
 436   Fixed a bug in png_do_filler() that made it fail to write filler bytes in
 437     the left-most pixel of each row (Kevin Bracey).
 438   Changed "static pngcharp tIME_string" to "static char tIME_string[30]"
 439     in pngtest.c (Duncan Simpson).
 440   Fixed a bug in pngtest.c that caused pngtest to try to write a tIME chunk
 441     even when no tIME chunk was present in the source file.
 442   Fixed a problem in pngrutil.c: gray_to_rgb didn't always work with 16-bit.
 443   Fixed a problem in png_read_push_finish_row(), which would not skip some
 444     passes that it should skip, for images that are less than 3 pixels high.
 445   Interchanged the order of calls to png_do_swap() and png_do_shift()
 446     in pngwtran.c (John Cromer).
 447   Added #ifdef PNG_DEBUG/#endif surrounding use of PNG_DEBUG in png.h .
 448   Changed "bad adaptive filter type" from error to warning in pngrutil.c .
 449   Fixed a documentation error about default filtering with 8-bit indexed-color.
 450   Separated the PNG_NO_STDIO macro into PNG_NO_STDIO and PNG_NO_CONSOLE_IO
 451     (L. Peter Deutsch).
 452   Added png_set_rgb_to_gray() and png_get_rgb_to_gray_status() functions.
 453   Added png_get_copyright() and png_get_header_version() functions.
 454   Revised comments on png_set_progressive_read_fn() in libpng.txt and example.c
 455   Added information about debugging in libpng.txt and libpng.3 .
 456   Changed "ln -sf" to "ln -s -f" in makefile.s2x, makefile.lnx, and
 457     makefile.sco.
 458   Removed lines after Dynamic Dependencies" in makefile.aco .
 459   Revised makefile.dec to make a shared library (Jeremie Petit).
 460   Removed trailing blanks from all files.
 461 
 462 Version 1.0.2a [January 6, 1999]
 463   Removed misplaced #endif and #ifdef PNG_NO_EXTERN near the end of png.h
 464   Added "if" tests to silence complaints about unused png_ptr in png.h and png.c
 465   Changed "check_if_png" function in example.c to return true (nonzero) if PNG.
 466   Changed libpng.txt to demonstrate png_sig_cmp() instead of png_check_sig()
 467     which is obsolete.
 468 
 469 Version 1.0.3 [January 14, 1999]
 470   Added makefile.hux, for Hewlett Packard HPUX 10.20 and 11.00 (Jim Rice)
 471   Added a statement of Y2K compliance in png.h, libpng.3, and Y2KINFO.
 472 
 473 Version 1.0.3a [August 12, 1999]
 474   Added check for PNG_READ_INTERLACE_SUPPORTED in pngread.c; issue a warning
 475     if an attempt is made to read an interlaced image when it's not supported.
 476   Added check if png_ptr->trans is defined before freeing it in pngread.c
 477   Modified the Y2K statement to include versions back to version 0.71
 478   Fixed a bug in the check for valid IHDR bit_depth/color_types in pngrutil.c
 479   Modified makefile.wat (added -zp8 flag, ".symbolic", changed some comments)
 480   Replaced leading blanks with tab characters in makefile.hux
 481   Changed "dworkin.wustl.edu" to "ccrc.wustl.edu" in various documents.
 482   Changed (float)red and (float)green to (double)red, (double)green
 483     in png_set_rgb_to_gray() to avoid "promotion" problems in AIX.
 484   Fixed a bug in pngconf.h that omitted <stdio.h> when PNG_DEBUG==0 (K Bracey).
 485   Reformatted libpng.3 and libpngpf.3 with proper fonts (script by J. vanZandt).
 486   Updated documentation to refer to the PNG-1.2 specification.
 487   Removed ansi2knr.c and left pointers to the latest source for ansi2knr.c
 488     in makefile.knr, INSTALL, and README (L. Peter Deutsch)
 489   Fixed bugs in calculation of the length of rowbytes when adding alpha
 490     channels to 16-bit images, in pngrtran.c (Chris Nokleberg)
 491   Added function png_set_user_transform_info() to store user_transform_ptr,
 492     user_depth, and user_channels into the png_struct, and a function
 493     png_get_user_transform_ptr() to retrieve the pointer (Chris Nokleberg)
 494   Added function png_set_empty_plte_permitted() to make libpng useable
 495     in MNG applications.
 496   Corrected the typedef for png_free_ptr in png.h (Jesse Jones).
 497   Correct gamma with srgb is 45455 instead of 45000 in pngrutil.c, to be
 498     consistent with PNG-1.2, and allow variance of 500 before complaining.
 499   Added assembler code contributed by Intel in file pngvcrd.c and modified
 500     makefile.w32 to use it (Nirav Chhatrapati, INTEL Corporation,
 501     Gilles Vollant)
 502   Changed "ln -s -f" to "ln -f -s" in the makefiles to make Solaris happy.
 503   Added some aliases for png_set_expand() in pngrtran.c, namely
 504     png_set_expand_PLTE(), png_set_expand_depth(), and png_set_expand_tRNS()
 505     (Greg Roelofs, in "PNG: The Definitive Guide").
 506   Added makefile.beo for BEOS on X86, contributed by Sander Stok.
 507 
 508 Version 1.0.3b [August 26, 1999]
 509   Replaced 2147483647L several places with PNG_MAX_UINT macro, defined in png.h
 510   Changed leading blanks to tabs in all makefiles.
 511   Define PNG_USE_PNGVCRD in makefile.w32, to get MMX assembler code.
 512   Made alternate versions of  png_set_expand() in pngrtran.c, namely
 513     png_set_gray_1_2_4_to_8, png_set_palette_to_rgb, and png_set_tRNS_to_alpha
 514     (Greg Roelofs, in "PNG: The Definitive Guide").  Deleted the 1.0.3a aliases.
 515   Relocated start of 'extern "C"' block in png.h so it doesn't include pngconf.h
 516   Revised calculation of num_blocks in pngmem.c to avoid a potentially
 517     negative shift distance, whose results are undefined in the C language.
 518   Added a check in pngset.c to prevent writing multiple tIME chunks.
 519   Added a check in pngwrite.c to detect invalid small window_bits sizes.
 520 
 521 Version 1.0.3d [September 4, 1999]
 522   Fixed type casting of igamma in pngrutil.c
 523   Added new png_expand functions to scripts/pngdef.pas and pngos2.def
 524   Added a demo read_user_transform_fn that examines the row filters in pngtest.c
 525 
 526 Version 1.0.4 [September 24, 1999, not distributed publicly]
 527   Define PNG_ALWAYS_EXTERN in pngconf.h if __STDC__ is defined
 528   Delete #define PNG_INTERNAL and include "png.h" from pngasmrd.h
 529   Made several minor corrections to pngtest.c
 530   Renamed the makefiles with longer but more user friendly extensions.
 531   Copied the PNG copyright and license to a separate LICENSE file.
 532   Revised documentation, png.h, and example.c to remove reference to
 533     "viewing_gamma" which no longer appears in the PNG specification.
 534   Revised pngvcrd.c to use MMX code for interlacing only on the final pass.
 535   Updated pngvcrd.c to use the faster C filter algorithms from libpng-1.0.1a
 536   Split makefile.win32vc into two versions, makefile.vcawin32 (uses MMX
 537     assembler code) and makefile.vcwin32 (doesn't).
 538   Added a CPU timing report to pngtest.c (enabled by defining PNGTEST_TIMING)
 539   Added a copy of pngnow.png to the distribution.
 540 
 541 Version 1.0.4a [September 25, 1999]
 542   Increase max_pixel_depth in pngrutil.c if a user transform needs it.
 543   Changed several division operations to right-shifts in pngvcrd.c
 544 
 545 Version 1.0.4b [September 30, 1999]
 546   Added parentheses in line 3732 of pngvcrd.c
 547   Added a comment in makefile.linux warning about buggy -O3 in pgcc 2.95.1
 548 
 549 Version 1.0.4c [October 1, 1999]
 550   Added a "png_check_version" function in png.c and pngtest.c that will generate
 551     a helpful compiler error if an old png.h is found in the search path.
 552   Changed type of png_user_transform_depth|channels from int to png_byte.
 553   Added "Libpng is OSI Certified Open Source Software" statement to png.h
 554 
 555 Version 1.0.4d [October 6, 1999]
 556   Changed 0.45 to 0.45455 in png_set_sRGB()
 557   Removed unused PLTE entries from pngnow.png
 558   Re-enabled some parts of pngvcrd.c (png_combine_row) that work properly.
 559 
 560 Version 1.0.4e [October 10, 1999]
 561   Fixed sign error in pngvcrd.c (Greg Roelofs)
 562   Replaced some instances of memcpy with simple assignments in pngvcrd (GR-P)
 563 
 564 Version 1.0.4f [October 15, 1999]
 565   Surrounded example.c code with #if 0 .. #endif to prevent people from
 566     inadvertently trying to compile it.
 567   Changed png_get_header_version() from a function to a macro in png.h
 568   Added type casting mostly in pngrtran.c and pngwtran.c
 569   Removed some pointless "ptr = NULL" in pngmem.c
 570   Added a "contrib" directory containing the source code from Greg's book.
 571 
 572 Version 1.0.5 [October 15, 1999]
 573   Minor editing of the INSTALL and README files.
 574 
 575 Version 1.0.5a [October 23, 1999]
 576   Added contrib/pngsuite and contrib/pngminus (Willem van Schaik)
 577   Fixed a typo in the png_set_sRGB() function call in example.c (Jan Nijtmans)
 578   Further optimization and bugfix of pngvcrd.c
 579   Revised pngset.c so that it does not allocate or free memory in the user's
 580     text_ptr structure.  Instead, it makes its own copy.
 581   Created separate write_end_info_struct in pngtest.c for a more severe test.
 582   Added code in pngwrite.c to free info_ptr->text[i].key to stop a memory leak.
 583 
 584 Version 1.0.5b [November 23, 1999]
 585   Moved PNG_FLAG_HAVE_CHUNK_HEADER, PNG_FLAG_BACKGROUND_IS_GRAY and
 586     PNG_FLAG_WROTE_tIME from flags to mode.
 587   Added png_write_info_before_PLTE() function.
 588   Fixed some typecasting in contrib/gregbook/*.c
 589   Updated scripts/makevms.com and added makevms.com to contrib/gregbook
 590     and contrib/pngminus (Martin Zinser)
 591 
 592 Version 1.0.5c [November 26, 1999]
 593   Moved png_get_header_version from png.h to png.c, to accommodate ansi2knr.
 594   Removed all global arrays (according to PNG_NO_GLOBAL_ARRAYS macro), to
 595     accommodate making DLL's: Moved usr_png_ver from global variable to function
 596     png_get_header_ver() in png.c.  Moved png_sig to png_sig_bytes in png.c and
 597     eliminated use of png_sig in pngwutil.c.  Moved the various png_CHNK arrays
 598     into pngtypes.h.  Eliminated use of global png_pass arrays.  Declared the
 599     png_CHNK and png_pass arrays to be "const".  Made the global arrays
 600     available to applications (although none are used in libpng itself) when
 601     PNG_NO_GLOBAL_ARRAYS is not defined or when PNG_GLOBAL_ARRAYS is defined.
 602   Removed some extraneous "-I" from contrib/pngminus/makefile.std
 603   Changed the PNG_sRGB_INTENT macros in png.h to be consistent with PNG-1.2.
 604   Change PNG_SRGB_INTENT to PNG_sRGB_INTENT in libpng.txt and libpng.3
 605 
 606 Version 1.0.5d [November 29, 1999]
 607   Add type cast (png_const_charp) two places in png.c
 608   Eliminated pngtypes.h; use macros instead to declare PNG_CHNK arrays.
 609   Renamed "PNG_GLOBAL_ARRAYS" to "PNG_USE_GLOBAL_ARRAYS" and made available
 610     to applications a macro "PNG_USE_LOCAL_ARRAYS".
 611   comment out (with #ifdef) all the new declarations when
 612     PNG_USE_GLOBAL_ARRAYS is defined.
 613   Added PNG_EXPORT_VAR macro to accommodate making DLL's.
 614 
 615 Version 1.0.5e [November 30, 1999]
 616   Added iCCP, iTXt, and sPLT support; added "lang" member to the png_text
 617     structure; refactored the inflate/deflate support to make adding new chunks
 618     with trailing compressed parts easier in the future, and added new functions
 619     png_free_iCCP, png_free_pCAL, png_free_sPLT, png_free_text, png_get_iCCP,
 620     png_get_spalettes, png_set_iCCP, png_set_spalettes (Eric S. Raymond).
 621   NOTE: Applications that write text chunks MUST define png_text->lang
 622     before calling png_set_text(). It must be set to NULL if you want to
 623     write tEXt or zTXt chunks.  If you want your application to be able to
 624     run with older versions of libpng, use
 625 
 626       #ifdef PNG_iTXt_SUPPORTED
 627          png_text[i].lang = NULL;
 628       #endif
 629 
 630   Changed png_get_oFFs() and png_set_oFFs() to use signed rather than unsigned
 631     offsets (Eric S. Raymond).
 632   Combined PNG_READ_cHNK_SUPPORTED and PNG_WRITE_cHNK_SUPPORTED macros into
 633     PNG_cHNK_SUPPORTED and combined the three types of PNG_text_SUPPORTED
 634     macros, leaving the separate macros also available.
 635   Removed comments on #endifs at the end of many short, non-nested #if-blocks.
 636 
 637 Version 1.0.5f [December 6, 1999]
 638   Changed makefile.solaris to issue a warning about potential problems when
 639     the ucb "ld" is in the path ahead of the ccs "ld".
 640   Removed "- [date]" from the "synopsis" line in libpng.3 and libpngpf.3.
 641   Added sCAL chunk support (Eric S. Raymond).
 642 
 643 Version 1.0.5g [December 7, 1999]
 644   Fixed "png_free_spallettes" typo in png.h
 645   Added code to handle new chunks in pngpread.c
 646   Moved PNG_CHNK string macro definitions outside of PNG_NO_EXTERN block
 647   Added "translated_key" to png_text structure and png_write_iTXt().
 648   Added code in pngwrite.c to work around a newly discovered zlib bug.
 649 
 650 Version 1.0.5h [December 10, 1999]
 651   NOTE: regarding the note for version 1.0.5e, the following must also
 652     be included in your code:
 653         png_text[i].translated_key = NULL;
 654   Unknown chunk handling is now supported.
 655   Option to eliminate all floating point support was added.  Some new
 656     fixed-point functions such as png_set_gAMA_fixed() were added.
 657   Expanded tabs and removed trailing blanks in source files.
 658 
 659 Version 1.0.5i [December 13, 1999]
 660   Added some type casts to silence compiler warnings.
 661   Renamed "png_free_spalette" to "png_free_spalettes" for consistency.
 662   Removed leading blanks from a #define in pngvcrd.c
 663   Added some parameters to the new png_set_keep_unknown_chunks() function.
 664   Added a test for up->location != 0 in the first instance of writing
 665     unknown chunks in pngwrite.c
 666   Changed "num" to "i" in png_free_spalettes() and png_free_unknowns() to
 667     prevent recursion.
 668   Added png_free_hIST() function.
 669   Various patches to fix bugs in the sCAL and integer cHRM processing,
 670     and to add some convenience macros for use with sCAL.
 671 
 672 Version 1.0.5j [December 21, 1999]
 673   Changed "unit" parameter of png_write_sCAL from png_byte to int, to work
 674     around buggy compilers.
 675   Added new type "png_fixed_point" for integers that hold float*100000 values
 676   Restored backward compatibility of tEXt/zTXt chunk processing:
 677     Restored the first four members of png_text to the same order as v.1.0.5d.
 678     Added members "lang_key" and "itxt_length" to png_text struct.  Set
 679     text_length=0 when "text" contains iTXt data.  Use the "compression"
 680     member to distinguish among tEXt/zTXt/iTXt types.  Added
 681     PNG_ITXT_COMPRESSION_NONE (1) and PNG_ITXT_COMPRESSION_zTXt(2) macros.
 682     The "Note" above, about backward incompatibility of libpng-1.0.5e, no
 683     longer applies.
 684   Fixed png_read|write_iTXt() to read|write parameters in the right order,
 685     and to write the iTXt chunk after IDAT if it appears in the end_ptr.
 686   Added pnggccrd.c, version of pngvcrd.c Intel assembler for gcc (Greg Roelofs)
 687   Reversed the order of trying to write floating-point and fixed-point gAMA.
 688 
 689 Version 1.0.5k [December 27, 1999]
 690   Added many parentheses, e.g., "if (a && b & c)" becomes "if (a && (b & c))"
 691   Added png_handle_as_unknown() function (Glenn)
 692   Added png_free_chunk_list() function and chunk_list and num_chunk_list members
 693     of png_ptr.
 694   Eliminated erroneous warnings about multiple sPLT chunks and sPLT-after-PLTE.
 695   Fixed a libpng-1.0.5h bug in pngrutil.c that was issuing erroneous warnings
 696     about ignoring incorrect gAMA with sRGB (gAMA was in fact not ignored)
 697   Added png_free_tRNS(); png_set_tRNS() now malloc's its own trans array (ESR).
 698   Define png_get_int_32 when oFFs chunk is supported as well as when pCAL is.
 699   Changed type of proflen from png_int_32 to png_uint_32 in png_get_iCCP().
 700 
 701 Version 1.0.5l [January 1, 2000]
 702   Added functions png_set_read_user_chunk_fn() and png_get_user_chunk_ptr()
 703     for setting a callback function to handle unknown chunks and for
 704     retrieving the associated user pointer (Glenn).
 705 
 706 Version 1.0.5m [January 7, 2000]
 707   Added high-level functions png_read_png(), png_write_png(), png_free_pixels().
 708 
 709 Version 1.0.5n [January 9, 2000]
 710   Added png_free_PLTE() function, and modified png_set_PLTE() to malloc its
 711     own memory for info_ptr->palette.  This makes it safe for the calling
 712     application to free its copy of the palette any time after it calls
 713     png_set_PLTE().
 714 
 715 Version 1.0.5o [January 20, 2000]
 716   Cosmetic changes only (removed some trailing blanks and TABs)
 717 
 718 Version 1.0.5p [January 31, 2000]
 719   Renamed pngdll.mak to makefile.bd32
 720   Cosmetic changes in pngtest.c
 721 
 722 Version 1.0.5q [February 5, 2000]
 723   Relocated the makefile.solaris warning about PATH problems.
 724   Fixed pngvcrd.c bug by pushing/popping registers in mmxsupport (Bruce Oberg)
 725   Revised makefile.gcmmx
 726   Added PNG_SETJMP_SUPPORTED, PNG_SETJMP_NOT_SUPPORTED, and PNG_ABORT() macros
 727 
 728 Version 1.0.5r [February 7, 2000]
 729   Removed superfluous prototype for png_get_itxt from png.h
 730   Fixed a bug in pngrtran.c that improperly expanded the background color.
 731   Return *num_text=0 from png_get_text() when appropriate, and fix documentation
 732     of png_get_text() in libpng.txt/libpng.3.
 733 
 734 Version 1.0.5s [February 18, 2000]
 735   Added "png_jmp_env()" macro to pngconf.h, to help people migrate to the
 736     new error handler that's planned for the next libpng release, and changed
 737     example.c, pngtest.c, and contrib programs to use this macro.
 738   Revised some of the DLL-export macros in pngconf.h (Greg Roelofs)
 739   Fixed a bug in png_read_png() that caused it to fail to expand some images
 740     that it should have expanded.
 741   Fixed some mistakes in the unused and undocumented INCH_CONVERSIONS functions
 742     in pngget.c
 743   Changed the allocation of palette, history, and trans arrays back to
 744     the version 1.0.5 method (linking instead of copying) which restores
 745     backward compatibility with version 1.0.5.  Added some remarks about
 746     that in example.c.  Added "free_me" member to info_ptr and png_ptr
 747     and added png_free_data() function.
 748   Updated makefile.linux and makefile.gccmmx to make directories conditionally.
 749   Made cosmetic changes to pngasmrd.h
 750   Added png_set_rows() and png_get_rows(), for use with png_read|write_png().
 751   Modified png_read_png() to allocate info_ptr->row_pointers only if it
 752     hasn't already been allocated.
 753 
 754 Version 1.0.5t [March 4, 2000]
 755   Changed png_jmp_env() migration aiding macro to png_jmpbuf().
 756   Fixed "interlace" typo (should be "interlaced") in contrib/gregbook/read2-x.c
 757   Fixed bug with use of PNG_BEFORE_IHDR bit in png_ptr->mode, introduced when
 758     PNG_FLAG_HAVE_CHUNK_HEADER was moved into png_ptr->mode in version 1.0.5b
 759   Files in contrib/gregbook were revised to use png_jmpbuf() and to select
 760     a 24-bit visual if one is available, and to allow abbreviated options.
 761   Files in contrib/pngminus were revised to use the png_jmpbuf() macro.
 762   Removed spaces in makefile.linux and makefile.gcmmx, introduced in 1.0.5s
 763 
 764 Version 1.0.5u [March 5, 2000]
 765   Simplified the code that detects old png.h in png.c and pngtest.c
 766   Renamed png_spalette (_p, _pp) to png_sPLT_t (_tp, _tpp)
 767   Increased precision of rgb_to_gray calculations from 8 to 15 bits and
 768     added png_set_rgb_to_gray_fixed() function.
 769   Added makefile.bc32 (32-bit Borland C++, C mode)
 770 
 771 Version 1.0.5v [March 11, 2000]
 772   Added some parentheses to the png_jmpbuf macro definition.
 773   Updated references to the zlib home page, which has moved to freesoftware.com.
 774   Corrected bugs in documentation regarding png_read_row() and png_write_row().
 775   Updated documentation of png_rgb_to_gray calculations in libpng.3/libpng.txt.
 776   Renamed makefile.borland,turboc3 back to makefile.bor,tc3 as in version 1.0.3,
 777     revised borland makefiles; added makefile.ibmvac3 and makefile.gcc (Cosmin)
 778 
 779 Version 1.0.6 [March 20, 2000]
 780   Minor revisions of makefile.bor, libpng.txt, and gregbook/rpng2-win.c
 781   Added makefile.sggcc (SGI IRIX with gcc)
 782 
 783 Version 1.0.6d [April 7, 2000]
 784   Changed sprintf() to strcpy() in png_write_sCAL_s() to work without STDIO
 785   Added data_length parameter to png_decompress_chunk() function
 786   Revised documentation to remove reference to abandoned png_free_chnk functions
 787   Fixed an error in png_rgb_to_gray_fixed()
 788   Revised example.c, usage of png_destroy_write_struct().
 789   Renamed makefile.ibmvac3 to makefile.ibmc, added libpng.icc IBM project file
 790   Added a check for info_ptr->free_me&PNG_FREE_TEXT when freeing text in png.c
 791   Simplify png_sig_bytes() function to remove use of non-ISO-C strdup().
 792 
 793 Version 1.0.6e [April 9, 2000]
 794   Added png_data_freer() function.
 795   In the code that checks for over-length tRNS chunks, added check of
 796     info_ptr->num_trans as well as png_ptr->num_trans (Matthias Benckmann)
 797   Minor revisions of libpng.txt/libpng.3.
 798   Check for existing data and free it if the free_me flag is set, in png_set_*()
 799     and png_handle_*().
 800   Only define PNG_WEIGHTED_FILTERS_SUPPORTED when PNG_FLOATING_POINT_SUPPORTED
 801     is defined.
 802   Changed several instances of PNG_NO_CONSOLE_ID to PNG_NO_STDIO in pngrutil.c
 803     and mentioned the purposes of the two macros in libpng.txt/libpng.3.
 804 
 805 Version 1.0.6f [April 14, 2000]
 806   Revised png_set_iCCP() and png_set_rows() to avoid prematurely freeing data.
 807   Add checks in png_set_text() for NULL members of the input text structure.
 808   Revised libpng.txt/libpng.3.
 809   Removed superfluous prototype for png_set_iTXt from png.h
 810   Removed "else" from pngread.c, after png_error(), and changed "0" to "length".
 811   Changed several png_errors about malformed ancillary chunks to png_warnings.
 812 
 813 Version 1.0.6g [April 24, 2000]
 814   Added png_pass-* arrays to pnggccrd.c when PNG_USE_LOCAL_ARRAYS is defined.
 815   Relocated paragraph about png_set_background() in libpng.3/libpng.txt
 816     and other revisions (Matthias Benckmann)
 817   Relocated info_ptr->free_me, png_ptr->free_me, and other info_ptr and
 818     png_ptr members to restore binary compatibility with libpng-1.0.5
 819     (breaks compatibility with libpng-1.0.6).
 820 
 821 Version 1.0.6h [April 24, 2000]
 822   Changed shared library so-number pattern from 2.x.y.z to xy.z (this builds
 823     libpng.so.10 & libpng.so.10.6h instead of libpng.so.2 & libpng.so.2.1.0.6h)
 824     This is a temporary change for test purposes.
 825 
 826 Version 1.0.6i [May 2, 2000]
 827   Rearranged some members at the end of png_info and png_struct, to put
 828     unknown_chunks_num and free_me within the original size of the png_structs
 829     and free_me, png_read_user_fn, and png_free_fn within the original png_info,
 830     because some old applications allocate the structs directly instead of
 831     using png_create_*().
 832   Added documentation of user memory functions in libpng.txt/libpng.3
 833   Modified png_read_png so that it will use user_allocated row_pointers
 834     if present, unless free_me directs that it be freed, and added description
 835     of the use of png_set_rows() and png_get_rows() in libpng.txt/libpng.3.
 836   Added PNG_LEGACY_SUPPORTED macro, and #ifdef out all new (since version
 837     1.00) members of png_struct and png_info, to regain binary compatibility
 838     when you define this macro.  Capabilities lost in this event
 839     are user transforms (new in version 1.0.0),the user transform pointer
 840     (new in version 1.0.2), rgb_to_gray (new in 1.0.5), iCCP, sCAL, sPLT,
 841     the high-level interface, and unknown chunks support (all new in 1.0.6).
 842     This was necessary because of old applications that allocate the structs
 843     directly as authors were instructed to do in libpng-0.88 and earlier,
 844     instead of using png_create_*().
 845   Added modes PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT which
 846     can be used to detect codes that directly allocate the structs, and
 847     code to check these modes in png_read_init() and png_write_init() and
 848     generate a libpng error if the modes aren't set and PNG_LEGACY_SUPPORTED
 849     was not defined.
 850   Added makefile.intel and updated makefile.watcom (Pawel Mrochen)
 851 
 852 Version 1.0.6j [May 3, 2000]
 853   Overloaded png_read_init() and png_write_init() with macros that convert
 854     calls to png_read_init_2() or png_write_init_2() that check the version
 855     and structure sizes.
 856 
 857 Version 1.0.7beta11 [May 7, 2000]
 858   Removed the new PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT modes
 859     which are no longer used.
 860   Eliminated the three new members of png_text when PNG_LEGACY_SUPPORTED is
 861     defined or when neither PNG_READ_iTXt_SUPPORTED nor PNG_WRITE_iTXT_SUPPORTED
 862     is defined.
 863   Made PNG_NO_READ|WRITE_iTXt the default setting, to avoid memory
 864     overrun when old applications fill the info_ptr->text structure directly.
 865   Added PNGAPI macro, and added it to the definitions of all exported functions.
 866   Relocated version macro definitions ahead of the includes of zlib.h and
 867     pngconf.h in png.h.
 868 
 869 Version 1.0.7beta12 [May 12, 2000]
 870   Revised pngset.c to avoid a problem with expanding the png_debug macro.
 871   Deleted some extraneous defines from pngconf.h
 872   Made PNG_NO_CONSOLE_IO the default condition when PNG_BUILD_DLL is defined.
 873   Use MSC _RPTn debugging instead of fprintf if _MSC_VER is defined.
 874   Added png_access_version_number() function.
 875   Check for mask&PNG_FREE_CHNK (for TEXT, SCAL, PCAL) in png_free_data().
 876   Expanded libpng.3/libpng.txt information about png_data_freer().
 877 
 878 Version 1.0.7beta14 [May 17, 2000] (beta13 was not published)
 879   Changed pnggccrd.c and pngvcrd.c to handle bad adaptive filter types as
 880     warnings instead of errors, as pngrutil.c does.
 881   Set the PNG_INFO_IDAT valid flag in png_set_rows() so png_write_png()
 882     will actually write IDATs.
 883   Made the default PNG_USE_LOCAL_ARRAYS depend on PNG_DLL instead of WIN32.
 884   Make png_free_data() ignore its final parameter except when freeing data
 885     that can have multiple instances (text, sPLT, unknowns).
 886   Fixed a new bug in png_set_rows().
 887   Removed info_ptr->valid tests from png_free_data(), as in version 1.0.5.
 888   Added png_set_invalid() function.
 889   Fixed incorrect illustrations of png_destroy_write_struct() in example.c.
 890 
 891 Version 1.0.7beta15 [May 30, 2000]
 892   Revised the deliberately erroneous Linux setjmp code in pngconf.h to produce
 893     fewer error messages.
 894   Rearranged checks for Z_OK to check the most likely path first in pngpread.c
 895     and pngwutil.c.
 896   Added checks in pngtest.c for png_create_*() returning NULL, and mentioned
 897     in libpng.txt/libpng.3 the need for applications to check this.
 898   Changed names of png_default_*() functions in pngtest to pngtest_*().
 899   Changed return type of png_get_x|y_offset_*() from png_uint_32 to png_int_32.
 900   Fixed some bugs in the unused PNG_INCH_CONVERSIONS functions in pngget.c
 901   Set each pointer to NULL after freeing it in png_free_data().
 902   Worked around a problem in pngconf.h; AIX's strings.h defines an "index"
 903     macro that conflicts with libpng's png_color_16.index. (Dimitri
 904     Papadapoulos)
 905   Added "msvc" directory with MSVC++ project files (Simon-Pierre Cadieux).
 906 
 907 Version 1.0.7beta16 [June 4, 2000]
 908   Revised the workaround of AIX string.h "index" bug.
 909   Added a check for overlength PLTE chunk in pngrutil.c.
 910   Added PNG_NO_POINTER_INDEXING macro to use array-indexing instead of pointer
 911     indexing in pngrutil.c and pngwutil.c to accommodate a buggy compiler.
 912   Added a warning in png_decompress_chunk() when it runs out of data, e.g.
 913     when it tries to read an erroneous PhotoShop iCCP chunk.
 914   Added PNG_USE_DLL macro.
 915   Revised the copyright/disclaimer/license notice.
 916   Added contrib/msvctest directory
 917 
 918 Version 1.0.7rc1 [June 9, 2000]
 919   Corrected the definition of PNG_TRANSFORM_INVERT_ALPHA  (0x0400 not 0x0200)
 920   Added contrib/visupng directory (Willem van Schaik)
 921 
 922 Version 1.0.7beta18 [June 23, 2000]
 923   Revised PNGAPI definition, and pngvcrd.c to work with __GCC__
 924     and do not redefine PNGAPI if it is passed in via a compiler directive.
 925   Revised visupng/PngFile.c to remove returns from within the Try block.
 926   Removed leading underscores from "_PNG_H" and "_PNG_SAVE_BSD_SOURCE" macros.
 927   Updated contrib/visupng/cexcept.h to version 1.0.0.
 928   Fixed bugs in pngwrite.c and pngwutil.c that prevented writing iCCP chunks.
 929 
 930 Version 1.0.7rc2 [June 28, 2000]
 931   Updated license to include disclaimers required by UCITA.
 932   Fixed "DJBPP" typo in pnggccrd.c introduced in beta18.
 933 
 934 Version 1.0.7 [July 1, 2000]
 935   Revised the definition of "trans_values" in libpng.3/libpng.txt
 936 
 937 Version 1.0.8beta1 [July 8, 2000]
 938   Added png_free(png_ptr, key) two places in pngpread.c to stop memory leaks.
 939   Changed PNG_NO_STDIO to PNG_NO_CONSOLE_IO, several places in pngrutil.c and
 940     pngwutil.c.
 941   Changed PNG_EXPORT_VAR to use PNG_IMPEXP, in pngconf.h.
 942   Removed unused "#include <assert.h>" from png.c
 943   Added WindowsCE support.
 944   Revised pnggccrd.c to work with gcc-2.95.2 and in the Cygwin environment.
 945 
 946 Version 1.0.8beta2 [July 10, 2000]
 947   Added project files to the wince directory and made further revisions
 948     of pngtest.c, pngrio.c, and pngwio.c in support of WindowsCE.
 949 
 950 Version 1.0.8beta3 [July 11, 2000]
 951   Only set the PNG_FLAG_FREE_TRNS or PNG_FREE_TRNS flag in png_handle_tRNS()
 952     for indexed-color input files to avoid potential double-freeing trans array
 953     under some unusual conditions; problem was introduced in version 1.0.6f.
 954   Further revisions to pngtest.c and files in the wince subdirectory.
 955 
 956 Version 1.0.8beta4 [July 14, 2000]
 957   Added the files pngbar.png and pngbar.jpg to the distribution.
 958   Added makefile.cygwin, and cygwin support in pngconf.h
 959   Added PNG_NO_ZALLOC_ZERO macro (makes png_zalloc skip zeroing memory)
 960 
 961 Version 1.0.8rc1 [July 16, 2000]
 962   Revised png_debug() macros and statements to eliminate compiler warnings.
 963 
 964 Version 1.0.8 [July 24, 2000]
 965   Added png_flush() in pngwrite.c, after png_write_IEND().
 966   Updated makefile.hpux to build a shared library.
 967 
 968 Version 1.0.9beta1 [November 10, 2000]
 969   Fixed typo in scripts/makefile.hpux
 970   Updated makevms.com in scripts and contrib/* and contrib/* (Martin Zinser)
 971   Fixed seqence-point bug in contrib/pngminus/png2pnm (Martin Zinser)
 972   Changed "cdrom.com" in documentation to "libpng.org"
 973   Revised pnggccrd.c to get it all working, and updated makefile.gcmmx (Greg).
 974   Changed type of "params" from voidp to png_voidp in png_read|write_png().
 975   Make sure PNGAPI and PNG_IMPEXP are defined in pngconf.h.
 976   Revised the 3 instances of WRITEFILE in pngtest.c.
 977   Relocated "msvc" and "wince" project subdirectories into "dll" subdirectory.
 978   Updated png.rc in dll/msvc project
 979   Revised makefile.dec to define and use LIBPATH and INCPATH
 980   Increased size of global png_libpng_ver[] array from 12 to 18 chars.
 981   Made global png_libpng_ver[], png_sig[] and png_pass_*[] arrays const.
 982   Removed duplicate png_crc_finish() from png_handle_bKGD() function.
 983   Added a warning when application calls png_read_update_info() multiple times.
 984   Revised makefile.cygwin
 985   Fixed bugs in iCCP support in pngrutil.c and pngwutil.c.
 986   Replaced png_set_empty_plte_permitted() with png_permit_mng_features().
 987 
 988 Version 1.0.9beta2 [November 19, 2000]
 989   Renamed the "dll" subdirectory "projects".
 990   Added borland project files to "projects" subdirectory.
 991   Set VS_FF_PRERELEASE and VS_FF_PATCHED flags in msvc/png.rc when appropriate.
 992   Add error message in png_set_compression_buffer_size() when malloc fails.
 993 
 994 Version 1.0.9beta3 [November 23, 2000]
 995   Revised PNG_LIBPNG_BUILD_TYPE macro in png.h, used in the msvc project.
 996   Removed the png_flush() in pngwrite.c that crashes some applications
 997     that don't set png_output_flush_fn.
 998   Added makefile.macosx and makefile.aix to scripts directory.
 999 
1000 Version 1.0.9beta4 [December 1, 2000]
1001   Change png_chunk_warning to png_warning in png_check_keyword().
1002   Increased the first part of msg buffer from 16 to 18 in png_chunk_error().
1003 
1004 Version 1.0.9beta5 [December 15, 2000]
1005   Added support for filter method 64 (for PNG datastreams embedded in MNG).
1006 
1007 Version 1.0.9beta6 [December 18, 2000]
1008   Revised png_set_filter() to accept filter method 64 when appropriate.
1009   Added new PNG_HAVE_PNG_SIGNATURE bit to png_ptr->mode and use it to
1010     help prevent applications from using MNG features in PNG datastreams.
1011   Added png_permit_mng_features() function.
1012   Revised libpng.3/libpng.txt.  Changed "filter type" to "filter method".
1013 
1014 Version 1.0.9rc1 [December 23, 2000]
1015   Revised test for PNG_HAVE_PNG_SIGNATURE in pngrutil.c
1016   Fixed error handling of unknown compression type in png_decompress_chunk().
1017   In pngconf.h, define __cdecl when _MSC_VER is defined.
1018 
1019 Version 1.0.9beta7 [December 28, 2000]
1020   Changed PNG_TEXT_COMPRESSION_zTXt to PNG_COMPRESSION_TYPE_BASE several places.
1021   Revised memory management in png_set_hIST and png_handle_hIST in a backward
1022     compatible manner.  PLTE and tRNS were revised similarly.
1023   Revised the iCCP chunk reader to ignore trailing garbage.
1024 
1025 Version 1.0.9beta8 [January 12, 2001]
1026   Moved pngasmrd.h into pngconf.h.
1027   Improved handling of out-of-spec garbage iCCP chunks generated by PhotoShop.
1028 
1029 Version 1.0.9beta9 [January 15, 2001]
1030   Added png_set_invalid, png_permit_mng_features, and png_mmx_supported to
1031     wince and msvc project module definition files.
1032   Minor revision of makefile.cygwin.
1033   Fixed bug with progressive reading of narrow interlaced images in pngpread.c
1034 
1035 Version 1.0.9beta10 [January 16, 2001]
1036   Do not typedef png_FILE_p in pngconf.h when PNG_NO_STDIO is defined.
1037   Fixed "png_mmx_supported" typo in project definition files.
1038 
1039 Version 1.0.9beta11 [January 19, 2001]
1040   Updated makefile.sgi to make shared library.
1041   Removed png_mmx_support() function and disabled PNG_MNG_FEATURES_SUPPORTED
1042     by default, for the benefit of DLL forward compatibility.  These will
1043     be re-enabled in version 1.2.0.
1044 
1045 Version 1.0.9rc2 [January 22, 2001]
1046   Revised cygwin support.
1047 
1048 Version 1.0.9 [January 31, 2001]
1049   Added check of cygwin's ALL_STATIC in pngconf.h
1050   Added "-nommx" parameter to contrib/gregbook/rpng2-win and rpng2-x demos.
1051 
1052 Version 1.0.10beta1 [March 14, 2001]
1053   Revised makefile.dec, makefile.sgi, and makefile.sggcc; added makefile.hpgcc.
1054   Reformatted libpng.3 to eliminate bad line breaks.
1055   Added checks for _mmx_supported in the read_filter_row function of pnggccrd.c
1056   Added prototype for png_mmx_support() near the top of pnggccrd.c
1057   Moved some error checking from png_handle_IHDR to png_set_IHDR.
1058   Added PNG_NO_READ_SUPPORTED and PNG_NO_WRITE_SUPPORTED macros.
1059   Revised png_mmx_support() function in pnggccrd.c
1060   Restored version 1.0.8 PNG_WRITE_EMPTY_PLTE_SUPPORTED behavior in pngwutil.c
1061   Fixed memory leak in contrib/visupng/PngFile.c
1062   Fixed bugs in png_combine_row() in pnggccrd.c and pngvcrd.c (C version)
1063   Added warnings when retrieving or setting gamma=0.
1064   Increased the first part of msg buffer from 16 to 18 in png_chunk_warning().
1065 
1066 Version 1.0.10rc1 [March 23, 2001]
1067   Changed all instances of memcpy, strcpy, and strlen to png_memcpy, png_strcpy,
1068     and png_strlen.
1069   Revised png_mmx_supported() function in pnggccrd.c to return proper value.
1070   Fixed bug in progressive reading (pngpread.c) with small images (height < 8).
1071 
1072 Version 1.0.10 [March 30, 2001]
1073   Deleted extraneous space (introduced in 1.0.9) from line 42 of makefile.cygwin
1074   Added beos project files (Chris Herborth)
1075 
1076 Version 1.0.11beta1 [April 3, 2001]
1077   Added type casts on several png_malloc() calls (Dimitri Papadapoulos).
1078   Removed a no-longer needed AIX work-around from pngconf.h
1079   Changed several "//" single-line comments to C-style in pnggccrd.c
1080 
1081 Version 1.0.11beta2 [April 11, 2001]
1082   Removed PNGAPI from several functions whose prototypes did not have PNGAPI.
1083   Updated scripts/pngos2.def
1084 
1085 Version 1.0.11beta3 [April 14, 2001]
1086   Added checking the results of many instances of png_malloc() for NULL
1087 
1088 Version 1.0.11beta4 [April 20, 2001]
1089   Undid the changes from version 1.0.11beta3.  Added a check for NULL return
1090     from user's malloc_fn().
1091   Removed some useless type casts of the NULL pointer.
1092   Added makefile.netbsd
1093 
1094 Version 1.0.11 [April 27, 2001]
1095   Revised makefile.netbsd
1096 
1097 Version 1.0.12beta1 [May 14, 2001]
1098   Test for Windows platform in pngconf.h when including malloc.h (Emmanuel Blot)
1099   Updated makefile.cygwin and handling of Cygwin's ALL_STATIC in pngconf.h
1100   Added some never-to-be-executed code in pnggccrd.c to quiet compiler warnings.
1101   Eliminated the png_error about apps using png_read|write_init().  Instead,
1102     libpng will reallocate the png_struct and info_struct if they are too small.
1103     This retains future binary compatibility for old applications written for
1104     libpng-0.88 and earlier.
1105 
1106 Version 1.2.0beta1 [May 6, 2001]
1107   Bumped DLLNUM to 2.
1108   Re-enabled PNG_MNG_FEATURES_SUPPORTED and enabled PNG_ASSEMBLER_CODE_SUPPORTED
1109     by default.
1110   Added runtime selection of MMX features.
1111   Added png_set_strip_error_numbers function and related macros.
1112 
1113 Version 1.2.0beta2 [May 7, 2001]
1114   Finished merging 1.2.0beta1 with version 1.0.11
1115   Added a check for attempts to read or write PLTE in grayscale PNG datastreams.
1116 
1117 Version 1.2.0beta3 [May 17, 2001]
1118   Enabled user memory function by default.
1119   Modified png_create_struct so it passes user mem_ptr to user memory allocator.
1120   Increased png_mng_features flag from png_byte to png_uint_32.
1121   Bumped shared-library (so-number) and dll-number to 3.
1122 
1123 Version 1.2.0beta4 [June 23, 2001]
1124   Check for missing profile length field in iCCP chunk and free chunk_data
1125     in case of truncated iCCP chunk.
1126   Bumped shared-library number to 3 in makefile.sgi and makefile.sggcc
1127   Bumped dll-number from 2 to 3 in makefile.cygwin
1128   Revised contrib/gregbook/rpng*-x.c to avoid a memory leak and to exit cleanly
1129     if user attempts to run it on an 8-bit display.
1130   Updated contrib/gregbook
1131   Use png_malloc instead of png_zalloc to allocate palette in pngset.c
1132   Updated makefile.ibmc
1133   Added some typecasts to eliminate gcc 3.0 warnings.  Changed prototypes
1134     of png_write_oFFS width and height from png_uint_32 to png_int_32.
1135   Updated example.c
1136   Revised prototypes for png_debug_malloc and png_debug_free in pngtest.c
1137 
1138 Version 1.2.0beta5 [August 8, 2001]
1139   Revised contrib/gregbook
1140   Revised makefile.gcmmx
1141   Revised pnggccrd.c to conditionally compile some thread-unsafe code only
1142     when PNG_THREAD_UNSAFE_OK is defined.
1143   Added tests to prevent pngwutil.c from writing a bKGD or tRNS chunk with
1144     value exceeding 2^bit_depth-1
1145   Revised makefile.sgi and makefile.sggcc
1146   Replaced calls to fprintf(stderr,...) with png_warning() in pnggccrd.c
1147   Removed restriction that do_invert_mono only operate on 1-bit opaque files
1148 
1149 Version 1.2.0 [September 1, 2001]
1150   Changed a png_warning() to png_debug() in pnggccrd.c
1151   Fixed contrib/gregbook/rpng-x.c, rpng2-x.c to avoid crash with XFreeGC().
1152 
1153 Version 1.2.1beta1 [October 19, 2001]
1154   Revised makefile.std in contrib/pngminus
1155   Include background_1 in png_struct regardless of gamma support.
1156   Revised makefile.netbsd and makefile.macosx, added makefile.darwin.
1157   Revised example.c to provide more details about using row_callback().
1158 
1159 Version 1.2.1beta2 [October 25, 2001]
1160   Added type cast to each NULL appearing in a function call, except for
1161     WINCE functions.
1162   Added makefile.so9.
1163 
1164 Version 1.2.1beta3 [October 27, 2001]
1165   Removed type casts from all NULLs.
1166   Simplified png_create_struct_2().
1167 
1168 Version 1.2.1beta4 [November 7, 2001]
1169   Revised png_create_info_struct() and png_creat_struct_2().
1170   Added error message if png_write_info() was omitted.
1171   Type cast NULLs appearing in function calls when _NO_PROTO or
1172     PNG_TYPECAST_NULL is defined.
1173 
1174 Version 1.2.1rc1 [November 24, 2001]
1175   Type cast NULLs appearing in function calls except when PNG_NO_TYPECAST_NULL
1176     is defined.
1177   Changed typecast of "size" argument to png_size_t in pngmem.c calls to
1178     the user malloc_fn, to agree with the prototype in png.h
1179   Added a pop/push operation to pnggccrd.c, to preserve Eflag (Maxim Sobolev)
1180   Updated makefile.sgi to recognize LIBPATH and INCPATH.
1181   Updated various makefiles so "make clean" does not remove previous major
1182     version of the shared library.
1183 
1184 Version 1.2.1rc2 [December 4, 2001]
1185   Always allocate 256-entry internal palette, hist, and trans arrays, to
1186     avoid out-of-bounds memory reference caused by invalid PNG datastreams.
1187   Added a check for prefix_length > data_length in iCCP chunk handler.
1188 
1189 Version 1.2.1 [December 7, 2001]
1190   None.
1191 
1192 Version 1.2.2beta1 [February 22, 2002]
1193   Fixed a bug with reading the length of iCCP profiles (Larry Reeves).
1194   Revised makefile.linux, makefile.gcmmx, and makefile.sgi to generate
1195     libpng.a, libpng12.so (not libpng.so.3), and libpng12/png.h
1196   Revised makefile.darwin to remove "-undefined suppress" option.
1197   Added checks for gamma and chromaticity values over 21474.83, which exceed
1198     the limit for PNG unsigned 32-bit integers when encoded.
1199   Revised calls to png_create_read_struct() and png_create_write_struct()
1200     for simpler debugging.
1201   Revised png_zalloc() so zlib handles errors (uses PNG_FLAG_MALLOC_NULL_MEM_OK)
1202 
1203 Version 1.2.2beta2 [February 23, 2002]
1204   Check chunk_length and idat_size for invalid (over PNG_MAX_UINT) lengths.
1205   Check for invalid image dimensions in png_get_IHDR.
1206   Added missing "fi;" in the install target of the SGI makefiles.
1207   Added install-static to all makefiles that make shared libraries.
1208   Always do gamma compensation when image is partially transparent.
1209 
1210 Version 1.2.2beta3 [March 7, 2002]
1211   Compute background.gray and background_1.gray even when color_type is RGB
1212     in case image gets reduced to gray later.
1213   Modified shared-library makefiles to install pkgconfig/libpngNN.pc.
1214   Export (with PNGAPI) png_zalloc, png_zfree, and png_handle_as_unknown
1215   Removed unused png_write_destroy_info prototype from png.h
1216   Eliminated incorrect use of width_mmx from pnggccrd.c in pixel_bytes == 8 case
1217   Added install-shared target to all makefiles that make shared libraries.
1218   Stopped a double free of palette, hist, and trans when not using free_me.
1219   Added makefile.32sunu for Sun Ultra 32 and makefile.64sunu for Sun Ultra 64.
1220 
1221 Version 1.2.2beta4 [March 8, 2002]
1222   Compute background.gray and background_1.gray even when color_type is RGB
1223     in case image gets reduced to gray later (Jason Summers).
1224   Relocated a misplaced /bin/rm in the "install-shared" makefile targets
1225   Added PNG_1_0_X macro which can be used to build a 1.0.x-compatible library.
1226 
1227 Version 1.2.2beta5 [March 26, 2002]
1228   Added missing PNGAPI to several function definitions.
1229   Check for invalid bit_depth or color_type in png_get_IHDR(), and
1230     check for missing PLTE or IHDR in png_push_read_chunk() (Matthias Clasen).
1231   Revised iTXt support to accept NULL for lang and lang_key.
1232   Compute gamma for color components of background even when color_type is gray.
1233   Changed "()" to "{}" in scripts/libpng.pc.in.
1234   Revised makefiles to put png.h and pngconf.h only in $prefix/include/libpngNN
1235   Revised makefiles to make symlink to libpng.so.NN in addition to libpngNN.so
1236 
1237 Version 1.2.2beta6 [March 31, 2002]
1238 
1239 Version 1.0.13beta1 [March 31, 2002]
1240   Prevent png_zalloc() from trying to memset memory that it failed to acquire.
1241   Add typecasts of PNG_MAX_UINT in pngset_cHRM_fixed() (Matt Holgate).
1242   Ensure that the right function (user or default) is used to free the
1243     png_struct after an error in png_create_read_struct_2().
1244 
1245 Version 1.2.2rc1 [April 7, 2002]
1246 
1247 Version 1.0.13rc1 [April 7, 2002]
1248   Save the ebx register in pnggccrd.c (Sami Farin)
1249   Add "mem_ptr = png_ptr->mem_ptr" in png_destroy_write_struct() (Paul Gardner).
1250   Updated makefiles to put headers in include/libpng and remove old include/*.h.
1251 
1252 Version 1.2.2 [April 15, 2002]
1253 
1254 Version 1.0.13 [April 15, 2002]
1255   Revised description of png_set_filter() in libpng.3/libpng.txt.
1256   Revised makefile.netbsd and added makefile.neNNbsd and makefile.freebsd
1257 
1258 Version 1.0.13patch01 [April 17, 2002]
1259 
1260 Version 1.2.2patch01 [April 17, 2002]
1261   Changed ${PNGMAJ}.${PNGVER} bug to ${PNGVER} in makefile.sgi and
1262     makefile.sggcc
1263   Fixed VER -> PNGVER typo in makefile.macosx and added install-static to
1264     install
1265   Added install: target to makefile.32sunu and makefile.64sunu
1266 
1267 Version 1.0.13patch03 [April 18, 2002]
1268 
1269 Version 1.2.2patch03 [April 18, 2002]
1270   Revised 15 makefiles to link libpng.a to libpngNN.a and the include libpng
1271   subdirectory to libpngNN subdirectory without the full pathname.
1272   Moved generation of libpng.pc from "install" to "all" in 15 makefiles.
1273 
1274 Version 1.2.3rc1 [April 28, 2002]
1275   Added install-man target to 15 makefiles (Dimitri Papadopolous-Orfanos).
1276   Added $(DESTDIR) feature to 24 makefiles (Tim Mooney)
1277   Fixed bug with $prefix, should be $(prefix) in makefile.hpux.
1278   Updated cygwin-specific portion of pngconf.h and revised makefile.cygwin
1279   Added a link from libpngNN.pc to libpng.pc in 15 makefiles.
1280   Added links from include/libpngNN/*.h to include/*.h in 24 makefiles.
1281   Revised makefile.darwin to make relative links without full pathname.
1282   Added setjmp() at the end of png_create_*_struct_2() in case user forgets
1283     to put one in their application.
1284   Restored png_zalloc() and png_zfree() prototypes to version 1.2.1 and
1285     removed them from module definition files.
1286 
1287 Version 1.2.3rc2 [May 1, 2002]
1288   Fixed bug in reporting number of channels in pngget.c and pngset.c,
1289     that was introduced in version 1.2.2beta5.
1290   Exported png_zalloc(), png_zfree(), png_default_read(), png_default_write(),
1291     png_default_flush(), and png_push_fill_buffer() and included them in
1292     module definition files.
1293   Added "libpng.pc" dependency to the "install-shared" target in 15 makefiles.
1294 
1295 Version 1.2.3rc3 [May 1, 2002]
1296   Revised prototype for png_default_flush()
1297   Remove old libpng.pc and libpngNN.pc before installing new ones.
1298 
1299 Version 1.2.3rc4 [May 2, 2002]
1300   Typos in *.def files (png_default_read|write -> png_default_read|write_data)
1301   In makefiles, changed rm libpng.NN.pc to rm libpngNN.pc
1302   Added libpng-config and libpngNN-config and modified makefiles to install
1303     them.
1304   Changed $(MANPATH) to $(DESTDIR)$(MANPATH) in makefiles
1305   Added "Win32 DLL VB" configuration to projects/msvc/libpng.dsp
1306 
1307 Version 1.2.3rc5 [May 11, 2002]
1308   Changed "error" and "message" in prototypes to "error_message" and
1309     "warning_message" to avoid namespace conflict.
1310   Revised 15 makefiles to build libpng-config from libpng-config-*.in
1311   Once more restored png_zalloc and png_zfree to regular nonexported form.
1312   Restored png_default_read|write_data, png_default_flush, png_read_fill_buffer
1313     to nonexported form, but with PNGAPI, and removed them from module def
1314     files.
1315 
1316 Version 1.2.3rc6 [May 14, 2002]
1317   Removed "PNGAPI" from png_zalloc() and png_zfree() in png.c
1318   Changed "Gz" to "Gd" in projects/msvc/libpng.dsp and zlib.dsp.
1319   Removed leftover libpng-config "sed" script from four makefiles.
1320   Revised libpng-config creating script in 16 makefiles.
1321 
1322 Version 1.2.3 [May 22, 2002]
1323   Revised libpng-config target in makefile.cygwin.
1324   Removed description of png_set_mem_fn() from documentation.
1325   Revised makefile.freebsd.
1326   Minor cosmetic changes to 15 makefiles, e.g., $(DI) = $(DESTDIR)/$(INCDIR).
1327   Revised projects/msvc/README.txt
1328   Changed -lpng to -lpngNN in LDFLAGS in several makefiles.
1329 
1330 Version 1.2.4beta1 [May 24, 2002]
1331   Added libpng.pc and libpng-config to "all:" target in 16 makefiles.
1332   Fixed bug in 16 makefiles: $(DESTDIR)/$(LIBPATH) to $(DESTDIR)$(LIBPATH)
1333   Added missing "\" before closing double quote in makefile.gcmmx.
1334   Plugged various memory leaks; added png_malloc_warn() and png_set_text_2()
1335     functions.
1336 
1337 Version 1.2.4beta2 [June 25, 2002]
1338   Plugged memory leak of png_ptr->current_text (Matt Holgate).
1339   Check for buffer overflow before reading CRC in pngpread.c (Warwick Allison)
1340   Added -soname to the loader flags in makefile.dec, makefile.sgi, and
1341     makefile.sggcc.
1342   Added "test-installed" target to makefile.linux, makefile.gcmmx,
1343     makefile.sgi, and makefile.sggcc.
1344 
1345 Version 1.2.4beta3 [June 28, 2002]
1346   Plugged memory leak of row_buf in pngtest.c when there is a png_error().
1347   Detect buffer overflow in pngpread.c when IDAT is corrupted with extra data.
1348   Added "test-installed" target to makefile.32sunu, makefile.64sunu,
1349     makefile.beos, makefile.darwin, makefile.dec, makefile.macosx,
1350     makefile.solaris, makefile.hpux, makefile.hpgcc, and makefile.so9.
1351 
1352 Version 1.2.4rc1 and 1.0.14rc1 [July 2, 2002]
1353   Added "test-installed" target to makefile.cygwin and makefile.sco.
1354   Revised pnggccrd.c to be able to back out version 1.0.x via PNG_1_0_X macro.
1355 
1356 Version 1.2.4 and 1.0.14 [July 8, 2002]
1357   Changed png_warning() to png_error() when width is too large to process.
1358 
1359 Version 1.2.4patch01 [July 20, 2002]
1360   Revised makefile.cygwin to use DLL number 12 instead of 13.
1361 
1362 Version 1.2.5beta1 [August 6, 2002]
1363   Added code to contrib/gregbook/readpng2.c to ignore unused chunks.
1364   Replaced toucan.png in contrib/gregbook (it has been corrupt since 1.0.11)
1365   Removed some stray *.o files from contrib/gregbook.
1366   Changed png_error() to png_warning() about "Too much data" in pngpread.c
1367     and about "Extra compressed data" in pngrutil.c.
1368   Prevent png_ptr->pass from exceeding 7 in png_push_finish_row().
1369   Updated makefile.hpgcc
1370   Updated png.c and pnggccrd.c handling of return from png_mmx_support()
1371 
1372 Version 1.2.5beta2 [August 15, 2002]
1373   Only issue png_warning() about "Too much data" in pngpread.c when avail_in
1374     is nonzero.
1375   Updated makefiles to install a separate libpng.so.3 with its own rpath.
1376 
1377 Version 1.2.5rc1 and 1.0.15rc1 [August 24, 2002]
1378   Revised makefiles to not remove previous minor versions of shared libraries.
1379 
1380 Version 1.2.5rc2 and 1.0.15rc2 [September 16, 2002]
1381   Revised 13 makefiles to remove "-lz" and "-L$(ZLIBLIB)", etc., from shared
1382     library loader directive.
1383   Added missing "$OBJSDLL" line to makefile.gcmmx.
1384   Added missing "; fi" to makefile.32sunu.
1385 
1386 Version 1.2.5rc3 and 1.0.15rc3 [September 18, 2002]
1387   Revised libpng-config script.
1388 
1389 Version 1.2.5 and 1.0.15 [October 3, 2002]
1390   Revised makefile.macosx, makefile.darwin, makefile.hpgcc, and makefile.hpux,
1391     and makefile.aix.
1392   Relocated two misplaced PNGAPI lines in pngtest.c
1393 
1394 Version 1.2.6beta1 [October 22, 2002]
1395   Commented out warning about uninitialized mmx_support in pnggccrd.c.
1396   Changed "IBMCPP__" flag to "__IBMCPP__" in pngconf.h.
1397   Relocated two more misplaced PNGAPI lines in pngtest.c
1398   Fixed memory overrun bug in png_do_read_filler() with 16-bit datastreams,
1399     introduced in version 1.0.2.
1400   Revised makefile.macosx, makefile.dec, makefile.aix, and makefile.32sunu.
1401 
1402 Version 1.2.6beta2 [November 1, 2002]
1403   Added libpng-config "--ldopts" output.
1404   Added "AR=ar" and "ARFLAGS=rc" and changed "ar rc" to "$(AR) $(ARFLAGS)"
1405     in makefiles.
1406 
1407 Version 1.2.6beta3 [July 18, 2004]
1408   Reverted makefile changes from version 1.2.6beta2 and some of the changes
1409     from version 1.2.6beta1; these will be postponed until version 1.2.7.
1410     Version 1.2.6 is going to be a simple bugfix release.
1411   Changed the one instance of "ln -sf" to "ln -f -s" in each Sun makefile.
1412   Fixed potential overrun in pngerror.c by using strncpy instead of memcpy.
1413   Added "#!/bin/sh" at the top of configure, for recognition of the
1414     'x' flag under Cygwin (Cosmin).
1415   Optimized vacuous tests that silence compiler warnings, in png.c (Cosmin).
1416   Added support for PNG_USER_CONFIG, in pngconf.h (Cosmin).
1417   Fixed the special memory handler for Borland C under DOS, in pngmem.c
1418     (Cosmin).
1419   Removed some spurious assignments in pngrutil.c (Cosmin).
1420   Replaced 65536 with 65536L, and 0xffff with 0xffffL, to silence warnings
1421     on 16-bit platforms (Cosmin).
1422   Enclosed shift op expressions in parentheses, to silence warnings (Cosmin).
1423   Used proper type png_fixed_point, to avoid problems on 16-bit platforms,
1424     in png_handle_sRGB() (Cosmin).
1425   Added compression_type to png_struct, and optimized the window size
1426     inside the deflate stream (Cosmin).
1427   Fixed definition of isnonalpha(), in pngerror.c and pngrutil.c (Cosmin).
1428   Fixed handling of unknown chunks that come after IDAT (Cosmin).
1429   Allowed png_error() and png_warning() to work even if png_ptr == NULL
1430     (Cosmin).
1431   Replaced row_info->rowbytes with row_bytes in png_write_find_filter()
1432     (Cosmin).
1433   Fixed definition of PNG_LIBPNG_VER_DLLNUM (Simon-Pierre).
1434   Used PNG_LIBPNG_VER and PNG_LIBPNG_VER_STRING instead of the hardcoded
1435     values in png.c (Simon-Pierre, Cosmin).
1436   Initialized png_libpng_ver[] with PNG_LIBPNG_VER_STRING (Simon-Pierre).
1437   Replaced PNG_LIBPNG_VER_MAJOR with PNG_LIBPNG_VER_DLLNUM in png.rc
1438     (Simon-Pierre).
1439   Moved the definition of PNG_HEADER_VERSION_STRING near the definitions
1440     of the other PNG_LIBPNG_VER_... symbols in png.h (Cosmin).
1441   Relocated #ifndef PNGAPI guards in pngconf.h (Simon-Pierre, Cosmin).
1442   Updated scripts/makefile.vc(a)win32 (Cosmin).
1443   Updated the MSVC project (Simon-Pierre, Cosmin).
1444   Updated the Borland C++ Builder project (Cosmin).
1445   Avoided access to asm_flags in pngvcrd.c, if PNG_1_0_X is defined (Cosmin).
1446   Commented out warning about uninitialized mmx_support in pngvcrd.c (Cosmin).
1447   Removed scripts/makefile.bd32 and scripts/pngdef.pas (Cosmin).
1448   Added extra guard around inclusion of Turbo C memory headers, in pngconf.h
1449     (Cosmin).
1450   Renamed projects/msvc/ to projects/visualc6/, and projects/borland/ to
1451     projects/cbuilder5/ (Cosmin).
1452   Moved projects/visualc6/png32ms.def to scripts/pngw32.def,
1453     and projects/visualc6/png.rc to scripts/pngw32.rc (Cosmin).
1454   Added projects/visualc6/pngtest.dsp; removed contrib/msvctest/ (Cosmin).
1455   Changed line endings to DOS style in cbuilder5 and visualc6 files, even
1456     in the tar.* distributions (Cosmin).
1457   Updated contrib/visupng/VisualPng.dsp (Cosmin).
1458   Updated contrib/visupng/cexcept.h to version 2.0.0 (Cosmin).
1459   Added a separate distribution with "configure" and supporting files (Junichi).
1460 
1461 Version 1.2.6beta4 [July 28, 2004]
1462   Added user ability to change png_size_t via a PNG_SIZE_T macro.
1463   Added png_sizeof() and png_convert_size() functions.
1464   Added PNG_SIZE_MAX (maximum value of a png_size_t variable.
1465   Added check in png_malloc_default() for (size_t)size != (png_uint_32)size
1466     which would indicate an overflow.
1467   Changed sPLT failure action from png_error to png_warning and abandon chunk.
1468   Changed sCAL and iCCP failures from png_error to png_warning and abandon.
1469   Added png_get_uint_31(png_ptr, buf) function.
1470   Added PNG_UINT_32_MAX macro.
1471   Renamed PNG_MAX_UINT to PNG_UINT_31_MAX.
1472   Made png_zalloc() issue a png_warning and return NULL on potential
1473     overflow.
1474   Turn on PNG_NO_ZALLOC_ZERO by default in version 1.2.x
1475   Revised "clobber list" in pnggccrd.c so it will compile under gcc-3.4.
1476   Revised Borland portion of png_malloc() to return NULL or issue
1477     png_error() according to setting of PNG_FLAG_MALLOC_NULL_MEM_OK.
1478   Added PNG_NO_SEQUENTIAL_READ_SUPPORTED macro to conditionally remove
1479     sequential read support.
1480   Added some "#if PNG_WRITE_SUPPORTED" blocks.
1481   Added #ifdef to remove some redundancy in png_malloc_default().
1482   Use png_malloc instead of png_zalloc to allocate the pallete.
1483 
1484 Version 1.0.16rc1 and 1.2.6rc1 [August 4, 2004]
1485   Fixed buffer overflow vulnerability (CVE-2004-0597) in png_handle_tRNS().
1486   Fixed NULL dereference vulnerability (CVE-2004-0598) in png_handle_iCCP().
1487   Fixed integer overflow vulnerability (CVE-2004-0599) in png_read_png().
1488   Fixed some harmless bugs in png_handle_sBIT, etc, that would cause
1489     duplicate chunk types to go undetected.
1490   Fixed some timestamps in the -config version
1491   Rearranged order of processing of color types in png_handle_tRNS().
1492   Added ROWBYTES macro to calculate rowbytes without integer overflow.
1493   Updated makefile.darwin and removed makefile.macosx from scripts directory.
1494   Imposed default one million column, one-million row limits on the image
1495     dimensions, and added png_set_user_limits() function to override them.
1496   Revised use of PNG_SET_USER_LIMITS_SUPPORTED macro.
1497   Fixed wrong cast of returns from png_get_user_width|height_max().
1498   Changed some "keep the compiler happy" from empty statements to returns,
1499   Revised libpng.txt to remove 1.2.x stuff from the 1.0.x distribution
1500 
1501 Version 1.0.16rc2 and 1.2.6rc2 [August 7, 2004]
1502   Revised makefile.darwin and makefile.solaris.  Removed makefile.macosx.
1503   Revised pngtest's png_debug_malloc() to use png_malloc() instead of
1504     png_malloc_default() which is not supposed to be exported.
1505   Fixed off-by-one error in one of the conversions to PNG_ROWBYTES() in
1506     pngpread.c.  Bug was introduced in 1.2.6rc1.
1507   Fixed bug in RGB to RGBX transformation introduced in 1.2.6rc1.
1508   Fixed old bug in RGB to Gray transformation.
1509   Fixed problem with 64-bit compilers by casting arguments to abs()
1510     to png_int_32.
1511   Changed "ln -sf" to "ln -f -s" in three makefiles (solaris, sco, so9).
1512   Changed "HANDLE_CHUNK_*" to "PNG_HANDLE_CHUNK_*" (Cosmin)
1513   Added "-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)" to 15 *NIX makefiles.
1514   Added code to update the row_info->colortype in png_do_read_filler() (MSB).
1515 
1516 Version 1.0.16rc3 and 1.2.6rc3 [August 9, 2004]
1517   Eliminated use of "abs()" in testing cHRM and gAMA values, to avoid
1518     trouble with some 64-bit compilers.  Created PNG_OUT_OF_RANGE() macro.
1519   Revised documentation of png_set_keep_unknown_chunks().
1520   Check handle_as_unknown status in pngpread.c, as in pngread.c previously.
1521   Moved  "PNG_HANDLE_CHUNK_*" macros out of PNG_INTERNAL section of png.h
1522   Added "rim" definitions for CONST4 and CONST6 in pnggccrd.c
1523 
1524 Version 1.0.16rc4 and 1.2.6rc4 [August 10, 2004]
1525   Fixed mistake in pngtest.c introduced in 1.2.6rc2 (declaration of
1526     "pinfo" was out of place).
1527 
1528 Version 1.0.16rc5 and 1.2.6rc5 [August 10, 2004]
1529   Moved  "PNG_HANDLE_CHUNK_*" macros out of PNG_ASSEMBLER_CODE_SUPPORTED
1530     section of png.h where they were inadvertently placed in version rc3.
1531 
1532 Version 1.2.6 and 1.0.16 [August 15, 2004]
1533   Revised pngtest so memory allocation testing is only done when PNG_DEBUG==1.
1534 
1535 Version 1.2.7beta1 [August 26, 2004]
1536   Removed unused pngasmrd.h file.
1537   Removed references to uu.net for archived files.  Added references to
1538     PNG Spec (second edition) and the PNG ISO/IEC Standard.
1539   Added "test-dd" target in 15 makefiles, to run pngtest in DESTDIR.
1540   Fixed bug with "optimized window size" in the IDAT datastream, that
1541     causes libpng to write PNG files with incorrect zlib header bytes.
1542 
1543 Version 1.2.7beta2 [August 28, 2004]
1544   Fixed bug with sCAL chunk and big-endian machines (David Munro).
1545   Undid new code added in 1.2.6rc2 to update the color_type in
1546     png_set_filler().
1547   Added png_set_add_alpha() that updates color type.
1548 
1549 Version 1.0.17rc1 and 1.2.7rc1 [September 4, 2004]
1550   Revised png_set_strip_filler() to not remove alpha if color_type has alpha.
1551 
1552 Version 1.2.7 and 1.0.17 [September 12, 2004]
1553   Added makefile.hp64
1554   Changed projects/msvc/png32ms.def to scripts/png32ms.def in makefile.cygwin
1555 
1556 Version 1.2.8beta1 [November 1, 2004]
1557   Fixed bug in png_text_compress() that would fail to complete a large block.
1558   Fixed bug, introduced in libpng-1.2.7, that overruns a buffer during
1559     strip alpha operation in png_do_strip_filler().
1560   Added PNG_1_2_X definition in pngconf.h
1561   Use #ifdef to comment out png_info_init in png.c and png_read_init in
1562     pngread.c (as of 1.3.0)
1563 
1564 Version 1.2.8beta2 [November 2, 2004]
1565   Reduce color_type to a nonalpha type after strip alpha operation in
1566     png_do_strip_filler().
1567 
1568 Version 1.2.8beta3 [November 3, 2004]
1569   Revised definitions of PNG_MAX_UINT_32, PNG_MAX_SIZE, and PNG_MAXSUM
1570 
1571 Version 1.2.8beta4 [November 12, 2004]
1572   Fixed (again) definition of PNG_LIBPNG_VER_DLLNUM in png.h (Cosmin).
1573   Added PNG_LIBPNG_BUILD_PRIVATE in png.h (Cosmin).
1574   Set png_ptr->zstream.data_type to Z_BINARY, to avoid unnecessary detection
1575     of data type in deflate (Cosmin).
1576   Deprecated but continue to support SPECIALBUILD and PRIVATEBUILD in favor of
1577     PNG_LIBPNG_BUILD_SPECIAL_STRING and PNG_LIBPNG_BUILD_PRIVATE_STRING.
1578 
1579 Version 1.2.8beta5 [November 20, 2004]
1580   Use png_ptr->flags instead of png_ptr->transformations to pass
1581     PNG_STRIP_ALPHA info to png_do_strip_filler(), to preserve ABI
1582     compatibility.
1583   Revised handling of SPECIALBUILD, PRIVATEBUILD,
1584     PNG_LIBPNG_BUILD_SPECIAL_STRING and PNG_LIBPNG_BUILD_PRIVATE_STRING.
1585 
1586 Version 1.2.8rc1 [November 24, 2004]
1587   Moved handling of BUILD macros from pngconf.h to png.h
1588   Added definition of PNG_LIBPNG_BASE_TYPE in png.h, inadvertently
1589     omitted from beta5.
1590   Revised scripts/pngw32.rc
1591   Despammed mailing addresses by masking "@" with "at".
1592   Inadvertently installed a supposedly faster test version of pngrutil.c
1593 
1594 Version 1.2.8rc2 [November 26, 2004]
1595   Added two missing "\" in png.h
1596   Change tests in pngread.c and pngpread.c to
1597     if (png_ptr->transformations || (png_ptr->flags&PNG_FLAG_STRIP_ALPHA))
1598        png_do_read_transformations(png_ptr);
1599 
1600 Version 1.2.8rc3 [November 28, 2004]
1601   Reverted pngrutil.c to version libpng-1.2.8beta5.
1602   Added scripts/makefile.elf with supporting code in pngconf.h for symbol
1603     versioning (John Bowler).
1604 
1605 Version 1.2.8rc4 [November 29, 2004]
1606   Added projects/visualc7 (Simon-pierre).
1607 
1608 Version 1.2.8rc5 [November 29, 2004]
1609   Fixed new typo in scripts/pngw32.rc
1610 
1611 Version 1.2.8 [December 3, 2004]
1612   Removed projects/visualc7, added projects/visualc71.
1613 
1614 Version 1.2.9beta1 [February 21, 2006]
1615   Initialized some structure members in pngwutil.c to avoid gcc-4.0.0 complaints
1616   Revised man page and libpng.txt to make it clear that one should not call
1617     png_read_end or png_write_end after png_read_png or png_write_png.
1618   Updated references to png-mng-implement mailing list.
1619   Fixed an incorrect typecast in pngrutil.c
1620   Added PNG_NO_READ_SUPPORTED conditional for making a write-only library.
1621   Added PNG_NO_WRITE_INTERLACING_SUPPORTED conditional.
1622   Optimized alpha-inversion loops in pngwtran.c
1623   Moved test for nonzero gamma outside of png_build_gamma_table() in pngrtran.c
1624   Make sure num_trans is <= 256 before copying data in png_set_tRNS().
1625   Make sure num_palette is <= 256 before copying data in png_set_PLTE().
1626   Interchanged order of write_swap_alpha and write_invert_alpha transforms.
1627   Added parentheses in the definition of PNG_LIBPNG_BUILD_TYPE (Cosmin).
1628   Optimized zlib window flag (CINFO) in contrib/pngsuite/*.png (Cosmin).
1629   Updated scripts/makefile.bc32 for Borland C++ 5.6 (Cosmin).
1630   Exported png_get_uint_32, png_save_uint_32, png_get_uint_16, png_save_uint_16,
1631     png_get_int_32, png_save_int_32, png_get_uint_31 (Cosmin).
1632   Added type cast (png_byte) in png_write_sCAL() (Cosmin).
1633   Fixed scripts/makefile.cygwin (Christian Biesinger, Cosmin).
1634   Default iTXt support was inadvertently enabled.
1635 
1636 Version 1.2.9beta2 [February 21, 2006]
1637   Check for png_rgb_to_gray and png_gray_to_rgb read transformations before
1638     checking for png_read_dither in pngrtran.c
1639   Revised checking of chromaticity limits to accommodate extended RGB
1640     colorspace (John Denker).
1641   Changed line endings in some of the project files to CRLF, even in the
1642     "Unix" tar distributions (Cosmin).
1643   Made png_get_int_32 and png_save_int_32 always available (Cosmin).
1644   Updated scripts/pngos2.def, scripts/pngw32.def and projects/wince/png32ce.def
1645     with the newly exported functions.
1646   Eliminated distributions without the "configure" script.
1647   Updated INSTALL instructions.
1648 
1649 Version 1.2.9beta3 [February 24, 2006]
1650   Fixed CRCRLF line endings in contrib/visupng/VisualPng.dsp
1651   Made libpng.pc respect EXEC_PREFIX (D. P. Kreil, J. Bowler)
1652   Removed reference to pngasmrd.h from Makefile.am
1653   Renamed CHANGES to ChangeLog.
1654   Renamed LICENSE to COPYING.
1655   Renamed ANNOUNCE to NEWS.
1656   Created AUTHORS file.
1657 
1658 Version 1.2.9beta4 [March 3, 2006]
1659   Changed definition of PKGCONFIG from $prefix/lib to $libdir in configure.ac
1660   Reverted to filenames LICENSE and ANNOUNCE; removed AUTHORS and COPYING.
1661   Removed newline from the end of some error and warning messages.
1662   Removed test for sqrt() from configure.ac and configure.
1663   Made swap tables in pngtrans.c PNG_CONST (Carlo Bramix).
1664   Disabled default iTXt support that was inadvertently enabled in
1665     libpng-1.2.9beta1.
1666   Added "OS2" to list of systems that don't need underscores, in pnggccrd.c
1667   Removed libpng version and date from *.c files.
1668 
1669 Version 1.2.9beta5 [March 4, 2006]
1670   Removed trailing blanks from source files.
1671   Put version and date of latest change in each source file, and changed
1672     copyright year accordingly.
1673   More cleanup of configure.ac, Makefile.am, and associated scripts.
1674   Restored scripts/makefile.elf which was inadvertently deleted.
1675 
1676 Version 1.2.9beta6 [March 6, 2006]
1677   Fixed typo (RELEASE) in configuration files.
1678 
1679 Version 1.2.9beta7 [March 7, 2006]
1680   Removed libpng.vers and libpng.sym from libpng12_la_SOURCES in Makefile.am
1681   Fixed inconsistent #ifdef's around png_sig_bytes() and png_set_sCAL_s()
1682     in png.h.
1683   Updated makefile.elf as suggested by debian.
1684   Made cosmetic changes to some makefiles, adding LN_SF and other macros.
1685   Made some makefiles accept "exec_prefix".
1686 
1687 Version 1.2.9beta8 [March 9, 2006]
1688   Fixed some "#if defined (..." which should be "#if defined(..."
1689     Bug introduced in libpng-1.2.8.
1690   Fixed inconsistency in definition of png_default_read_data()
1691   Restored blank that was lost from makefile.sggcc "clean" target in beta7.
1692   Revised calculation of "current" and "major" for irix in ltmain.sh
1693   Changed "mkdir" to "MKDIR_P" in some makefiles.
1694   Separated PNG_EXPAND and PNG_EXPAND_tRNS.
1695   Added png_set_expand_gray_1_2_4_to_8() and deprecated
1696     png_set_gray_1_2_4_to_8() which also expands tRNS to alpha.
1697 
1698 Version 1.2.9beta9 [March 10, 2006]
1699   Include "config.h" in pngconf.h when available.
1700   Added some checks for NULL png_ptr or NULL info_ptr (timeless)
1701 
1702 Version 1.2.9beta10 [March 20, 2006]
1703   Removed extra CR from contrib/visualpng/VisualPng.dsw (Cosmin)
1704   Made pnggccrd.c PIC-compliant (Christian Aichinger).
1705   Added makefile.mingw (Wolfgang Glas).
1706   Revised pngconf.h MMX checking.
1707 
1708 Version 1.2.9beta11 [March 22, 2006]
1709   Fixed out-of-order declaration in pngwrite.c that was introduced in beta9
1710   Simplified some makefiles by using LIBSO, LIBSOMAJ, and LIBSOVER macros.
1711 
1712 Version 1.2.9rc1 [March 31, 2006]
1713   Defined PNG_USER_PRIVATEBUILD when including "pngusr.h" (Cosmin).
1714   Removed nonsensical assertion check from pngtest.c (Cosmin).
1715 
1716 Version 1.2.9 [April 14, 2006]
1717   Revised makefile.beos and added "none" selector in ltmain.sh
1718 
1719 Version 1.2.10beta1 [April 15, 2006]
1720   Renamed "config.h" to "png_conf.h" and revised Makefile.am to add
1721     -DPNG_BUILDING_LIBPNG to compile directive, and modified pngconf.h
1722     to include png_conf.h only when PNG_BUILDING_LIBPNG is defined.
1723 
1724 Version 1.2.10beta2 [April 15, 2006]
1725   Manually updated Makefile.in and configure.  Changed png_conf.h.in
1726     back to config.h.
1727 
1728 Version 1.2.10beta3 [April 15, 2006]
1729   Change png_conf.h back to config.h in pngconf.h.
1730 
1731 Version 1.2.10beta4 [April 16, 2006]
1732   Change PNG_BUILDING_LIBPNG to PNG_CONFIGURE_LIBPNG in config/Makefile*.
1733 
1734 Version 1.2.10beta5 [April 16, 2006]
1735   Added a configure check for compiling assembler code in pnggccrd.c
1736 
1737 Version 1.2.10beta6 [April 17, 2006]
1738   Revised the configure check for pnggccrd.c
1739   Moved -DPNG_CONFIGURE_LIBPNG into @LIBPNG_DEFINES@
1740   Added @LIBPNG_DEFINES@ to arguments when building libpng.sym
1741 
1742 Version 1.2.10beta7 [April 18, 2006]
1743   Change "exec_prefix=$prefix" to "exec_prefix=$(prefix)" in makefiles.
1744 
1745 Version 1.2.10rc1 [April 19, 2006]
1746   Ensure pngconf.h doesn't define both PNG_USE_PNGGCCRD and PNG_USE_PNGVCRD
1747   Fixed "LN_FS" typo in makefile.sco and makefile.solaris.
1748 
1749 Version 1.2.10rc2 [April 20, 2006]
1750   Added a backslash between -DPNG_CONFIGURE_LIBPNG and -DPNG_NO_ASSEMBLER_CODE
1751    in configure.ac and configure
1752   Made the configure warning about versioned symbols less arrogant.
1753 
1754 Version 1.2.10rc3 [April 21, 2006]
1755   Added a note in libpng.txt that png_set_sig_bytes(8) can be used when
1756     writing an embedded PNG without the 8-byte signature.
1757   Revised makefiles and configure to avoid making links to libpng.so.*
1758 
1759 Version 1.2.10 [April 23, 2006]
1760   Reverted configure to "rc2" state.
1761 
1762 Version 1.2.11beta1 [May 31, 2006]
1763   scripts/libpng.pc.in contained "configure" style version info and would
1764     not work with makefiles.
1765   The shared-library makefiles were linking to libpng.so.0 instead of
1766     libpng.so.3 compatibility as the library.
1767 
1768 Version 1.2.11beta2 [June 2, 2006]
1769   Increased sprintf buffer from 50 to 52 chars in pngrutil.c to avoid
1770     buffer overflow.
1771   Fixed bug in example.c (png_set_palette_rgb -> png_set_palette_to_rgb)
1772 
1773 Version 1.2.11beta3 [June 5, 2006]
1774   Prepended "#! /bin/sh" to ltmail.sh and contrib/pngminus/*.sh (Cosmin).
1775   Removed the accidental leftover Makefile.in~ (Cosmin).
1776   Avoided potential buffer overflow and optimized buffer in
1777     png_write_sCAL(), png_write_sCAL_s() (Cosmin).
1778   Removed the include directories and libraries from CFLAGS and LDFLAGS
1779     in scripts/makefile.gcc (Nelson A. de Oliveira, Cosmin).
1780 
1781 Version 1.2.11beta4 [June 6, 2006]
1782   Allow zero-length IDAT chunks after the entire zlib datastream, but not
1783     after another intervening chunk type.
1784 
1785 Version 1.0.19rc1, 1.2.11rc1 [June 13, 2006]
1786   Deleted extraneous square brackets from [config.h] in configure.ac
1787 
1788 Version 1.0.19rc2, 1.2.11rc2 [June 14, 2006]
1789   Added prototypes for PNG_INCH_CONVERSIONS functions to png.h
1790   Revised INSTALL and autogen.sh
1791   Fixed typo in several makefiles (-W1 should be -Wl)
1792   Added typedef for png_int_32 and png_uint_32 on 64-bit systems.
1793 
1794 Version 1.0.19rc3, 1.2.11rc3 [June 15, 2006]
1795   Removed the new typedefs for 64-bit systems (delay until version 1.4.0)
1796   Added one zero element to png_gamma_shift[] array in pngrtran.c to avoid
1797     reading out of bounds.
1798 
1799 Version 1.0.19rc4, 1.2.11rc4 [June 15, 2006]
1800   Really removed the new typedefs for 64-bit systems.
1801 
1802 Version 1.0.19rc5, 1.2.11rc5 [June 22, 2006]
1803   Removed png_sig_bytes entry from scripts/pngw32.def
1804 
1805 Version 1.0.19, 1.2.11 [June 26, 2006]
1806   None.
1807 
1808 Version 1.0.20, 1.2.12 [June 27, 2006]
1809   Really increased sprintf buffer from 50 to 52 chars in pngrutil.c to avoid
1810     buffer overflow.
1811 
1812 Version 1.2.13beta1 [October 2, 2006]
1813   Removed AC_FUNC_MALLOC from configure.ac
1814   Work around Intel-Mac compiler bug by setting PNG_NO_MMX_CODE in pngconf.h
1815   Change "logical" to "bitwise" throughout documentation.
1816   Detect and fix attempt to write wrong iCCP profile length (CVE-2006-7244)
1817 
1818 Version 1.0.21, 1.2.13 [November 14, 2006]
1819   Fix potential buffer overflow in sPLT chunk handler.
1820   Fix Makefile.am to not try to link to noexistent files.
1821   Check all exported functions for NULL png_ptr.
1822 
1823 Version 1.2.14beta1 [November 17, 2006]
1824   Relocated three misplaced tests for NULL png_ptr.
1825   Built Makefile.in with automake-1.9.6 instead of 1.9.2.
1826   Build configure with autoconf-2.60 instead of 2.59
1827 
1828 Version 1.2.14beta2 [November 17, 2006]
1829   Added some typecasts in png_zalloc().
1830 
1831 Version 1.2.14rc1 [November 20, 2006]
1832   Changed "strtod" to "png_strtod" in pngrutil.c
1833 
1834 Version 1.0.22, 1.2.14    [November 27, 2006]
1835   Added missing "$(srcdir)" in Makefile.am and Makefile.in
1836 
1837 Version 1.2.15beta1 [December 3, 2006]
1838   Generated configure with autoconf-2.61 instead of 2.60
1839   Revised configure.ac to update libpng.pc and libpng-config.
1840 
1841 Version 1.2.15beta2 [December 3, 2006]
1842   Always export MMX asm functions, just stubs if not building pnggccrd.c
1843 
1844 Version 1.2.15beta3 [December 4, 2006]
1845   Add "png_bytep" typecast to profile while calculating length in pngwutil.c
1846 
1847 Version 1.2.15beta4 [December 7, 2006]
1848   Added scripts/CMakeLists.txt
1849   Changed PNG_NO_ASSEMBLER_CODE to PNG_NO_MMX_CODE in scripts, like 1.4.0beta
1850 
1851 Version 1.2.15beta5 [December 7, 2006]
1852   Changed some instances of PNG_ASSEMBLER_* to PNG_MMX_* in pnggccrd.c
1853   Revised scripts/CMakeLists.txt
1854 
1855 Version 1.2.15beta6 [December 13, 2006]
1856   Revised scripts/CMakeLists.txt and configure.ac
1857 
1858 Version 1.2.15rc1 [December 18, 2006]
1859   Revised scripts/CMakeLists.txt
1860 
1861 Version 1.2.15rc2 [December 21, 2006]
1862   Added conditional #undef jmpbuf in pngtest.c to undo #define in AIX headers.
1863   Added scripts/makefile.nommx
1864 
1865 Version 1.2.15rc3 [December 25, 2006]
1866   Fixed shared library numbering error that was introduced in 1.2.15beta6.
1867 
1868 Version 1.2.15rc4 [December 27, 2006]
1869   Fixed handling of rgb_to_gray when png_ptr->color.gray isn't set.
1870 
1871 Version 1.2.15rc5 [December 31, 2006]
1872   Revised handling of rgb_to_gray.
1873 
1874 Version 1.2.15 [January 5, 2007]
1875   Added some (unsigned long) typecasts in pngtest.c to avoid printing errors.
1876 
1877 Version 1.2.16beta1 [January 6, 2007]
1878   Fix bugs in makefile.nommx
1879 
1880 Version 1.2.16beta2 [January 16, 2007]
1881   Revised scripts/CMakeLists.txt
1882 
1883 Version 1.2.16 [January 31, 2007]
1884   No changes.
1885 
1886 Version 1.2.17beta1 [March 6, 2007]
1887   Revised scripts/CMakeLists.txt to install both shared and static libraries.
1888   Deleted a redundant line from pngset.c.
1889 
1890 Version 1.2.17beta2 [April 26, 2007]
1891   Relocated misplaced test for png_ptr == NULL in pngpread.c
1892   Change "==" to "&" for testing PNG_RGB_TO_GRAY_ERR & PNG_RGB_TO_GRAY_WARN
1893     flags.
1894   Changed remaining instances of PNG_ASSEMBLER_* to PNG_MMX_*
1895   Added pngerror() when write_IHDR fails in deflateInit2().
1896   Added "const" to some array declarations.
1897   Mention examples of libpng usage in the libpng*.txt and libpng.3 documents.
1898 
1899 Version 1.2.17rc1 [May 4, 2007]
1900   No changes.
1901 
1902 Version 1.2.17rc2 [May 8, 2007]
1903   Moved several PNG_HAVE_* macros out of PNG_INTERNAL because applications
1904     calling set_unknown_chunk_location() need them.
1905   Changed transformation flag from PNG_EXPAND_tRNS to PNG_EXPAND in
1906     png_set_expand_gray_1_2_4_to_8().
1907   Added png_ptr->unknown_chunk to hold working unknown chunk data, so it
1908     can be free'ed in case of error.  Revised unknown chunk handling in
1909     pngrutil.c and pngpread.c to use this structure.
1910 
1911 Version 1.2.17rc3 [May 8, 2007]
1912   Revised symbol-handling in configure script.
1913 
1914 Version 1.2.17rc4 [May 10, 2007]
1915   Revised unknown chunk handling to avoid storing unknown critical chunks.
1916 
1917 Version 1.0.25 [May 15, 2007]
1918 Version 1.2.17 [May 15, 2007]
1919   Added "png_ptr->num_trans=0" before error return in png_handle_tRNS,
1920     to eliminate a vulnerability (CVE-2007-2445, CERT VU#684664)
1921 
1922 Version 1.0.26 [May 15, 2007]
1923 Version 1.2.18 [May 15, 2007]
1924   Reverted the libpng-1.2.17rc3 change to symbol-handling in configure script
1925 
1926 Version 1.2.19beta1 [May 18, 2007]
1927   Changed "const static" to "static PNG_CONST" everywhere, mostly undoing
1928     change of libpng-1.2.17beta2.  Changed other "const" to "PNG_CONST"
1929   Changed some handling of unused parameters, to avoid compiler warnings.
1930     "if (unused == NULL) return;" becomes "unused = unused".
1931 
1932 Version 1.2.19beta2 [May 18, 2007]
1933   Only use the valid bits of tRNS value in png_do_expand() (Brian Cartier)
1934 
1935 Version 1.2.19beta3 [May 19, 2007]
1936   Add some "png_byte" typecasts in png_check_keyword() and write new_key
1937   instead of key in zTXt chunk (Kevin Ryde).
1938 
1939 Version 1.2.19beta4 [May 21, 2007]
1940   Add png_snprintf() function and use it in place of sprint() for improved
1941     defense against buffer overflows.
1942 
1943 Version 1.2.19beta5 [May 21, 2007]
1944   Fixed png_handle_tRNS() to only use the valid bits of tRNS value.
1945   Changed handling of more unused parameters, to avoid compiler warnings.
1946   Removed some PNG_CONST in pngwutil.c to avoid compiler warnings.
1947 
1948 Version 1.2.19beta6 [May 22, 2007]
1949   Added some #ifdef PNG_MMX_CODE_SUPPORTED where needed in pngvcrd.c
1950   Added a special "_MSC_VER" case that defines png_snprintf to _snprintf
1951 
1952 Version 1.2.19beta7 [May 22, 2007]
1953   Squelched png_squelch_warnings() in pnggccrd.c and added
1954     an #ifdef PNG_MMX_CODE_SUPPORTED block around the declarations that caused
1955     the warnings that png_squelch_warnings was squelching.
1956 
1957 Version 1.2.19beta8 [May 22, 2007]
1958   Removed __MMX__ from test in pngconf.h.
1959 
1960 Version 1.2.19beta9 [May 23, 2007]
1961   Made png_squelch_warnings() available via PNG_SQUELCH_WARNINGS macro.
1962   Revised png_squelch_warnings() so it might work.
1963   Updated makefile.sgcc and makefile.solaris; added makefile.solaris-x86.
1964 
1965 Version 1.2.19beta10 [May 24, 2007]
1966   Resquelched png_squelch_warnings(), use "__attribute__((used))" instead.
1967 
1968 Version 1.4.0beta1 [April 20, 2006]
1969   Enabled iTXt support (changes png_struct, thus requires so-number change).
1970   Cleaned up PNG_ASSEMBLER_CODE_SUPPORTED vs PNG_MMX_CODE_SUPPORTED
1971   Eliminated PNG_1_0_X and PNG_1_2_X macros.
1972   Removed deprecated functions png_read_init, png_write_init, png_info_init,
1973     png_permit_empty_plte, png_set_gray_1_2_4_to_8, png_check_sig, and
1974     removed the deprecated macro PNG_MAX_UINT.
1975   Moved "PNG_INTERNAL" parts of png.h and pngconf.h into pngintrn.h
1976   Removed many WIN32_WCE #ifdefs (Cosmin).
1977   Reduced dependency on C-runtime library when on Windows (Simon-Pierre)
1978   Replaced sprintf() with png_sprintf() (Simon-Pierre)
1979 
1980 Version 1.4.0beta2 [April 20, 2006]
1981   Revised makefiles and configure to avoid making links to libpng.so.*
1982   Moved some leftover MMX-related defines from pngconf.h to pngintrn.h
1983   Updated scripts/pngos2.def, pngw32.def, and projects/wince/png32ce.def
1984 
1985 Version 1.4.0beta3 [May 10, 2006]
1986   Updated scripts/pngw32.def to comment out MMX functions.
1987   Added PNG_NO_GET_INT_32 and PNG_NO_SAVE_INT_32 macros.
1988   Scripts/libpng.pc.in contained "configure" style version info and would
1989     not work with makefiles.
1990   Revised pngconf.h and added pngconf.h.in, so makefiles and configure can
1991     pass defines to libpng and applications.
1992 
1993 Version 1.4.0beta4 [May 11, 2006]
1994   Revised configure.ac, Makefile.am, and many of the makefiles to write
1995     their defines in pngconf.h.
1996 
1997 Version 1.4.0beta5 [May 15, 2006]
1998   Added a missing semicolon in Makefile.am and Makefile.in
1999   Deleted extraneous square brackets from configure.ac
2000 
2001 Version 1.4.0beta6 [June 2, 2006]
2002   Increased sprintf buffer from 50 to 52 chars in pngrutil.c to avoid
2003     buffer overflow.
2004   Changed sonum from 0 to 1.
2005   Removed unused prototype for png_check_sig() from png.h
2006 
2007 Version 1.4.0beta7 [June 16, 2006]
2008   Exported png_write_sig (Cosmin).
2009   Optimized buffer in png_handle_cHRM() (Cosmin).
2010   Set pHYs = 2835 x 2835 pixels per meter, and added
2011     sCAL = 0.352778e-3 x 0.352778e-3 meters, in pngtest.png (Cosmin).
2012   Added png_set_benign_errors(), png_benign_error(), png_chunk_benign_error().
2013   Added typedef for png_int_32 and png_uint_32 on 64-bit systems.
2014   Added "(unsigned long)" typecast on png_uint_32 variables in printf lists.
2015 
2016 Version 1.4.0beta8 [June 22, 2006]
2017   Added demonstration of user chunk support in pngtest.c, to support the
2018     public sTER chunk and a private vpAg chunk.
2019 
2020 Version 1.4.0beta9 [July 3, 2006]
2021   Removed ordinals from scripts/pngw32.def and removed png_info_int and
2022     png_set_gray_1_2_4_to_8 entries.
2023   Inline call of png_get_uint_32() in png_get_uint_31().
2024   Use png_get_uint_31() to get vpAg width and height in pngtest.c
2025   Removed WINCE and Netware projects.
2026   Removed standalone Y2KINFO file.
2027 
2028 Version 1.4.0beta10 [July 12, 2006]
2029   Eliminated automatic copy of pngconf.h to pngconf.h.in from configure and
2030     some makefiles, because it was not working reliably.  Instead, distribute
2031     pngconf.h.in along with pngconf.h and cause configure and some of the
2032     makefiles to update pngconf.h from pngconf.h.in.
2033   Added pngconf.h to DEPENDENCIES in Makefile.am
2034 
2035 Version 1.4.0beta11 [August 19, 2006]
2036   Removed AC_FUNC_MALLOC from configure.ac.
2037   Added a warning when writing iCCP profile with mismatched profile length.
2038   Patched pnggccrd.c to assemble on x86_64 platforms.
2039   Moved chunk header reading into a separate function png_read_chunk_header()
2040     in pngrutil.c.  The chunk header (len+sig) is now serialized in a single
2041     operation (Cosmin).
2042   Implemented support for I/O states. Added png_ptr member io_state, and
2043     functions png_get_io_chunk_name() and png_get_io_state() in pngget.c
2044     (Cosmin).
2045   Added png_get_io_chunk_name and png_get_io_state to scripts/*.def (Cosmin).
2046   Renamed scripts/pngw32.* to scripts/pngwin.* (Cosmin).
2047   Removed the include directories and libraries from CFLAGS and LDFLAGS
2048     in scripts/makefile.gcc (Cosmin).
2049   Used png_save_uint_32() to set vpAg width and height in pngtest.c (Cosmin).
2050   Cast to proper type when getting/setting vpAg units in pngtest.c (Cosmin).
2051   Added pngintrn.h to the Visual C++ projects (Cosmin).
2052   Removed scripts/list (Cosmin).
2053   Updated copyright year in scripts/pngwin.def (Cosmin).
2054   Removed PNG_TYPECAST_NULL and used standard NULL consistently (Cosmin).
2055   Disallowed the user to redefine png_size_t, and enforced a consistent use
2056     of png_size_t across libpng (Cosmin).
2057   Changed the type of png_ptr->rowbytes, PNG_ROWBYTES() and friends
2058     to png_size_t (Cosmin).
2059   Removed png_convert_size() and replaced png_sizeof with sizeof (Cosmin).
2060   Removed some unnecessary type casts (Cosmin).
2061   Changed prototype of png_get_compression_buffer_size() and
2062     png_set_compression_buffer_size() to work with png_size_t instead of
2063     png_uint_32 (Cosmin).
2064   Removed png_memcpy_check() and png_memset_check() (Cosmin).
2065   Fixed a typo (png_byte --> png_bytep) in libpng.3 and libpng.txt (Cosmin).
2066   Clarified that png_zalloc() does not clear the allocated memory,
2067     and png_zalloc() and png_zfree() cannot be PNGAPI (Cosmin).
2068   Renamed png_mem_size_t to png_alloc_size_t, fixed its definition in
2069     pngconf.h, and used it in all memory allocation functions (Cosmin).
2070   Renamed pngintrn.h to pngpriv.h, added a comment at the top of the file
2071     mentioning that the symbols declared in that file are private, and
2072     updated the scripts and the Visual C++ projects accordingly (Cosmin).
2073   Removed circular references between pngconf.h and pngconf.h.in in
2074     scripts/makefile.vc*win32 (Cosmin).
2075   Removing trailing '.' from the warning and error messages (Cosmin).
2076   Added pngdefs.h that is built by makefile or configure, instead of
2077     pngconf.h.in (Glenn).
2078   Detect and fix attempt to write wrong iCCP profile length.
2079 
2080 Version 1.4.0beta12 [October 19, 2006]
2081   Changed "logical" to "bitwise" in the documentation.
2082   Work around Intel-Mac compiler bug by setting PNG_NO_MMX_CODE in pngconf.h
2083   Add a typecast to stifle compiler warning in pngrutil.c
2084 
2085 Version 1.4.0beta13 [November 10, 2006]
2086   Fix potential buffer overflow in sPLT chunk handler.
2087   Fix Makefile.am to not try to link to noexistent files.
2088 
2089 Version 1.4.0beta14 [November 15, 2006]
2090   Check all exported functions for NULL png_ptr.
2091 
2092 Version 1.4.0beta15 [November 17, 2006]
2093   Relocated two misplaced tests for NULL png_ptr.
2094   Built Makefile.in with automake-1.9.6 instead of 1.9.2.
2095   Build configure with autoconf-2.60 instead of 2.59
2096   Add "install: all" in Makefile.am so "configure; make install" will work.
2097 
2098 Version 1.4.0beta16 [November 17, 2006]
2099   Added a typecast in png_zalloc().
2100 
2101 Version 1.4.0beta17 [December 4, 2006]
2102   Changed "new_key[79] = '\0';" to "(*new_key)[79] = '\0';" in pngwutil.c
2103   Add "png_bytep" typecast to profile while calculating length in pngwutil.c
2104 
2105 Version 1.4.0beta18 [December 7, 2006]
2106   Added scripts/CMakeLists.txt
2107 
2108 Version 1.4.0beta19 [May 16, 2007]
2109   Revised scripts/CMakeLists.txt
2110   Rebuilt configure and Makefile.in with newer tools.
2111   Added conditional #undef jmpbuf in pngtest.c to undo #define in AIX headers.
2112   Added scripts/makefile.nommx
2113 
2114 Version 1.4.0beta20 [July 9, 2008]
2115   Moved several PNG_HAVE_* macros from pngpriv.h to png.h because applications
2116     calling set_unknown_chunk_location() need them.
2117   Moved several macro definitions from pngpriv.h to pngconf.h
2118   Merge with changes to the 1.2.X branch, as of 1.2.30beta04.
2119   Deleted all use of the MMX assembler code and Intel-licensed optimizations.
2120   Revised makefile.mingw
2121 
2122 Version 1.4.0beta21 [July 21, 2008]
2123   Moved local array "chunkdata" from pngrutil.c to the png_struct, so
2124     it will be freed by png_read_destroy() in case of a read error (Kurt
2125     Christensen).
2126 
2127 Version 1.4.0beta22 [July 21, 2008]
2128   Change "purpose" and "buffer" to png_ptr->chunkdata to avoid memory leaking.
2129 
2130 Version 1.4.0beta23 [July 22, 2008]
2131   Change "chunkdata = NULL" to "png_ptr->chunkdata = NULL" several places in
2132     png_decompress_chunk().
2133 
2134 Version 1.4.0beta24 [July 25, 2008]
2135   Change all remaining "chunkdata" to "png_ptr->chunkdata" in
2136     png_decompress_chunk(), and remove "chunkdata" from parameter list.
2137   Put a call to png_check_chunk_name() in png_read_chunk_header().
2138   Revised png_check_chunk_name() to reject a name with a lowercase 3rd byte.
2139   Removed two calls to png_check_chunk_name() occurring later in the process.
2140   Define PNG_NO_ERROR_NUMBERS by default in pngconf.h
2141 
2142 Version 1.4.0beta25 [July 30, 2008]
2143   Added a call to png_check_chunk_name() in pngpread.c
2144   Reverted png_check_chunk_name() to accept a name with a lowercase 3rd byte.
2145   Added png_push_have_buffer() function to pngpread.c
2146   Eliminated PNG_BIG_ENDIAN_SUPPORTED and associated png_get_* macros.
2147   Made inline expansion of png_get_*() optional with PNG_USE_READ_MACROS.
2148   Eliminated all PNG_USELESS_TESTS and PNG_CORRECT_PALETTE_SUPPORTED code.
2149   Synced contrib directory and configure files with libpng-1.2.30beta06.
2150   Eliminated no-longer-used pngdefs.h (but it's still built in the makefiles)
2151   Relocated a misplaced "#endif /* PNG_NO_WRITE_FILTER */" in pngwutil.c
2152 
2153 Version 1.4.0beta26 [August 4, 2008]
2154   Removed png_push_have_buffer() function in pngpread.c.  It increased the
2155     compiled library size slightly.
2156   Changed "-Wall" to "-W -Wall" in the CFLAGS in all makefiles (Cosmin Truta)
2157   Declared png_ptr "volatile" in pngread.c and pngwrite.c to avoid warnings.
2158   Updated contrib/visupng/cexcept.h to version 2.0.1
2159   Added PNG_LITERAL_CHARACTER macros for #, [, and ].
2160 
2161 Version 1.4.0beta27 [August 5, 2008]
2162   Revised usage of PNG_LITERAL_SHARP in pngerror.c.
2163   Moved newline character from individual png_debug messages into the
2164     png_debug macros.
2165   Allow user to #define their own png_debug, png_debug1, and png_debug2.
2166 
2167 Version 1.4.0beta28 [August 5, 2008]
2168   Revised usage of PNG_LITERAL_SHARP in pngerror.c.
2169   Added PNG_STRING_NEWLINE macro
2170 
2171 Version 1.4.0beta29 [August 9, 2008]
2172   Revised usage of PNG_STRING_NEWLINE to work on non-ISO compilers.
2173   Added PNG_STRING_COPYRIGHT macro.
2174   Added non-ISO versions of png_debug macros.
2175 
2176 Version 1.4.0beta30 [August 14, 2008]
2177   Added premultiplied alpha feature (Volker Wiendl).
2178 
2179 Version 1.4.0beta31 [August 18, 2008]
2180   Moved png_set_premultiply_alpha from pngtrans.c to pngrtran.c
2181   Removed extra crc check at the end of png_handle_cHRM().  Bug introduced
2182     in libpng-1.4.0beta20.
2183 
2184 Version 1.4.0beta32 [August 19, 2008]
2185   Added PNG_WRITE_FLUSH_SUPPORTED block around new png_flush() call.
2186   Revised PNG_NO_STDIO version of png_write_flush()
2187 
2188 Version 1.4.0beta33 [August 20, 2008]
2189   Added png_get|set_chunk_cache_max() to limit the total number of sPLT,
2190     text, and unknown chunks that can be stored.
2191 
2192 Version 1.4.0beta34 [September 6, 2008]
2193   Shortened tIME_string to 29 bytes in pngtest.c
2194   Fixed off-by-one error introduced in png_push_read_zTXt() function in
2195     libpng-1.2.30beta04/pngpread.c (Harald van Dijk)
2196 
2197 Version 1.4.0beta35 [October 6, 2008]
2198   Changed "trans_values" to "trans_color".
2199   Changed so-number from 0 to 14.  Some OS do not like 0.
2200   Revised makefile.darwin to fix shared library numbering.
2201   Change png_set_gray_1_2_4_to_8() to png_set_expand_gray_1_2_4_to_8()
2202     in example.c (debian bug report)
2203 
2204 Version 1.4.0beta36 [October 25, 2008]
2205   Sync with tEXt vulnerability fix in libpng-1.2.33rc02.
2206 
2207 Version 1.4.0beta37 [November 13, 2008]
2208   Added png_check_cHRM in png.c and moved checking from pngget.c, pngrutil.c,
2209     and pngwrite.c
2210 
2211 Version 1.4.0beta38 [November 22, 2008]
2212   Added check for zero-area RGB cHRM triangle in png_check_cHRM() and
2213     png_check_cHRM_fixed().
2214 
2215 Version 1.4.0beta39 [November 23, 2008]
2216   Revised png_warning() to write its message on standard output by default
2217     when warning_fn is NULL.
2218 
2219 Version 1.4.0beta40 [November 24, 2008]
2220   Eliminated png_check_cHRM().  Instead, always use png_check_cHRM_fixed().
2221   In png_check_cHRM_fixed(), ensure white_y is > 0, and removed redundant
2222     check for all-zero coordinates that is detected by the triangle check.
2223 
2224 Version 1.4.0beta41 [November 26, 2008]
2225   Fixed string vs pointer-to-string error in png_check_keyword().
2226   Rearranged test expressions in png_check_cHRM_fixed() to avoid internal
2227     overflows.
2228   Added PNG_NO_CHECK_cHRM conditional.
2229 
2230 Version 1.4.0beta42, 43 [December 1, 2008]
2231   Merge png_debug with version 1.2.34beta04.
2232 
2233 Version 1.4.0beta44 [December 6, 2008]
2234   Removed redundant check for key==NULL before calling png_check_keyword()
2235     to ensure that new_key gets initialized and removed extra warning
2236     (Merge with version 1.2.34beta05 -- Arvan Pritchard).
2237 
2238 Version 1.4.0beta45 [December 9, 2008]
2239   In png_write_png(), respect the placement of the filler bytes in an earlier
2240     call to png_set_filler() (Jim Barry).
2241 
2242 Version 1.4.0beta46 [December 10, 2008]
2243   Undid previous change and added PNG_TRANSFORM_STRIP_FILLER_BEFORE and
2244     PNG_TRANSFORM_STRIP_FILLER_AFTER conditionals and deprecated
2245     PNG_TRANSFORM_STRIP_FILLER (Jim Barry).
2246 
2247 Version 1.4.0beta47 [December 15, 2008]
2248   Support for dithering was disabled by default, because it has never
2249     been well tested and doesn't work very well.  The code has not
2250     been removed, however, and can be enabled by building libpng with
2251     PNG_READ_DITHER_SUPPORTED defined.
2252 
2253 Version 1.4.0beta48 [February 14, 2009]
2254   Added new exported function png_calloc().
2255   Combined several instances of png_malloc(); png_memset() into png_calloc().
2256   Removed prototype for png_freeptr() that was added in libpng-1.4.0beta24
2257     but was never defined.
2258 
2259 Version 1.4.0beta49 [February 28, 2009]
2260   Added png_fileno() macro to pngconf.h, used in pngwio.c
2261   Corrected order of #ifdef's in png_debug definition in png.h
2262   Fixed bug introduced in libpng-1.4.0beta48 with the memset arguments
2263     for pcal_params.
2264   Fixed order of #ifdef directives in the png_debug defines in png.h
2265     (bug introduced in libpng-1.2.34/1.4.0beta29).
2266   Revised comments in png_set_read_fn() and png_set_write_fn().
2267 
2268 Version 1.4.0beta50 [March 18, 2009]
2269   Use png_calloc() instead of png_malloc() to allocate big_row_buf when
2270     reading an interlaced file, to avoid a possible UMR.
2271   Undid revision of PNG_NO_STDIO version of png_write_flush().  Users
2272     having trouble with fflush() can build with PNG_NO_WRITE_FLUSH defined
2273     or supply their own flush_fn() replacement.
2274   Revised libpng*.txt and png.h documentation about use of png_write_flush()
2275     and png_set_write_fn().
2276   Removed fflush() from pngtest.c.
2277   Added "#define PNG_NO_WRITE_FLUSH" to contrib/pngminim/encoder/pngusr.h
2278 
2279 Version 1.4.0beta51 [March 21, 2009]
2280   Removed new png_fileno() macro from pngconf.h .
2281 
2282 Version 1.4.0beta52 [March 27, 2009]
2283   Relocated png_do_chop() ahead of building gamma tables in pngrtran.c
2284     This avoids building 16-bit gamma tables unnecessarily.
2285   Removed fflush() from pngtest.c.
2286   Added "#define PNG_NO_WRITE_FLUSH" to contrib/pngminim/encoder/pngusr.h
2287   Added a section on differences between 1.0.x and 1.2.x to libpng.3/libpng.txt
2288 
2289 Version 1.4.0beta53 [April 1, 2009]
2290   Removed some remaining MMX macros from pngpriv.h
2291   Fixed potential memory leak of "new_name" in png_write_iCCP() (Ralph Giles)
2292 
2293 Version 1.4.0beta54 [April 13, 2009]
2294   Added "ifndef PNG_SKIP_SETJMP_CHECK" block in pngconf.h to allow
2295     application code writers to bypass the check for multiple inclusion
2296     of setjmp.h when they know that it is safe to ignore the situation.
2297   Eliminated internal use of setjmp() in pngread.c and pngwrite.c
2298   Reordered ancillary chunks in pngtest.png to be the same as what
2299     pngtest now produces, and made some cosmetic changes to pngtest output.
2300   Eliminated deprecated png_read_init_3() and png_write_init_3() functions.
2301 
2302 Version 1.4.0beta55 [April 15, 2009]
2303   Simplified error handling in pngread.c and pngwrite.c by putting
2304     the new png_read_cleanup() and png_write_cleanup() functions inline.
2305 
2306 Version 1.4.0beta56 [April 25, 2009]
2307   Renamed "user_chunk_data" to "my_user_chunk_data" in pngtest.c to suppress
2308     "shadowed declaration" warning from gcc-4.3.3.
2309   Renamed "gamma" to "png_gamma" in pngset.c to avoid "shadowed declaration"
2310     warning about a global "gamma" variable in math.h on some platforms.
2311 
2312 Version 1.4.0beta57 [May 2, 2009]
2313   Removed prototype for png_freeptr() that was added in libpng-1.4.0beta24
2314     but was never defined (again).
2315   Rebuilt configure scripts with autoconf-2.63 instead of 2.62
2316   Removed pngprefs.h and MMX from makefiles
2317 
2318 Version 1.4.0beta58 [May 14, 2009]
2319   Changed pngw32.def to pngwin.def in makefile.mingw (typo was introduced
2320     in beta57).
2321   Clarified usage of sig_bit versus sig_bit_p in example.c (Vincent Torri)
2322 
2323 Version 1.4.0beta59 [May 15, 2009]
2324   Reformated sources in libpng style (3-space intentation, comment format)
2325   Fixed typo in libpng docs (PNG_FILTER_AVE should be PNG_FILTER_AVG)
2326   Added sections about the git repository and our coding style to the
2327     documentation
2328   Relocated misplaced #endif in pngwrite.c, sCAL chunk handler.
2329 
2330 Version 1.4.0beta60 [May 19, 2009]
2331   Conditionally compile png_read_finish_row() which is not used by
2332     progressive readers.
2333   Added contrib/pngminim/preader to demonstrate building minimal progressive
2334     decoder, based on contrib/gregbook with embedded libpng and zlib.
2335 
2336 Version 1.4.0beta61 [May 20, 2009]
2337   In contrib/pngminim/*, renamed "makefile.std" to "makefile", since there
2338     is only one makefile in those directories, and revised the README files
2339     accordingly.
2340   More reformatting of comments, mostly to capitalize sentences.
2341 
2342 Version 1.4.0beta62 [June 2, 2009]
2343   Added "#define PNG_NO_WRITE_SWAP" to contrib/pngminim/encoder/pngusr.h
2344     and "define PNG_NO_READ_SWAP" to decoder/pngusr.h and preader/pngusr.h
2345   Reformatted several remaining "else statement" into two lines.
2346   Added a section to the libpng documentation about using png_get_io_ptr()
2347     in configure scripts to detect the presence of libpng.
2348 
2349 Version 1.4.0beta63 [June 15, 2009]
2350   Revised libpng*.txt and libpng.3 to mention calling png_set_IHDR()
2351     multiple times and to specify the sample order in the tRNS chunk,
2352     because the ISO PNG specification has a typo in the tRNS table.
2353   Changed several PNG_UNKNOWN_CHUNK_SUPPORTED to
2354     PNG_HANDLE_AS_UNKNOWN_SUPPORTED, to make the png_set_keep mechanism
2355     available for ignoring known chunks even when not saving unknown chunks.
2356   Adopted preference for consistent use of "#ifdef" and "#ifndef" versus
2357     "#if defined()" and "if !defined()" where possible.
2358 
2359 Version 1.4.0beta64 [June 24, 2009]
2360   Eliminated PNG_LEGACY_SUPPORTED code.
2361   Moved the various unknown chunk macro definitions outside of the
2362     PNG_READ|WRITE_ANCILLARY_CHUNK_SUPPORTED blocks.
2363 
2364 Version 1.4.0beta65 [June 26, 2009]
2365   Added a reference to the libpng license in each file.
2366 
2367 Version 1.4.0beta66 [June 27, 2009]
2368   Refer to the libpng license instead of the libpng license in each file.
2369 
2370 Version 1.4.0beta67 [July 6, 2009]
2371   Relocated INVERT_ALPHA within png_read_png() and png_write_png().
2372   Added high-level API transform PNG_TRANSFORM_GRAY_TO_RGB.
2373   Added an "xcode" project to the projects directory (Alam Arias).
2374 
2375 Version 1.4.0beta68 [July 19, 2009]
2376   Avoid some tests in filter selection in pngwutil.c
2377 
2378 Version 1.4.0beta69 [July 25, 2009]
2379   Simplified the new filter-selection test.  This runs faster in the
2380     common "PNG_ALL_FILTERS" and PNG_FILTER_NONE cases.
2381   Removed extraneous declaration from the new call to png_read_gray_to_rgb()
2382     (bug introduced in libpng-1.4.0beta67).
2383   Fixed up xcode project (Alam Arias)
2384   Added a prototype for png_64bit_product() in png.c
2385 
2386 Version 1.4.0beta70 [July 27, 2009]
2387   Avoid a possible NULL dereference in debug build, in png_set_text_2().
2388     (bug introduced in libpng-0.95, discovered by Evan Rouault)
2389 
2390 Version 1.4.0beta71 [July 29, 2009]
2391   Rebuilt configure scripts with autoconf-2.64.
2392 
2393 Version 1.4.0beta72 [August 1, 2009]
2394   Replaced *.tar.lzma with *.tar.xz in distribution.  Get the xz codec
2395     from <http://tukaani.org/xz>.
2396 
2397 Version 1.4.0beta73 [August 1, 2009]
2398   Reject attempt to write iCCP chunk with negative embedded profile length
2399     (JD Chen) (CVE-2009-5063).
2400 
2401 Version 1.4.0beta74 [August 8, 2009]
2402   Changed png_ptr and info_ptr member "trans" to "trans_alpha".
2403 
2404 Version 1.4.0beta75 [August 21, 2009]
2405   Removed an extra png_debug() recently added to png_write_find_filter().
2406   Fixed incorrect #ifdef in pngset.c regarding unknown chunk support.
2407 
2408 Version 1.4.0beta76 [August 22, 2009]
2409   Moved an incorrectly located test in png_read_row() in pngread.c
2410 
2411 Version 1.4.0beta77 [August 27, 2009]
2412   Removed lpXYZ.tar.bz2 (with CRLF), KNOWNBUG, libpng-x.y.z-KNOWNBUG.txt,
2413     and the "noconfig" files from the distribution.
2414   Moved CMakeLists.txt from scripts into the main libpng directory.
2415   Various bugfixes and improvements to CMakeLists.txt (Philip Lowman)
2416 
2417 Version 1.4.0beta78 [August 31, 2009]
2418   Converted all PNG_NO_* tests to PNG_*_SUPPORTED everywhere except pngconf.h
2419   Eliminated PNG_NO_FREE_ME and PNG_FREE_ME_SUPPORTED macros.
2420   Use png_malloc plus a loop instead of png_calloc() to initialize
2421     row_pointers in png_read_png().
2422 
2423 Version 1.4.0beta79 [September 1, 2009]
2424   Eliminated PNG_GLOBAL_ARRAYS and PNG_LOCAL_ARRAYS; always use local arrays.
2425   Eliminated PNG_CALLOC_SUPPORTED macro and always provide png_calloc().
2426 
2427 Version 1.4.0beta80 [September 17, 2009]
2428   Removed scripts/libpng.icc
2429   Changed typecast of filler from png_byte to png_uint_16 in png_set_filler().
2430     (Dennis Gustafsson)
2431   Fixed typo introduced in beta78 in pngtest.c ("#if def " should be "#ifdef ")
2432 
2433 Version 1.4.0beta81 [September 23, 2009]
2434   Eliminated unused PNG_FLAG_FREE_* defines from pngpriv.h
2435   Expanded TAB characters in pngrtran.c
2436   Removed PNG_CONST from all "PNG_CONST PNG_CHNK" declarations to avoid
2437     compiler complaints about doubly declaring things "const".
2438   Changed all "#if [!]defined(X)" to "if[n]def X" where possible.
2439   Eliminated unused png_ptr->row_buf_size
2440 
2441 Version 1.4.0beta82 [September 25, 2009]
2442   Moved redundant IHDR checking into new png_check_IHDR() in png.c
2443     and report all errors found in the IHDR data.
2444   Eliminated useless call to png_check_cHRM() from pngset.c
2445 
2446 Version 1.4.0beta83 [September 25, 2009]
2447   Revised png_check_IHDR() to eliminate bogus complaint about filter_type.
2448 
2449 Version 1.4.0beta84 [September 30, 2009]
2450   Fixed some inconsistent indentation in pngconf.h
2451   Revised png_check_IHDR() to add a test for width variable less than 32-bit.
2452 
2453 Version 1.4.0beta85 [October 1, 2009]
2454   Revised png_check_IHDR() again, to check info_ptr members instead of
2455     the contents of the returned parameters.
2456 
2457 Version 1.4.0beta86 [October 9, 2009]
2458   Updated the "xcode" project (Alam Arias).
2459   Eliminated a shadowed declaration of "pp" in png_handle_sPLT().
2460 
2461 Version 1.4.0rc01 [October 19, 2009]
2462   Trivial cosmetic changes.
2463 
2464 Version 1.4.0beta87 [October 30, 2009]
2465   Moved version 1.4.0 back into beta.
2466 
2467 Version 1.4.0beta88 [October 30, 2009]
2468   Revised libpng*.txt section about differences between 1.2.x and 1.4.0
2469     because most of the new features have now been ported back to 1.2.41
2470 
2471 Version 1.4.0beta89 [November 1, 2009]
2472   More bugfixes and improvements to CMakeLists.txt (Philip Lowman)
2473   Removed a harmless extra png_set_invert_alpha() from pngwrite.c
2474   Apply png_user_chunk_cache_max within png_decompress_chunk().
2475   Merged libpng-1.2.41.txt with libpng-1.4.0.txt where appropriate.
2476 
2477 Version 1.4.0beta90 [November 2, 2009]
2478   Removed all remaining WIN32_WCE #ifdefs except those involving the
2479     time.h "tm" structure
2480 
2481 Version 1.4.0beta91 [November 3, 2009]
2482   Updated scripts/pngw32.def and projects/wince/png32ce.def
2483   Copied projects/wince/png32ce.def to the scripts directory.
2484   Added scripts/makefile.wce
2485   Patched ltmain.sh for wince support.
2486   Added PNG_CONVERT_tIME_SUPPORTED macro.
2487 
2488 Version 1.4.0beta92 [November 4, 2009]
2489   Make inclusion of time.h in pngconf.h depend on PNG_CONVERT_tIME_SUPPORTED
2490   Make #define PNG_CONVERT_tIME_SUPPORTED depend on PNG_WRITE_tIME_SUPPORTED
2491   Revised libpng*.txt to describe differences from 1.2.40 to 1.4.0 (instead
2492     of differences from 1.2.41 to 1.4.0)
2493 
2494 Version 1.4.0beta93 [November 7, 2009]
2495   Added PNG_DEPSTRUCT, PNG_DEPRECATED, PNG_USE_RESULT, PNG_NORETURN, and
2496     PNG_ALLOCATED macros to detect deprecated direct access to the
2497     png_struct or info_struct members and other deprecated usage in
2498     applications (John Bowler).
2499   Updated scripts/makefile* to add "-DPNG_CONFIGURE_LIBPNG" to CFLAGS,
2500     to prevent warnings about direct access to png structs by libpng
2501     functions while building libpng.  They need to be tested, especially
2502     those using compilers other than gcc.
2503   Updated projects/visualc6 and visualc71 with "/d PNG_CONFIGURE_LIBPNG".
2504     They should work but still need to be updated to remove
2505     references to pnggccrd.c or pngvcrd.c and ASM building.
2506   Added README.txt to the beos, cbuilder5, netware, and xcode projects warning
2507     that they need to be updated, to remove references to pnggccrd.c and
2508     pngvcrd.c and to depend on pngpriv.h
2509   Removed three direct references to read_info_ptr members in pngtest.c
2510     that were detected by the new PNG_DEPSTRUCT macro.
2511   Moved the png_debug macro definitions and the png_read_destroy(),
2512     png_write_destroy() and png_far_to_near() prototypes from png.h
2513     to pngpriv.h (John Bowler)
2514   Moved the synopsis lines for png_read_destroy(), png_write_destroy()
2515     png_debug(), png_debug1(), and png_debug2() from libpng.3 to libpngpf.3.
2516 
2517 Version 1.4.0beta94 [November 9, 2009]
2518   Removed the obsolete, unused pnggccrd.c and pngvcrd.c files.
2519   Updated CMakeLists.txt to add "-DPNG_CONFIGURE_LIBPNG" to the definitions.
2520   Removed dependency of pngtest.o on pngpriv.h in the makefiles.
2521   Only #define PNG_DEPSTRUCT, etc. in pngconf.h if not already defined.
2522 
2523 Version 1.4.0beta95 [November 10, 2009]
2524   Changed png_check_sig() to !png_sig_cmp() in contrib programs.
2525   Added -DPNG_CONFIGURE_LIBPNG to contrib/pngminm/*/makefile
2526   Changed png_check_sig() to !png_sig_cmp() in contrib programs.
2527   Corrected the png_get_IHDR() call in contrib/gregbook/readpng2.c
2528   Changed pngminim/*/gather.sh to stop trying to remove pnggccrd.c and pngvcrd.c
2529   Added dependency on pngpriv.h in contrib/pngminim/*/makefile
2530 
2531 Version 1.4.0beta96 [November 12, 2009]
2532   Renamed scripts/makefile.wce to scripts/makefile.cegcc
2533   Revised Makefile.am to use libpng.sys while building libpng.so
2534     so that only PNG_EXPORT functions are exported.
2535   Removed the deprecated png_check_sig() function/macro.
2536   Removed recently removed function names from scripts/*.def
2537   Revised pngtest.png to put chunks in the same order written by pngtest
2538     (evidently the same change made in libpng-1.0beta54 was lost).
2539   Added PNG_PRIVATE macro definition in pngconf.h for possible future use.
2540 
2541 Version 1.4.0beta97 [November 13, 2009]
2542   Restored pngtest.png to the libpng-1.4.0beta7 version.
2543   Removed projects/beos and netware.txt; no one seems to be supporting them.
2544   Revised Makefile.in
2545 
2546 Version 1.4.0beta98 [November 13, 2009]
2547   Added the "xcode" project to zip distributions,
2548   Fixed a typo in scripts/pngwin.def introduced in beta97.
2549 
2550 Version 1.4.0beta99 [November 14, 2009]
2551   Moved libpng-config.in and libpng.pc-configure.in out of the scripts
2552     directory, to libpng-config.in and libpng-pc.in, respectively, and
2553     modified Makefile.am and configure.ac accordingly.  Now "configure"
2554     needs nothing from the "scripts" directory.
2555   Avoid redefining PNG_CONST in pngconf.h
2556 
2557 Version 1.4.0beta100 [November 14, 2009]
2558   Removed ASM builds from projects/visualc6 and projects/visualc71
2559   Removed scripts/makefile.nommx and makefile.vcawin32
2560   Revised CMakeLists.txt to account for new location of libpng-config.in
2561     and libpng-pc.in
2562   Updated INSTALL to reflect removal and relocation of files.
2563 
2564 Version 1.4.0beta101 [November 14, 2009]
2565   Restored the binary files (*.jpg, *.png, some project files) that were
2566     accidentally deleted from the zip and 7z distributions when the xcode
2567     project was added.
2568 
2569 Version 1.4.0beta102 [November 18, 2009]
2570   Added libpng-config.in and libpng-pc.in to the zip and 7z distributions.
2571   Fixed a typo in projects/visualc6/pngtest.dsp, introduced in beta100.
2572   Moved descriptions of makefiles and other scripts out of INSTALL into
2573     scripts/README.txt
2574   Updated the copyright year in scripts/pngwin.rc from 2006 to 2009.
2575 
2576 Version 1.4.0beta103 [November 21, 2009]
2577   Removed obsolete comments about ASM from projects/visualc71/README_zlib.txt
2578   Align row_buf on 16-byte boundary in memory.
2579   Restored the PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED guard around the call
2580     to png_flush() after png_write_IEND().  See 1.4.0beta32, 1.4.0beta50
2581     changes above and 1.2.30, 1.2.30rc01 and rc03 in 1.2.41 CHANGES.  Someone
2582     needs this feature.
2583   Make the 'png_jmpbuf' macro expand to a call that records the correct
2584     longjmp function as well as returning a pointer to the setjmp
2585     jmp_buf buffer, and marked direct access to jmpbuf 'deprecated'.
2586     (John Bowler)
2587 
2588 Version 1.4.0beta104 [November 22, 2009]
2589   Removed png_longjmp_ptr from scripts/*.def and libpng.3
2590   Rebuilt configure scripts with autoconf-2.65
2591 
2592 Version 1.4.0beta105 [November 25, 2009]
2593   Use fast integer PNG_DIVIDE_BY_255() or PNG_DIVIDE_BY_65535()
2594     to accomplish alpha premultiplication when
2595     PNG_READ_COMPOSITE_NODIV_SUPPORTED is defined.
2596   Changed "/255" to "/255.0" in background calculations to make it clear
2597     that the 255 is used as a double.
2598 
2599 Version 1.4.0beta106 [November 27, 2009]
2600   Removed premultiplied alpha feature.
2601 
2602 Version 1.4.0beta107 [December 4, 2009]
2603   Updated README
2604   Added "#define PNG_NO_PEDANTIC_WARNINGS" in the libpng source files.
2605   Removed "-DPNG_CONFIGURE_LIBPNG" from the makefiles and projects.
2606   Revised scripts/makefile.netbsd, makefile.openbsd, and makefile.sco
2607     to put png.h and pngconf.h in $prefix/include, like the other scripts,
2608     instead of in $prefix/include/libpng.  Also revised makefile.sco
2609     to put them in $prefix/include/libpng15 instead of in
2610     $prefix/include/libpng/libpng15.
2611 
2612 Version 1.4.0beta108 [December 11, 2009]
2613   Removed leftover "-DPNG_CONFIGURE_LIBPNG" from contrib/pngminim/*/makefile
2614   Relocated png_do_chop() to its original position in pngrtran.c; the
2615     change in version 1.2.41beta08 caused transparency to be handled wrong
2616     in some 16-bit datastreams (Yusaku Sugai).
2617 
2618 Version 1.4.0beta109 [December 13, 2009]
2619   Added "bit_depth" parameter to the private png_build_gamma_table() function.
2620   Pass bit_depth=8 to png_build_gamma_table() when bit_depth is 16 but the
2621     PNG_16_TO_8 transform has been set, to avoid unnecessary build of 16-bit
2622     tables.
2623 
2624 Version 1.4.0rc02 [December 20, 2009]
2625   Declared png_cleanup_needed "volatile" in pngread.c and pngwrite.c
2626 
2627 Version 1.4.0rc03 [December 22, 2009]
2628   Renamed libpng-pc.in back to libpng.pc.in and revised CMakeLists.txt
2629     (revising the change in 1.4.0beta99)
2630 
2631 Version 1.4.0rc04 [December 25, 2009]
2632   Swapped PNG_UNKNOWN_CHUNKS_SUPPORTED and PNG_HANDLE_AS_UNKNOWN_SUPPORTED
2633     in pngset.c to be consistent with other changes in version 1.2.38.
2634 
2635 Version 1.4.0rc05 [December 25, 2009]
2636   Changed "libpng-pc.in" to "libpng.pc.in" in configure.ac, configure, and
2637     Makefile.in to be consistent with changes in libpng-1.4.0rc03
2638 
2639 Version 1.4.0rc06 [December 29, 2009]
2640   Reverted the gamma_table changes from libpng-1.4.0beta109.
2641   Fixed some indentation errors.
2642 
2643 Version 1.4.0rc07 [January 1, 2010]
2644   Revised libpng*.txt and libpng.3 about 1.2.x->1.4.x differences.
2645   Use png_calloc() instead of png_malloc(); png_memset() in pngrutil.c
2646   Update copyright year to 2010.
2647 
2648 Version 1.4.0rc08 [January 2, 2010]
2649   Avoid deprecated references to png_ptr-io_ptr and png_ptr->error_ptr
2650     in pngtest.c
2651 
2652 Version 1.4.0 [January 3, 2010]
2653   No changes.
2654 
2655 Version 1.4.1beta01 [January 8, 2010]
2656   Updated CMakeLists.txt for consistent indentation and to avoid an
2657     unclosed if-statement warning (Philip Lowman).
2658   Revised Makefile.am and Makefile.in to remove references to Y2KINFO,
2659     KNOWNBUG, and libpng.la (Robert Schwebel).
2660   Revised the makefiles to install the same files and symbolic
2661     links as configure, except for libpng.la and libpng14.la.
2662   Make png_set|get_compression_buffer_size() available even when
2663     PNG_WRITE_SUPPORTED is not enabled.
2664   Revised Makefile.am and Makefile.in to simplify their maintenance.
2665   Revised scripts/makefile.linux to install a link to libpng14.so.14.1
2666 
2667 Version 1.4.1beta02 [January 9, 2010]
2668   Revised the rest of the makefiles to install a link to libpng14.so.14.1
2669 
2670 Version 1.4.1beta03 [January 10, 2010]
2671   Removed png_set_premultiply_alpha() from scripts/*.def
2672 
2673 Version 1.4.1rc01 [January 16, 2010]
2674   No changes.
2675 
2676 Version 1.4.1beta04 [January 23, 2010]
2677   Revised png_decompress_chunk() to improve speed and memory usage when
2678     decoding large chunks.
2679   Added png_set|get_chunk_malloc_max() functions.
2680 
2681 Version 1.4.1beta05 [January 26, 2010]
2682   Relocated "int k" declaration in pngtest.c to minimize its scope.
2683 
2684 Version 1.4.1beta06 [January 28, 2010]
2685   Revised png_decompress_chunk() to use a two-pass method suggested by
2686     John Bowler.
2687 
2688 Version 1.4.1beta07 [February 6, 2010]
2689   Folded some long lines in the source files.
2690   Added defineable PNG_USER_CHUNK_CACHE_MAX, PNG_USER_CHUNK_MALLOC_MAX,
2691     and a PNG_USER_LIMITS_SUPPORTED flag.
2692   Eliminated use of png_ptr->irowbytes and reused the slot in png_ptr as
2693     png_ptr->png_user_chunk_malloc_max.
2694   Revised png_push_save_buffer() to do fewer but larger png_malloc() calls.
2695 
2696 Version 1.4.1beta08 [February 6, 2010]
2697   Minor cleanup and updating of dates and copyright year.
2698 
2699 Version 1.5.0beta01 [February 7, 2010]
2700   Moved declaration of png_struct into private pngstruct.h and png_info
2701     into pnginfo.h
2702 
2703 Version 1.4.1beta09 and 1.5.0beta02 [February 7, 2010]
2704   Reverted to original png_push_save_buffer() code.
2705 
2706 Version 1.4.1beta10 and 1.5.0beta03 [February 8, 2010]
2707   Return allocated "old_buffer" in png_push_save_buffer() before
2708     calling png_error(), to avoid a potential memory leak.
2709   Updated configure script to use SO number 15.
2710 
2711 Version 1.5.0beta04 [February 9, 2010]
2712   Removed malformed "incomplete struct declaration" of png_info from png.h
2713 
2714 Version 1.5.0beta05 [February 12, 2010]
2715   Removed PNG_DEPSTRUCT markup in pngstruct.h and pnginfo.h, and undid the
2716     linewrapping that it entailed.
2717   Revised comments in pngstruct.h and pnginfo.h and added pointers to
2718     the libpng license.
2719   Changed PNG_INTERNAL to PNG_EXPOSE_INTERNAL_STRUCTURES
2720   Removed the cbuilder5 project, which has not been updated to 1.4.0.
2721 
2722 Version 1.4.1beta12 and 1.5.0beta06 [February 14, 2010]
2723   Fixed type declaration of png_get_chunk_malloc_max() in pngget.c (Daisuke
2724     Nishikawa)
2725 
2726 Version 1.5.0beta07 [omitted]
2727 
2728 Version 1.5.0beta08 [February 19, 2010]
2729   Changed #ifdef PNG_NO_STDIO_SUPPORTED to #ifdef PNG_NO_CONSOLE_IO_SUPPORTED
2730     wherever png_snprintf() is used to construct error and warning messages.
2731   Noted in scripts/makefile.mingw that it expects to be run under MSYS.
2732   Removed obsolete unused MMX-querying support from contrib/gregbook
2733   Added exported png_longjmp() function.
2734   Removed the AIX redefinition of jmpbuf in png.h
2735   Added -D_ALLSOURCE in configure.ac, makefile.aix, and CMakeLists.txt
2736     when building on AIX.
2737 
2738 Version 1.5.0beta09 [February 19, 2010]
2739   Removed -D_ALLSOURCE from configure.ac, makefile.aix, and CMakeLists.txt.
2740   Changed the name of png_ptr->jmpbuf to png_ptr->png_jmpbuf in pngstruct.h
2741 
2742 Version 1.5.0beta10 [February 25, 2010]
2743   Removed unused gzio.c from contrib/pngminim gather and makefile scripts
2744   Removed replacement error handlers from contrib/gregbook.  Because of
2745     the new png_longjmp() function they are no longer needed.
2746 
2747 Version 1.5.0beta11 [March 6, 2010]
2748   Removed checking for already-included setjmp.h from pngconf.h
2749   Fixed inconsistent indentations and made numerous cosmetic changes.
2750   Revised the "SEE ALSO" style of libpng.3, libpngpf.3, and png.5
2751 
2752 Version 1.5.0beta12 [March 9, 2010]
2753   Moved "#include png.h" inside pngpriv.h and removed "#include png.h" from
2754     the source files, along with "#define PNG_EXPOSE_INTERNAL_STRUCTURES"
2755     and "#define PNG_NO_PEDANTIC_WARNINGS" (John Bowler).
2756   Created new pngdebug.h and moved debug definitions there.
2757 
2758 Version 1.5.0beta13 [March 10, 2010]
2759   Protect pngstruct.h, pnginfo.h, and pngdebug.h from being included twice.
2760   Revise the "#ifdef" blocks in png_inflate() so it will compile when neither
2761     PNG_USER_CHUNK_MALLOC_MAX nor PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
2762     is defined.
2763   Removed unused png_measure_compressed_chunk() from pngpriv.h and libpngpf.3
2764   Moved the 'config.h' support from pngconf.h to pngpriv.h
2765   Removed PNGAPI from the png_longjmp_ptr typedef.
2766   Eliminated dependence of pngtest.c on the private pngdebug.h file.
2767   Make all png_debug macros into *unterminated* statements or
2768     expressions (i.e. a trailing ';' must always be added) and correct
2769     the format statements in various png_debug messages.
2770 
2771 Version 1.5.0beta14 [March 14, 2010]
2772   Removed direct access to png_ptr->io_ptr from the Windows code in pngtest.c
2773   Revised Makefile.am to account for recent additions and replacements.
2774   Corrected CE and OS/2 DEF files (scripts/png*def) for symbols removed and
2775     added ordinal numbers to the Windows DEF file and corrected the duplicated
2776     ordinal numbers on CE symbols that are commented out.
2777   Added back in export symbols that can be present in the Windows build but
2778     are disabled by default.
2779   PNG_EXPORT changed to include an 'ordinal' field for DEF file generation.
2780     PNG_CALLBACK added to make callback definitions uniform.  PNGAPI split
2781     into PNGCAPI (base C form), PNGAPI (exports) and PNGCBAPI (callbacks),
2782     and appropriate changes made to all files.  Cygwin builds re-hinged to
2783     allow procedure call standard changes and to remove the need for the DEF
2784     file (fixes build on Cygwin).
2785   Enabled 'attribute' warnings that are relevant to library APIs and callbacks.
2786   Changed rules for generation of the various symbol files and added a new
2787     rule for a DEF file (which is also added to the distribution).
2788   Updated the symbol file generation to stop it adding spurious spaces
2789     to EOL (coming from preprocessor macro expansion).  Added a facility
2790     to join tokens in the output and rewrite *.dfn to use this.
2791   Eliminated scripts/*.def in favor of libpng.def; updated projects/visualc71
2792     and removed scripts/makefile.cygwin.
2793   Made PNG_BUILD_DLL safe: it can be set whenever a DLL is being built.
2794   Removed the include of sys/types.h - apparently unnecessary now on the
2795     platforms on which it happened (all but Mac OS and RISC OS).
2796   Moved the Mac OS test into pngpriv.h (the only place it is used.)
2797 
2798 Version 1.5.0beta15 [March 17, 2010]
2799   Added symbols.chk target to Makefile.am to validate the symbols in png.h
2800     against the new DEF file scripts/symbols.def.
2801   Changed the default DEF file back to pngwin.def.
2802   Removed makefile.mingw.
2803   Eliminated PNG_NO_EXTERN and PNG_ALL_EXTERN
2804 
2805 Version 1.5.0beta16 [April 1, 2010]
2806   Make png_text_struct independent of PNG_iTXt_SUPPORTED, so that
2807     fields are initialized in all configurations.  The READ/WRITE
2808     macros (PNG_(READ|WRITE)_iTXt_SUPPORTED) still function as
2809     before to disable code to actually read or write iTXt chunks
2810     and iTXt_SUPPORTED can be used to detect presence of either
2811     read or write support (but it is probably better to check for
2812     the one actually required - read or write.)
2813   Combined multiple png_warning() calls for a single error.
2814   Restored the macro definition of png_check_sig().
2815 
2816 Version 1.5.0beta17 [April 17, 2010]
2817   Added some "(long)" typecasts to printf calls in png_handle_cHRM().
2818   Documented the fact that png_set_dither() was disabled since libpng-1.4.0.
2819   Reenabled png_set_dither() but renamed it to png_set_quantize() to reflect
2820     more accurately what it actually does.  At the same time, renamed
2821     the PNG_DITHER_[RED,GREEN_BLUE]_BITS macros to
2822     PNG_QUANTIZE_[RED,GREEN,BLUE]_BITS.
2823   Added some "(long)" typecasts to printf calls in png_handle_cHRM().
2824   Freeze build-time only configuration in the build.
2825     In all prior versions of libpng most configuration options
2826     controlled by compiler #defines had to be repeated by the
2827     application code that used libpng.  This patch changes this
2828     so that compilation options that can only be changed at build
2829     time are frozen in the build.  Options that are compiler
2830     dependent (and those that are system dependent) are evaluated
2831     each time - pngconf.h holds these.  Options that can be changed
2832     per-file in the application are in png.h.  Frozen options are
2833     in the new installed header file pnglibconf.h (John Bowler)
2834   Removed the xcode project because it has not been updated to work
2835     with libpng-1.5.0.
2836   Removed the ability to include optional pngusr.h
2837 
2838 Version 1.5.0beta18 [April 17, 2010]
2839   Restored the ability to include optional pngusr.h
2840   Moved replacements for png_error() and png_warning() from the
2841     contrib/pngminim project to pngerror.c, for use when warnings or
2842     errors are disabled via PNG_NO_WARN or PNG_NO_ERROR_TEXT, to avoid
2843     storing unneeded error/warning text.
2844   Updated contrib/pngminim project to work with the new pnglibconf.h
2845   Added some PNG_NO_* defines to contrib/pngminim/*/pngusr.h to save space.
2846 
2847 Version 1.5.0beta19 [April 24, 2010]
2848   Added PNG_{READ,WRITE}_INT_FUNCTIONS_SUPPORTED.  This allows the functions
2849     to read and write ints to be disabled independently of PNG_USE_READ_MACROS,
2850     which allows libpng to be built with the functions even though the default
2851     is to use the macros - this allows applications to choose at app build
2852     time whether or not to use macros (previously impossible because the
2853     functions weren't in the default build.)
2854   Changed Windows calling convention back to __cdecl for API functions.
2855     For Windows/x86 platforms only:
2856       __stdcall is no longer needed for Visual Basic, so libpng-1.5.0 uses
2857       __cdecl throughout (both API functions and callbacks) on Windows/x86
2858       platforms.
2859   Replaced visualc6 and visualc71 projects with new vstudio project
2860   Relaxed the overly-restrictive permissions of some files.
2861 
2862 Version 1.5.0beta20 [April 24, 2010]
2863   Relaxed more overly-restrictive permissions of some files.
2864 
2865 Version 1.5.0beta21 [April 27, 2010]
2866   Removed some unwanted binary bytes and changed CRLF to NEWLINE in the new
2867     vstudio project files, and some trivial editing of some files in the
2868     scripts directory.
2869   Set PNG_NO_READ_BGR, PNG_NO_IO_STATE, and PNG_NO_TIME_RFC1123 in
2870     contrib/pngminim/decoder/pngusr.h to make a smaller decoder application.
2871 
2872 Version 1.5.0beta22 [April 28, 2010]
2873   Fixed dependencies of GET_INT_32 - it does not require READ_INT_FUNCTIONS
2874     because it has a macro equivalent.
2875   Improved the options.awk script; added an "everything off" option.
2876   Revised contrib/pngminim to use the "everything off" option in pngusr.dfa.
2877 
2878 Version 1.5.0beta23 [April 29, 2010]
2879   Corrected PNG_REMOVED macro to take five arguments.
2880     The macro was documented with two arguments (name,ordinal), however
2881     the symbol checking .dfn files assumed five arguments.  The five
2882     argument form seems more useful so it is changed to that.
2883   Corrected PNG_UNKNOWN_CHUNKS_SUPPORTED to PNG_HANDLE_AS_UNKNOWN_SUPPORTED
2884     in gregbook/readpng2.c
2885   Corrected protection of png_get_user_transform_ptr. The API declaration in
2886     png.h is removed if both READ and WRITE USER_TRANSFORM are turned off
2887     but was left defined in pngtrans.c
2888   Added logunsupported=1 to cause pnglibconf.h to document disabled options.
2889     This makes the installed pnglibconf.h more readable but causes no
2890     other change.  The intention is that users of libpng will find it
2891     easier to understand if an API they need is missing.
2892   Include png_reset_zstream() in png.c only when PNG_READ_SUPPORTED is defined.
2893   Removed dummy_inflate.c from contrib/pngminim/encoder
2894   Removed contrib/pngminim/*/gather.sh; gathering is now done in the makefile.
2895 
2896 Version 1.5.0beta24 [May 7, 2010]
2897   Use bitwise "&" instead of arithmetic mod in pngrutil.c calculation of the
2898     offset of the png_ptr->rowbuf pointer into png_ptr->big_row_buf.
2899   Added more blank lines for readability.
2900 
2901 Version 1.5.0beta25 [June 18, 2010]
2902   In pngpread.c: png_push_have_row() add check for new_row > height
2903   Removed the now-redundant check for out-of-bounds new_row from example.c
2904 
2905 Version 1.5.0beta26 [June 18, 2010]
2906   In pngpread.c: png_push_process_row() add check for too many rows.
2907 
2908 Version 1.5.0beta27 [June 18, 2010]
2909   Removed the check added in beta25 as it is now redundant.
2910 
2911 Version 1.5.0beta28 [June 20, 2010]
2912   Rewrote png_process_IDAT_data to consistently treat extra data as warnings
2913     and handle end conditions more cleanly.
2914   Removed the new (beta26) check in png_push_process_row().
2915 
2916 Version 1.5.0beta29 [June 21, 2010]
2917   Revised scripts/options.awk to work on Sunos (but still doesn't work)
2918   Added comment to options.awk and contrib/pngminim/*/makefile to try nawk.
2919 
2920 Version 1.5.0beta30 [June 22, 2010]
2921   Stop memory leak when reading a malformed sCAL chunk.
2922 
2923 Version 1.5.0beta31 [June 26, 2010]
2924   Revised pngpread.c patch of beta28 to avoid an endless loop.
2925   Removed some trailing blanks.
2926 
2927 Version 1.5.0beta32 [June 26, 2010]
2928   Removed leftover scripts/options.patch and scripts/options.rej
2929 
2930 Version 1.5.0beta33 [July 6, 3010]
2931   Made FIXED and FLOATING options consistent in the APIs they enable and
2932     disable.  Corrected scripts/options.awk to handle both command line
2933     options and options specified in the .dfa files.
2934   Changed char *msg to PNG_CONST char *msg in pngrutil.c
2935   Make png_set_sRGB_gAMA_and_cHRM set values using either the fixed or
2936     floating point APIs, but not both.
2937   Reversed patch to remove error handler when the jmp_buf is stored in the
2938     main program structure, not the png_struct.
2939     The error handler is needed because the default handler in libpng will
2940     always use the jmp_buf in the library control structure; this is never
2941     set.  The gregbook code is a useful example because, even though it
2942     uses setjmp/longjmp, it shows how error handling can be implemented
2943     using control mechanisms not directly supported by libpng.  The
2944     technique will work correctly with mechanisms such as Microsoft
2945     Structure Exceptions or C++ exceptions (compiler willing - note that gcc
2946     does not by default support interworking of C and C++ error handling.)
2947   Reverted changes to call png_longjmp in contrib/gregbook where it is not
2948     appropriate.  If mainprog->jmpbuf is used by setjmp, then png_longjmp
2949     cannot be used.
2950   Changed "extern PNG_EXPORT" to "PNG_EXPORT" in png.h (Jan Nijtmans)
2951   Changed "extern" to "PNG_EXTERN" in pngpriv.h (except for the 'extern "C" {')
2952 
2953 Version 1.5.0beta34 [July 12, 2010]
2954   Put #ifndef PNG_EXTERN, #endif around the define PNG_EXTERN in pngpriv.h
2955 
2956 Version 1.5.0beta35 [July 24, 2010]
2957   Removed some newly-added TAB characters.
2958   Added -DNO_PNG_SNPRINTF to CFLAGS in scripts/makefile.dj2
2959   Moved the definition of png_snprintf() outside of the enclosing
2960     #ifdef blocks in pngconf.h
2961 
2962 Version 1.5.0beta36 [July 29, 2010]
2963   Patches by John Bowler:
2964   Fixed point APIs are now supported throughout (no missing APIs).
2965   Internal fixed point arithmetic support exists for all internal floating
2966     point operations.
2967   sCAL validates the floating point strings it is passed.
2968   Safe, albeit rudimentary, Watcom support is provided by PNG_API_RULE==2
2969   Two new APIs exist to get the number of passes without turning on the
2970     PNG_INTERLACE transform and to get the number of rows in the current
2971     pass.
2972   A new test program, pngvalid.c, validates the gamma code.
2973   Errors in the 16-bit gamma correction (overflows) have been corrected.
2974   cHRM chunk testing is done consistently (previously the floating point
2975     API bypassed it, because the test really didn't work on FP, now the test
2976     is performed on the actual values to be stored in the PNG file so it
2977     works in the FP case too.)
2978   Most floating point APIs now simply call the fixed point APIs after
2979     converting the values to the fixed point form used in the PNG file.
2980   The standard headers no longer include zlib.h, which is currently only
2981     required for pngstruct.h and can therefore be internal.
2982   Revised png_get_int_32 to undo the PNG two's complement representation of
2983     negative numbers.
2984 
2985 Version 1.5.0beta37 [July 30, 2010]
2986   Added a typecast in png_get_int_32() in png.h and pngrutil.h to avoid
2987     a compiler warning.
2988   Replaced oFFs 0,0 with oFFs -10,20 in pngtest.png
2989 
2990 Version 1.5.0beta38 [July 31, 2010]
2991   Implemented remaining "_fixed" functions.
2992   Corrected a number of recently introduced warnings mostly resulting from
2993     safe but uncast assignments to shorter integers.  Also added a zlib
2994     VStudio release library project because the latest zlib Official Windows
2995     build does not include such a thing.
2996   Revised png_get_int_16() to be similar to png_get_int_32().
2997   Restored projects/visualc71.
2998 
2999 Version 1.5.0beta39 [August 2, 2010]
3000   VisualC/GCC warning fixes, VisualC build fixes
3001   The changes include support for function attributes in VC in addition to
3002     those already present in GCC - necessary because without these some
3003     warnings are unavoidable.  Fixes include signed/unsigned fixes in
3004     pngvalid and checks with gcc -Wall -Wextra -Wunused.
3005   VC requires function attributes on function definitions as well as
3006     declarations, PNG_FUNCTION has been added to enable this and the
3007     relevant function definitions changed.
3008 
3009 Version 1.5.0beta40 [August 6, 2010]
3010   Correct use of _WINDOWS_ in pngconf.h
3011   Removed png_mem_ #defines; they are no longer used.
3012   Added the sRGB chunk to pngtest.png
3013 
3014 Version 1.5.0beta41 [August 11, 2010]
3015   Added the cHRM chunk to pngtest.png
3016   Don't try to use version-script with cygwin/mingw.
3017   Revised contrib/gregbook to work under cygwin/mingw.
3018 
3019 Version 1.5.0beta42 [August 18, 2010]
3020   Add .dll.a to the list of extensions to be symlinked by Makefile.am (Yaakov)
3021   Made all API functions that have const arguments and constant string
3022     literal pointers declare them (John Bowler).
3023 
3024 Version 1.5.0beta43 [August 20, 2010]
3025   Removed spurious tabs, shorten long lines (no source change)
3026     Also added scripts/chkfmt to validate the format of all the files that can
3027     reasonably be validated (it is suggested to run "make distclean" before
3028     checking, because some machine generated files have long lines.)
3029   Reformatted the CHANGES file to be more consistent throughout.
3030   Made changes to address various issues identified by GCC, mostly
3031     signed/unsigned and shortening problems on assignment but also a few
3032     difficult to optimize (for GCC) loops.
3033   Fixed non-GCC fixed point builds.  In png.c a declaration was misplaced
3034     in an earlier update.  Fixed to declare the auto variables at the head.
3035   Use cexcept.h in pngvalid.c.
3036 
3037 Version 1.5.0beta44 [August 24, 2010]
3038   Updated CMakeLists.txt to use CMAKE_INSTALL_LIBDIR variable; useful for
3039     installing libpng in /usr/lib64 (Funda Wang).
3040   Revised CMakeLists.txt to put the man pages in share/man/man* not man/man*
3041   Revised CMakeLists.txt to make symlinks instead of copies when installing.
3042   Changed PNG_LIB_NAME from pngNN to libpngNN in CMakeLists.txt (Philip Lowman)
3043   Implemented memory checks within pngvalid
3044   Reformatted/rearranged pngvalid.c to assist use of progressive reader.
3045   Check interlaced images in pngvalid
3046   Clarified pngusr.h comments in pnglibconf.dfa
3047   Simplified the pngvalid error-handling code now that cexcept.h is in place.
3048   Implemented progressive reader in pngvalid.c for standard tests
3049   Implemented progressive read in pngvalid.c gamma tests
3050   Turn on progressive reader in pngvalid.c by default and tidy code.
3051 
3052 Version 1.5.0beta45 [August 26, 2010]
3053   Added an explicit make step to projects/vstudio for pnglibconf.h
3054     Also corrected zlib.vcxproj into which Visual Studio had introduced
3055     what it calls an "authoring error".  The change to make pnglibconf.h
3056     simply copies the file; in the future it may actually generate the
3057     file from scripts/pnglibconf.dfa as the other build systems do.
3058   Changed pngvalid to work when floating point APIs are disabled
3059   Renamed the prebuilt scripts/pnglibconf.h to scripts/pnglibconf.h.prebuilt
3060   Supply default values for PNG_USER_PRIVATEBUILD and PNG_USER_DLLFNAME_POSTFIX
3061     in pngpriv.h in case the user neglected to define them in their pngusr.h
3062 
3063 Version 1.5.0beta46 [August 28, 2010]
3064   Added new private header files to libpng_sources in CMakeLists.txt
3065   Added PNG_READ_16BIT, PNG_WRITE_16BIT, and PNG_16BIT options.
3066   Added reference to scripts/pnglibconf.h.prebuilt in the visualc71 project.
3067 
3068 Version 1.5.0beta47 [September 11, 2010]
3069   Fixed a number of problems with 64-bit compilation reported by Visual
3070     Studio 2010 (John Bowler).
3071 
3072 Version 1.5.0beta48 [October 4, 2010]
3073   Updated CMakeLists.txt (Philip Lowman).
3074   Revised autogen.sh to recognize and use $AUTOCONF, $AUTOMAKE, $AUTOHEADER,
3075     $AUTOPOINT, $ACLOCAL and $LIBTOOLIZE
3076   Fixed problem with symbols creation in Makefile.am which was assuming that
3077     all versions of ccp write to standard output by default (Martin Banky). The
3078     bug was introduced in libpng-1.2.9beta5.
3079   Removed unused mkinstalldirs.
3080 
3081 Version 1.5.0beta49 [October 8, 2010]
3082   Undid Makefile.am revision of 1.5.0beta48.
3083 
3084 Version 1.5.0beta50 [October 14, 2010]
3085   Revised Makefile.in to account for mkinstalldirs being removed.
3086   Added some "(unsigned long)" typecasts in printf statements in pngvalid.c.
3087   Suppressed a compiler warning in png_handle_sPLT().
3088   Check for out-of-range text compression mode in png_set_text().
3089 
3090 Version 1.5.0beta51 [October 15, 2010]
3091   Changed embedded dates to "(PENDING RELEASE) in beta releases (and future
3092     rc releases) to minimize the difference between releases.
3093 
3094 Version 1.5.0beta52 [October 16, 2010]
3095   Restored some of the embedded dates (in png.h, png.c, documentation, etc.)
3096 
3097 Version 1.5.0beta53 [October 18, 2010]
3098   Updated INSTALL to mention using "make maintainer-clean" and to remove
3099     obsolete statement about a custom ltmain.sh
3100   Disabled "color-tests" by default in Makefile.am so it will work with
3101     automake versions earlier than 1.11.1
3102   Use document name "libpng-manual.txt" instead of "libpng-<version>.txt"
3103     to simplify version differences.
3104   Removed obsolete remarks about setjmp handling from INSTALL.
3105   Revised and renamed the typedef in png.h and png.c that was designed
3106     to catch library and header mismatch.
3107 
3108 Version 1.5.0beta54 [November 10, 2010]
3109   Require 48 bytes, not 64 bytes, for big_row_buf in overflow checks.
3110   Used a consistent structure for the pngget.c functions.
3111 
3112 Version 1.5.0beta55 [November 21, 2010]
3113   Revised png_get_uint_32, png_get_int_32, png_get_uint_16 (Cosmin)
3114   Moved reading of file signature into png_read_sig (Cosmin)
3115   Fixed atomicity of chunk header serialization (Cosmin)
3116   Added test for io_state in pngtest.c (Cosmin)
3117   Added "#!/bin/sh" at the top of contrib/pngminim/*/gather.sh scripts.
3118   Changes to remove gcc warnings (John Bowler)
3119     Certain optional gcc warning flags resulted in warnings in libpng code.
3120     With these changes only -Wconversion and -Wcast-qual cannot be turned on.
3121     Changes are trivial rearrangements of code.  -Wconversion is not possible
3122     for pngrutil.c (because of the widespread use of += et al on variables
3123     smaller than (int) or (unsigned int)) and -Wcast-qual is not possible
3124     with pngwio.c and pngwutil.c because the 'write' callback and zlib
3125     compression both fail to declare their input buffers with 'const'.
3126 
3127 Version 1.5.0beta56 [December 7, 2010]
3128   Added the private PNG_UNUSED() macro definition in pngpriv.h.
3129   Added some commentary about PNG_EXPORT in png.h and pngconf.h
3130   Revised PNG_EXPORT() macro and added PNG_EXPORTA() macro, with the
3131     objective of simplifying and improving the cosmetic appearance of png.h.
3132   Fixed some incorrect "=" macro names in pnglibconf.dfa
3133   Included documentation of changes in 1.5.0 from 1.4.x in libpng-manual.txt
3134 
3135 Version 1.5.0beta57 [December 9, 2010]
3136   Documented the pngvalid gamma error summary with additional comments and
3137     print statements.
3138   Improved missing symbol handling in checksym.awk; symbols missing in both
3139     the old and new files can now be optionally ignored, treated as errors
3140     or warnings.
3141   Removed references to pngvcrd.c and pnggccrd.c from the vstudio project.
3142   Updated "libpng14" to "libpng15" in the visualc71 project.
3143   Enabled the strip16 tests in pngvalid.`
3144   Don't display test results (except PASS/FAIL) when running "make test".
3145     Instead put them in pngtest-log.txt
3146   Added "--with-zprefix=<string>" to configure.ac
3147   Updated the prebuilt configuration files to autoconf version 2.68
3148 
3149 Version 1.5.0beta58 [December 19, 2010]
3150   Fixed interlace image handling and add test cases (John Bowler)
3151   Fixed the clean rule in Makefile.am to remove pngtest-log.txt
3152   Made minor changes to work around warnings in gcc 3.4
3153 
3154 Version 1.5.0rc01 [December 27, 2010]
3155   No changes.
3156 
3157 Version 1.5.0rc02 [December 27, 2010]
3158   Eliminated references to the scripts/*.def files in project/visualc71.
3159 
3160 Version 1.5.0rc03 [December 28, 2010]
3161   Eliminated scripts/*.def and revised Makefile.am accordingly
3162 
3163 Version 1.5.0rc04 [December 29, 2010]
3164   Fixed bug in background transformation handling in pngrtran.c (it was
3165     looking for the flag in png_ptr->transformations instead of in
3166     png_ptr->flags) (David Raymond).
3167 
3168 Version 1.5.0rc05 [December 31, 2010]
3169   Fixed typo in a comment in CMakeLists.txt (libpng14 => libpng15) (Cosmin)
3170 
3171 Version 1.5.0rc06 [January 4, 2011]
3172   Changed the new configure option "zprefix=string" to "zlib-prefix=string"
3173 
3174 Version 1.5.0rc07 [January 4, 2011]
3175   Updated copyright year.
3176 
3177 Version 1.5.0 [January 6, 2011]
3178   No changes.
3179 
3180 version 1.5.1beta01 [January 8, 2011]
3181   Added description of png_set_crc_action() to the manual.
3182   Added a note in the manual that the type of the iCCP profile was changed
3183     from png_charpp to png_bytepp in png_get_iCCP().  This change happened
3184     in version 1.5.0beta36 but is not noted in the CHANGES.  Similarly,
3185     it was changed from png_charpp to png_const_bytepp in png_set_iCCP().
3186   Ensure that png_rgb_to_gray ignores palette mapped images, if libpng
3187     internally happens to call it with one, and fixed a failure to handle
3188     palette mapped images correctly.  This fixes CVE-2690.
3189 
3190 Version 1.5.1beta02 [January 14, 2011]
3191   Fixed a bug in handling of interlaced images (bero at arklinux.org).
3192   Updated CMakeLists.txt (Clifford Yapp)
3193 
3194 Version 1.5.1beta03 [January 14, 2011]
3195   Fixed typecasting of some png_debug() statements (Cosmin)
3196 
3197 Version 1.5.1beta04 [January 16, 2011]
3198   Updated documentation of png_set|get_tRNS() (Thomas Klausner).
3199   Mentioned in the documentation that applications must #include "zlib.h"
3200     if they need access to anything in zlib.h, and that a number of
3201     macros such as png_memset() are no longer accessible by applications.
3202   Corrected pngvalid gamma test "sample" function to access all of the color
3203     samples of each pixel, instead of sampling the red channel three times.
3204   Prefixed variable names index, div, exp, gamma with "png_" to avoid "shadow"
3205     warnings, and (mistakenly) changed png_exp() to exp().
3206 
3207 Version 1.5.1beta05 [January 16, 2011]
3208   Changed variable names png_index, png_div, png_exp, and png_gamma to
3209     char_index, divisor, exp_b10, and gamma_val, respectively, and
3210     changed exp() back to png_exp().
3211 
3212 Version 1.5.1beta06 [January 20, 2011]
3213   Prevent png_push_crc_skip() from hanging while reading an unknown chunk
3214     or an over-large compressed zTXt chunk with the progressive reader.
3215   Eliminated more GCC "shadow" warnings.
3216   Revised png_fixed() in png.c to avoid compiler warning about reaching the
3217     end without returning anything.
3218 
3219 Version 1.5.1beta07 [January 22, 2011]
3220   In the manual, describe the png_get_IHDR() arguments in the correct order.
3221   Added const_png_structp and const_png_infop types, and used them in
3222     prototypes for most png_get_*() functions.
3223 
3224 Version 1.5.1beta08 [January 23, 2011]
3225   Added png_get_io_chunk_type() and deprecated png_get_io_chunk_name()
3226   Added synopses for the IO_STATE functions and other missing synopses
3227     to the manual. Removed the synopses from libpngpf.3 because they
3228     were out of date and no longer useful.  Better information can be
3229     obtained by reading the prototypes and comments in pngpriv.h
3230   Attempted to fix cpp on Solaris with S. Studio 12 cc, fix build
3231     Added a make macro DFNCPP that is a CPP that will accept the tokens in
3232     a .dfn file and adds configure stuff to test for such a CPP.  ./configure
3233     should fail if one is not available.
3234   Corrected const_png_ in png.h to png_const_ to avoid polluting the namespace.
3235   Added png_get_current_row_number and png_get_current_pass_number for the
3236     benefit of the user transform callback.
3237   Added png_process_data_pause and png_process_data_skip for the benefit of
3238     progressive readers that need to stop data processing or want to optimize
3239     skipping of unread data (e.g., if the reader marks a chunk to be skipped.)
3240 
3241 Version 1.5.1beta09 [January 24, 2011]
3242   Enhanced pngvalid, corrected an error in gray_to_rgb, corrected doc error.
3243     pngvalid contains tests of transforms, which tests are currently disabled
3244     because they are incompletely tested.  gray_to_rgb was failing to expand
3245     the bit depth for smaller bit depth images; this seems to be a long
3246     standing error and resulted, apparently, in invalid output
3247     (CVE-2011-0408, CERT VU#643140).  The documentation did not accurately
3248     describe what libpng really does when converting RGB to gray.
3249 
3250 Version 1.5.1beta10 [January 27, 2010]
3251   Fixed incorrect examples of callback prototypes in the manual, that were
3252     introduced in libpng-1.0.0.
3253   In addition the order of the png_get_uint macros with respect to the
3254     relevant function definitions has been reversed.  This helps the
3255     preprocessing of the symbol files be more robust.  Furthermore, the
3256     symbol file preprocessing now uses -DPNG_NO_USE_READ_MACROS even when
3257     the library may actually be built with PNG_USE_READ_MACROS; this stops
3258     the read macros interfering with the symbol file format.
3259   Made the manual, synopses, and function prototypes use the function
3260     argument names file_gamma, int_file_gamma, and srgb_intent consistently.
3261 
3262 Version 1.5.1beta11 [January 28, 2011]
3263   Changed PNG_UNUSED from "param=param;" to "{if(param){}}".
3264   Corrected local variable type in new API png_process_data_skip()
3265     The type was self-evidently incorrect but only causes problems on 64-bit
3266     architectures.
3267   Added transform tests to pngvalid and simplified the arguments.
3268 
3269 Version 1.5.1rc01 [January 29, 2011]
3270   No changes.
3271 
3272 Version 1.5.1rc02 [January 31, 2011]
3273   Added a request in the manual that applications do not use "png_" or
3274     "PNG_" to begin any of their own symbols.
3275   Changed PNG_UNUSED to "(void)param;" and updated the commentary in pngpriv.h
3276 
3277 Version 1.5.1 [February 3, 2011]
3278   No changes.
3279 
3280 Version 1.5.2beta01 [February 13, 2011]
3281   More -Wshadow fixes for older gcc compilers.  Older gcc versions apparently
3282     check formal parameters names in function declarations (as well as
3283     definitions) to see if they match a name in the global namespace.
3284   Revised PNG_EXPORTA macro to not use an empty parameter, to accommodate the
3285     old VisualC++ preprocessor.
3286   Turned on interlace handling in png_read_png().
3287   Fixed gcc pendantic warnings.
3288   Handle longjmp in Cygwin.
3289   Fixed png_get_current_row_number() in the interlaced case.
3290   Cleaned up ALPHA flags and transformations.
3291   Implemented expansion to 16 bits.
3292 
3293 Version 1.5.2beta02 [February 19, 2011]
3294   Fixed mistake in the descriptions of user read_transform and write_transform
3295     function prototypes in the manual.  The row_info struct is png_row_infop.
3296   Reverted png_get_current_row_number() to previous (1.5.2beta01) behavior.
3297   Corrected png_get_current_row_number documentation
3298   Fixed the read/write row callback documentation.
3299     This documents the current behavior, where the callback is called after
3300     every row with information pertaining to the next row.
3301 
3302 Version 1.5.2beta03 [March 3, 2011]
3303   Fixed scripts/makefile.vcwin32
3304   Updated contrib/pngsuite/README to add the word "modify".
3305   Define PNG_ALLOCATED to blank when _MSC_VER<1300.
3306 
3307 Version 1.5.2rc01 [March 19, 2011]
3308   Define remaining attributes to blank when MSC_VER<1300.
3309   ifdef out mask arrays in pngread.c when interlacing is not supported.
3310 
3311 Version 1.5.2rc02 [March 22, 2011]
3312   Added a hint to try CPP=/bin/cpp if "cpp -E" fails in scripts/pnglibconf.mak
3313     and in contrib/pngminim/*/makefile, eg., on SunOS 5.10, and removed "strip"
3314     from the makefiles.
3315   Fixed a bug (present since libpng-1.0.7) that makes png_handle_sPLT() fail
3316     to compile when PNG_NO_POINTER_INDEXING is defined (Chubanov Kirill)
3317 
3318 Version 1.5.2rc03 [March 24, 2011]
3319   Don't include standard header files in png.h while building the symbol table,
3320     to avoid cpp failure on SunOS (introduced PNG_BUILDING_SYMBOL_TABLE macro).
3321 
3322 Version 1.5.2 [March 31, 2011]
3323   No changes.
3324 
3325 Version 1.5.3beta01 [April 1, 2011]
3326   Re-initialize the zlib compressor before compressing non-IDAT chunks.
3327   Added API functions (png_set_text_compression_level() and four others) to
3328     set parameters for zlib compression of non-IDAT chunks.
3329 
3330 Version 1.5.3beta02 [April 3, 2011]
3331   Updated scripts/symbols.def with new API functions.
3332   Only compile the new zlib re-initializing code when text or iCCP is
3333     supported, using PNG_WRITE_COMPRESSED_TEXT_SUPPORTED macro.
3334   Improved the optimization of the zlib CMF byte (see libpng-1.2.6beta03).
3335   Optimize the zlib CMF byte in non-IDAT compressed chunks
3336 
3337 Version 1.5.3beta03 [April 16, 2011]
3338   Fixed gcc -ansi -pedantic compile. A strict ANSI system does not have
3339     snprintf, and the "__STRICT_ANSI__" detects that condition more reliably
3340     than __STDC__ (John Bowler).
3341   Removed the PNG_PTR_NORETURN attribute because it too dangerous. It tells
3342     the compiler that a user supplied callback (the error handler) does not
3343     return, yet there is no guarantee in practice that the application code
3344     will correctly implement the error handler because the compiler only
3345     issues a warning if there is a mistake (John Bowler).
3346   Removed the no-longer-used PNG_DEPSTRUCT macro.
3347   Updated the zlib version to 1.2.5 in the VStudio project.
3348   Fixed 64-bit builds where png_uint_32 is smaller than png_size_t in
3349     pngwutil.c (John Bowler).
3350   Fixed bug with stripping the filler or alpha channel when writing, that
3351     was introduced in libpng-1.5.2beta01 (bug report by Andrew Church).
3352 
3353 Version 1.5.3beta04 [April 27, 2011]
3354   Updated pngtest.png with the new zlib CMF optimization.
3355   Cleaned up conditional compilation code and of background/gamma handling
3356     Internal changes only except a new option to avoid compiling the
3357     png_build_grayscale_palette API (which is not used at all internally.)
3358     The main change is to move the transform tests (READ_TRANSFORMS,
3359     WRITE_TRANSFORMS) up one level to the caller of the APIs.  This avoids
3360     calls to spurious functions if all transforms are disabled and slightly
3361     simplifies those functions.  Pngvalid modified to handle this.
3362     A minor change is to stop the strip_16 and expand_16 interfaces from
3363     disabling each other; this allows the future alpha premultiplication
3364     code to use 16-bit intermediate values while still producing 8-bit output.
3365     png_do_background and png_do_gamma have been simplified to take a single
3366     pointer to the png_struct rather than pointers to every item required
3367     from the png_struct. This makes no practical difference to the internal
3368     code.
3369   A serious bug in the pngvalid internal routine 'standard_display_init' has
3370     been fixed - this failed to initialize the red channel and accidentally
3371     initialized the alpha channel twice.
3372   Changed png_struct jmp_buf member name from png_jmpbuf to tmp_jmpbuf to
3373     avoid a possible clash with the png_jmpbuf macro on some platforms.
3374 
3375 Version 1.5.3beta05 [May 6, 2011]
3376   Added the "_POSIX_SOURCE" feature test macro to ensure libpng sees the
3377     correct API. _POSIX_SOURCE is defined in pngpriv.h, pngtest.c and
3378     pngvalid.c to ensure that POSIX conformant systems disable non-POSIX APIs.
3379   Removed png_snprintf and added formatted warning messages.  This change adds
3380     internal APIs to allow png_warning messages to have parameters without
3381     requiring the host OS to implement snprintf.  As a side effect the
3382     dependency of the tIME-supporting RFC1132 code on stdio is removed and
3383     PNG_NO_WARNINGS does actually work now.
3384   Pass "" instead of '\0' to png_default_error() in png_err().  This mistake
3385     was introduced in libpng-1.2.20beta01.  This fixes CVE-2011-2691.
3386   Added PNG_WRITE_OPTIMIZE_CMF_SUPPORTED macro to make the zlib "CMF" byte
3387     optimization configureable.
3388   IDAT compression failed if preceded by a compressed text chunk (bug
3389     introduced in libpng-1.5.3beta01-02).  This was because the attempt to
3390     reset the zlib stream in png_write_IDAT happened after the first IDAT
3391     chunk had been deflated - much too late.  In this change internal
3392     functions were added to claim/release the z_stream and, hopefully, make
3393     the code more robust.  Also deflateEnd checking is added - previously
3394     libpng would ignore an error at the end of the stream.
3395 
3396 Version 1.5.3beta06 [May 8, 2011]
3397   Removed the -D_ALL_SOURCE from definitions for AIX in CMakeLists.txt
3398   Implemented premultiplied alpha support: png_set_alpha_mode API
3399 
3400 Version 1.5.3beta07 [May 11, 2011]
3401   Added expand_16 support to the high level interface.
3402   Added named value and 'flag' gamma support to png_set_gamma.  Made a minor
3403     change from the previous (unreleased) ABI/API to hide the exact value used
3404     for Macs - it's not a good idea to embed this in the ABI!
3405   Moved macro definitions for PNG_HAVE_IHDR, PNG_HAVE_PLTE, and PNG_AFTER_IDAT
3406     from pngpriv.h to png.h because they must be visible to applications
3407     that call png_set_unknown_chunks().
3408   Check for up->location !PNG_AFTER_IDAT when writing unknown chunks
3409     before IDAT.
3410 
3411 Version 1.5.3beta08 [May 16, 2011]
3412   Improved "pngvalid --speed" to exclude more of pngvalid from the time.
3413   Documented png_set_alpha_mode(), other changes in libpng.3/libpng-manual.txt
3414   The cHRM chunk now sets the defaults for png_set_rgb_to_gray() (when negative
3415     parameters are supplied by the caller), while in the absence of cHRM
3416     sRGB/Rec 709 values are still used.  This introduced a divide-by-zero
3417     bug in png_handle_cHRM().
3418   The bKGD chunk no longer overwrites the background value set by
3419     png_set_background(), allowing the latter to be used before the file
3420     header is read. It never performed any useful function to override
3421     the default anyway.
3422   Added memory overwrite and palette image checks to pngvalid.c
3423     Previously palette image code was poorly checked. Since the transformation
3424     code has a special palette path in most cases this was a severe weakness.
3425   Minor cleanup and some extra checking in pngrutil.c and pngrtran.c. When
3426     expanding an indexed image, always expand to RGBA if transparency is
3427     present.
3428 
3429 Version 1.5.3beta09 [May 17, 2011]
3430   Reversed earlier 1.5.3 change of transformation order; move png_expand_16
3431     back where it was.  The change doesn't work because it requires 16-bit
3432     gamma tables when the code only generates 8-bit ones.  This fails
3433     silently; the libpng code just doesn't do any gamma correction.  Moving
3434     the tests back leaves the old, inaccurate, 8-bit gamma calculations, but
3435     these are clearly better than none!
3436 
3437 Version 1.5.3beta10 [May 20, 2011]
3438 
3439   png_set_background() and png_expand_16() did not work together correctly.
3440     This problem is present in 1.5.2; if png_set_background is called with
3441     need_expand false and the matching 16 bit color libpng erroneously just
3442     treats it as an 8-bit color because of where png_do_expand_16 is in the
3443     transform list.  This simple fix reduces the supplied colour to 8-bits,
3444     so it gets smashed, but this is better than the current behavior.
3445   Added tests for expand16, more fixes for palette image tests to pngvalid.
3446     Corrects the code for palette image tests and disables attempts to
3447     validate palette colors.
3448 
3449 Version 1.5.3rc01 [June 3, 2011]
3450   No changes.
3451 
3452 Version 1.5.3rc02 [June 8, 2011]
3453   Fixed uninitialized memory read in png_format_buffer() (Bug report by
3454     Frank Busse, CVE-2011-2501, related to CVE-2004-0421).
3455 
3456 Version 1.5.3beta11 [June 11, 2011]
3457   Fixed png_handle_sCAL which is broken in 1.5. This fixes CVE 2011-2692.
3458   Added sCAL to pngtest.png
3459   Revised documentation about png_set_user_limits() to say that it also affects
3460     png writing.
3461   Revised handling of png_set_user_limits() so that it can increase the
3462     limit beyond the PNG_USER_WIDTH|HEIGHT_MAX; previously it could only
3463     reduce it.
3464   Make the 16-to-8 scaling accurate. Dividing by 256 with no rounding is
3465     wrong (high by one) 25% of the time. Dividing by 257 with rounding is
3466     wrong in 128 out of 65536 cases. Getting the right answer all the time
3467     without division is easy.
3468   Added "_SUPPORTED" to the PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION macro.
3469   Added projects/owatcom, an IDE project for OpenWatcom to replace
3470     scripts/makefile.watcom.  This project works with OpenWatcom 1.9. The
3471     IDE autogenerates appropriate makefiles (libpng.mk) for batch processing.
3472     The project is configurable, unlike the Visual Studio project, so long
3473     as the developer has an awk.
3474   Changed png_set_gAMA to limit the gamma value range so that the inverse
3475     of the stored value cannot overflow the fixed point representation,
3476     and changed other things OpenWatcom warns about.
3477   Revised pngvalid.c to test PNG_ALPHA_MODE_SUPPORTED correctly. This allows
3478     pngvalid to build when ALPHA_MODE is not supported, which is required if
3479     it is to build on libpng 1.4.
3480   Removed string/memory macros that are no longer used and are not
3481     necessarily fully supportable, particularly png_strncpy and png_snprintf.
3482   Added log option to pngvalid.c and attempted to improve gamma messages.
3483 
3484 Version 1.5.3 [omitted]
3485   People found the presence of a beta release following an rc release
3486     to be confusing; therefore we bump the version to libpng-1.5.4beta01
3487     and there will be no libpng-1.5.3 release.
3488 
3489 Version 1.5.4beta01 [June 14, 2011]
3490   Made it possible to undefine PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
3491     to get the same (inaccurate) output as libpng-1.5.2 and earlier.
3492   Moved definitions of PNG_HAVE_IHDR, PNG_AFTER_IDAT, and PNG_HAVE_PLTE
3493     outside of an unknown-chunk block in png.h because they are also
3494     needed for other uses.
3495 
3496 Version 1.5.4beta02 [June 14, 2011]
3497   Fixed and clarified LEGACY 16-to-8 scaling code.
3498   Added png_set_chop_16() API, to match inaccurate results from previous
3499     libpng versions.
3500   Removed the ACCURATE and LEGACY options (they are no longer useable)
3501   Use the old scaling method for background if png_set_chop_16() was
3502     called.
3503   Made png_set_chop_16() API removeable by disabling PNG_CHOP_16_TO_8_SUPPORTED
3504 
3505 Version 1.5.4beta03 [June 15, 2011]
3506   Fixed a problem in png_do_expand_palette() exposed by optimization in
3507     1.5.3beta06
3508   Also removed a spurious and confusing "trans" member ("trans") from png_info.
3509   The palette expand optimization prevented expansion to an intermediate RGBA
3510     form if tRNS was present but alpha was marked to be stripped; this exposed
3511     a check for tRNS in png_do_expand_palette() which is inconsistent with the
3512     code elsewhere in libpng.
3513   Correction to the expand_16 code; removed extra instance of
3514     png_set_scale_16_to_8 from pngpriv.h
3515 
3516 Version 1.5.4beta04 [June 16, 2011]
3517   Added a missing "#ifdef PNG_READ_BACKGROUND_SUPPORTED/#endif" in pngrtran.c
3518   Added PNG_TRANSFORM_CHOP_16 to the high-level read transforms.
3519   Made PNG_READ_16_TO_8_ACCURATE_SCALE configurable again.  If this is
3520     not enabled, png_set_strip_16() and png_do_scale_16_to_8() aren't built.
3521   Revised contrib/visupng, gregbook, and pngminim to demonstrate chop_16_to_8
3522 
3523 Version 1.5.4beta05 [June 16, 2011]
3524   Renamed png_set_strip_16() to png_set_scale_16() and renamed
3525     png_set_chop_16() to png_set_strip(16) in an attempt to minimize the
3526     behavior changes between libpng14 and libpng15.
3527 
3528 Version 1.5.4beta06 [June 18, 2011]
3529   Fixed new bug that was causing both strip_16 and scale_16 to be applied.
3530 
3531 Version 1.5.4beta07 [June 19, 2011]
3532   Fixed pngvalid, simplified macros, added checking for 0 in sCAL.
3533     The ACCURATE scale macro is no longer defined in 1.5 - call the
3534     png_scale_16_to_8 API.  Made sure that PNG_READ_16_TO_8 is still defined
3535     if the png_strip_16_to_8 API is present.  png_check_fp_number now
3536     maintains some state so that positive, negative and zero values are
3537     identified.  sCAL uses these to be strictly spec conformant.
3538 
3539 Version 1.5.4beta08 [June 23, 2011]
3540   Fixed pngvalid if ACCURATE_SCALE is defined.
3541   Updated scripts/pnglibconf.h.prebuilt.
3542 
3543 Version 1.5.4rc01 [June 30, 2011]
3544   Define PNG_ALLOCATED to "restrict" only if MSC_VER >= 1400.
3545 
3546 Version 1.5.4 [July 7, 2011]
3547   No changes.
3548 
3549 Version 1.5.5beta01 [July 13, 2011]
3550   Fixed some typos and made other minor changes in the manual.
3551   Updated contrib/pngminus/makefile.std (Samuli Souminen)
3552 
3553 Version 1.5.5beta02 [July 14, 2011]
3554   Revised Makefile.am and Makefile.in to look in the right directory for
3555     pnglibconf.h.prebuilt
3556 
3557 Version 1.5.5beta03 [July 27, 2011]
3558   Enabled compilation with g++ compiler.  This compiler does not recognize
3559     the file extension, so it always compiles with C++ rules.  Made minor
3560     changes to pngrutil.c to cast results where C++ expects it but C does not.
3561   Minor editing of libpng.3 and libpng-manual.txt.
3562 
3563 Version 1.5.5beta04 [July 29, 2011]
3564   Revised CMakeLists.txt (Clifford Yapp)
3565   Updated commentary about the png_rgb_to_gray() default coefficients
3566     in the manual and in pngrtran.c
3567 
3568 Version 1.5.5beta05 [August 17, 2011]
3569   Prevent unexpected API exports from non-libpng DLLs on Windows.  The "_DLL"
3570     is removed from the test of whether a DLL is being built (this erroneously
3571     caused the libpng APIs to be marked as DLL exports in static builds under
3572     Microsoft Visual Studio).  Almost all of the libpng building configuration
3573     is moved from pngconf.h to pngpriv.h, but PNG_DLL_EXPORT remains in
3574     pngconf.h, though, so that it is colocated with the import definition (it
3575     is no longer used anywhere in the installed headers).  The VStudio project
3576     definitions have been cleaned up: "_USRDLL" has been removed from the
3577     static library builds (this was incorrect), and PNG_USE_DLL has been added
3578     to pngvalid to test the functionality (pngtest does not supply it,
3579     deliberately).  The spurious "_EXPORTS" has been removed from the
3580     libpng build (all these errors were a result of copy/paste between project
3581     configurations.)
3582   Added new types and internal functions for CIE RGB end point handling to
3583     pngpriv.h (functions yet to be implemented).
3584 
3585 Version 1.5.5beta06 [August 26, 2011]
3586   Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set in CMakeLists.txt
3587     (Clifford Yap)
3588   Fixes to rgb_to_gray and cHRM XYZ APIs (John Bowler):
3589     The rgb_to_gray code had errors when combined with gamma correction.
3590     Some pixels were treated as true grey when they weren't and such pixels
3591     and true grey ones were not gamma corrected (the original value of the
3592     red component was used instead).  APIs to get and set cHRM using color
3593     space end points have been added and the rgb_to_gray code that defaults
3594     based on cHRM, and the divide-by-zero bug in png_handle_cHRM (CERT
3595     VU#477046, CVE-2011-3328, introduced in 1.5.4) have been corrected.
3596   A considerable number of tests has been added to pngvalid for the
3597     rgb_to_gray transform.
3598   Arithmetic errors in rgb_to_gray whereby the calculated gray value was
3599     truncated to the bit depth rather than rounded have been fixed except in
3600     the 8-bit non-gamma-corrected case (where consistency seems more important
3601     than correctness.)  The code still has considerable inaccuracies in the
3602     8-bit case because 8-bit linear arithmetic is used.
3603 
3604 Version 1.5.5beta07 [September 7, 2011]
3605   Added "$(ARCH)" option to makefile.darwin
3606   Added SunOS support to configure.ac and Makefile.am
3607   Changed png_chunk_benign_error() to png_warning() in png.c, in
3608     png_XYZ_from_xy_checked().
3609 
3610 Version 1.5.5beta08 [September 10, 2011]
3611   Fixed 64-bit compilation errors (gcc). The errors fixed relate
3612     to conditions where types that are 32 bits in the GCC 32-bit
3613     world (uLong and png_size_t) become 64 bits in the 64-bit
3614     world.  This produces potential truncation errors which the
3615     compiler correctly flags.
3616   Relocated new HAVE_SOLARIS_LD definition in configure.ac
3617   Constant changes for 64-bit compatibility (removal of L suffixes). The
3618     16-bit cases still use "L" as we don't have a 16-bit test system.
3619 
3620 Version 1.5.5rc01 [September 15, 2011]
3621   Removed "L" suffixes in pngpriv.h
3622 
3623 Version 1.5.5 [September 22, 2011]
3624   No changes.
3625 
3626 Version 1.5.6beta01 [September 22, 2011]
3627   Fixed some 64-bit type conversion warnings in pngrtran.c
3628   Moved row_info from png_struct to a local variable.
3629   The various interlace mask arrays have been made into arrays of
3630     bytes and made PNG_CONST and static (previously some arrays were
3631     marked PNG_CONST and some weren't).
3632   Additional checks have been added to the transform code to validate the
3633     pixel depths after the transforms on both read and write.
3634   Removed some redundant code from pngwrite.c, in png_destroy_write_struct().
3635   Changed chunk reading/writing code to use png_uint_32 instead of png_byte[4].
3636     This removes the need to allocate temporary strings for chunk names on
3637     the stack in the read/write code.  Unknown chunk handling still uses the
3638     string form because this is exposed in the API.
3639 
3640 Version 1.5.6beta02 [September 26, 2011]
3641   Added a note in the manual the png_read_update_info() must be called only
3642     once with a particular info_ptr.
3643   Fixed a typo in the definition of the new PNG_STRING_FROM_CHUNK(s,c) macro.
3644 
3645 Version 1.5.6beta03 [September 28, 2011]
3646   Revised test-pngtest.sh to report FAIL when pngtest fails.
3647   Added "--strict" option to pngtest, to report FAIL when the failure is
3648     only because the resulting valid files are different.
3649   Revised CMakeLists.txt to work with mingw and removed some material from
3650     CMakeLists.txt that is no longer useful in libpng-1.5.
3651 
3652 Version 1.5.6beta04 [October 5, 2011]
3653   Fixed typo in Makefile.in and Makefile.am ("-M Wl" should be "-M -Wl")."
3654 
3655 Version 1.5.6beta05 [October 12, 2011]
3656   Speed up png_combine_row() for interlaced images. This reduces the generality
3657     of the code, allowing it to be optimized for Adam7 interlace.  The masks
3658     passed to png_combine_row() are now generated internally, avoiding
3659     some code duplication and localizing the interlace handling somewhat.
3660   Align png_struct::row_buf - previously it was always unaligned, caused by
3661     a bug in the code that attempted to align it; the code needs to subtract
3662     one from the pointer to take account of the filter byte prepended to
3663     each row.
3664   Optimized png_combine_row() when rows are aligned. This gains a small
3665     percentage for 16-bit and 32-bit pixels in the typical case where the
3666     output row buffers are appropriately aligned. The optimization was not
3667     previously possible because the png_struct buffer was always misaligned.
3668   Fixed bug in png_write_chunk_header() debug print, introduced in 1.5.6beta01.
3669 
3670 Version 1.5.6beta06 [October 17, 2011]
3671   Removed two redundant tests for unitialized row.
3672   Fixed a relatively harmless memory overwrite in compressed text writing
3673     with a 1 byte zlib buffer.
3674   Add ability to call png_read_update_info multiple times to pngvalid.c.
3675   Fixes for multiple calls to png_read_update_info. These fixes attend to
3676     most of the errors revealed in pngvalid, however doing the gamma work
3677     twice results in inaccuracies that can't be easily fixed.  There is now
3678     a warning in the code if this is going to happen.
3679   Turned on multiple png_read_update_info in pngvalid transform tests.
3680   Prevent libpng from overwriting unused bits at the end of the image when
3681     it is not byte aligned, while reading. Prior to libpng-1.5.6 libpng would
3682     overwrite the partial byte at the end of each row if the row width was not
3683     an exact multiple of 8 bits and the image is not interlaced.
3684 
3685 Version 1.5.6beta07 [October 21, 2011]
3686   Made png_ptr->prev_row an aligned pointer into png_ptr->big_prev_row
3687     (Mans Rullgard).
3688 
3689 Version 1.5.6rc01 [October 26, 2011]
3690   Changed misleading "Missing PLTE before cHRM" warning to "Out of place cHRM"
3691 
3692 Version 1.5.6rc02 [October 27, 2011]
3693   Added LSR() macro to defend against buggy compilers that evaluate non-taken
3694     code branches and complain about out-of-range shifts.
3695 
3696 Version 1.5.6rc03 [October 28, 2011]
3697   Renamed the LSR() macro to PNG_LSR() and added PNG_LSL() macro.
3698   Fixed compiler warnings with Intel and MSYS compilers. The logical shift
3699     fix for Microsoft Visual C is required by other compilers, so this
3700     enables that fix for all compilers when using compile-time constants.
3701     Under MSYS 'byte' is a name declared in a system header file, so we
3702     changed the name of a local variable to avoid the warnings that result.
3703   Added #define PNG_ALIGN_TYPE PNG_ALIGN_NONE to contrib/pngminim/*/pngusr.h
3704 
3705 Version 1.5.6 [November 3, 2011]
3706   No changes.
3707 
3708 Version 1.5.7beta01 [November 4, 2011]
3709   Added support for ARM processor, when decoding all PNG up-filtered rows
3710     and any other-filtered rows with 3 or 4 bytes per pixel (Mans Rullgard).
3711   Fixed bug in pngvalid on early allocation failure; fixed type cast in
3712     pngmem.c; pngvalid would attempt to call png_error() if the allocation
3713     of a png_struct or png_info failed. This would probably have led to a
3714     crash.  The pngmem.c implementation of png_malloc() included a cast
3715     to png_size_t which would fail on large allocations on 16-bit systems.
3716   Fix for the preprocessor of the Intel C compiler. The preprocessor
3717     splits adjacent @ signs with a space; this changes the concatentation
3718     token from @-@-@ to PNG_JOIN; that should work with all compiler
3719     preprocessors.
3720   Paeth filter speed improvements from work by Siarhei Siamashka. This
3721     changes the 'Paeth' reconstruction function to improve the GCC code
3722     generation on x86. The changes are only part of the suggested ones;
3723     just the changes that definitely improve speed and remain simple.
3724     The changes also slightly increase the clarity of the code.
3725 
3726 Version 1.5.7beta02 [November 11, 2011]
3727   Check compression_type parameter in png_get_iCCP and remove spurious
3728     casts. The compression_type parameter is always assigned to, so must
3729     be non-NULL. The cast of the profile length potentially truncated the
3730     value unnecessarily on a 16-bit int system, so the cast of the (byte)
3731     compression type to (int) is specified by ANSI-C anyway.
3732   Fixed FP division by zero in pngvalid.c; the 'test_pixel' code left
3733     the sBIT fields in the test pixel as 0, which resulted in a floating
3734     point division by zero which was irrelevant but causes systems where
3735     FP exceptions cause a crash. Added code to pngvalid to turn on FP
3736     exceptions if the appropriate glibc support is there to ensure this is
3737     tested in the future.
3738   Updated scripts/pnglibconf.mak and scripts/makefile.std to handle the
3739     new PNG_JOIN macro.
3740   Added versioning to pnglibconf.h comments.
3741   Simplified read/write API initial version; basic read/write tested on
3742     a variety of images, limited documentation (in the header file.)
3743   Installed more accurate linear to sRGB conversion tables. The slightly
3744     modified tables reduce the number of 16-bit values that
3745     convert to an off-by-one 8-bit value.  The "makesRGB.c" code that was used
3746     to generate the tables is now in a contrib/sRGBtables sub-directory.
3747 
3748 Version 1.5.7beta03 [November 17, 2011]
3749   Removed PNG_CONST from the sRGB table declarations in pngpriv.h and png.c
3750   Added run-time detection of NEON support.
3751   Added contrib/libtests; includes simplified API test and timing test and
3752     a color conversion utility for rapid checking of failed 'pngstest' results.
3753   Multiple transform bug fixes plus a work-round for double gamma correction.
3754     libpng does not support more than one transform that requires linear data
3755     at once - if this is tried typically the results is double gamma
3756     correction. Since the simplified APIs can need rgb to gray combined with
3757     a compose operation it is necessary to do one of these outside the main
3758     libpng transform code. This check-in also contains fixes to various bugs
3759     in the simplified APIs themselves and to some bugs in compose and rgb to
3760     gray (on palette) itself.
3761   Fixes for C++ compilation using g++ When libpng source is compiled
3762     using g++. The compiler imposes C++ rules on the C source; thus it
3763     is desireable to make the source work with either C or C++ rules
3764     without throwing away useful error information.  This change adds
3765     png_voidcast to allow C semantic (void*) cases or the corresponding
3766     C++ static_cast operation, as appropriate.
3767   Added --noexecstack to assembler file compilation. GCC does not set
3768     this on assembler compilation, even though it does on C compilation.
3769     This creates security issues if assembler code is enabled; the
3770     work-around is to set it by default in the flags for $(CCAS)
3771   Work around compilers that don't support declaration of const data. Some
3772     compilers fault 'extern const' data declarations (because the data is
3773     not initialized); this turns on const-ness only for compilers where
3774     this is known to work.
3775 
3776 Version 1.5.7beta04 [November 17, 2011]
3777   Since the gcc driver does not recognize the --noexecstack flag, we must
3778     use the -Wa prefix to have it passed through to the assembler.
3779     Also removed a duplicate setting of this flag.
3780   Added files that were omitted from the libpng-1.5.7beta03 zip distribution.
3781 
3782 Version 1.5.7beta05 [November 25, 2011]
3783   Removed "zTXt" from warning in generic chunk decompression function.
3784   Validate time settings passed to png_set_tIME() and png_convert_to_rfc1123()
3785     (Frank Busse). Note: This prevented CVE-2015-7981 from affecting
3786     libpng-1.5.7 and later.
3787   Added MINGW support to CMakeLists.txt
3788   Reject invalid compression flag or method when reading the iTXt chunk.
3789   Backed out 'simplified' API changes. The API seems too complex and there
3790     is a lack of consensus or enthusiasm for the proposals.  The API also
3791     reveals significant bugs inside libpng (double gamma correction and the
3792     known bug of being unable to retrieve a corrected palette). It seems
3793     better to wait until the bugs, at least, are corrected.
3794   Moved pngvalid.c into contrib/libtests
3795   Rebuilt Makefile.in, configure, etc., with autoconf-2.68
3796 
3797 Version 1.5.7rc01 [December 1, 2011]
3798   Replaced an "#if" with "#ifdef" in pngrtran.c
3799   Revised #if PNG_DO_BC block in png.c (use #ifdef and add #else)
3800 
3801 Version 1.5.7rc02 [December 5, 2011]
3802   Revised project files and contrib/pngvalid/pngvalid.c to account for
3803     the relocation of pngvalid into contrib/libtests.
3804   Revised pngconf.h to use " __declspec(restrict)" only when MSC_VER >= 1400,
3805     as in libpng-1.5.4.
3806   Put CRLF line endings in the owatcom project files.
3807 
3808 Version 1.5.7rc03 [December 7, 2011]
3809   Updated CMakeLists.txt to account for the relocation of pngvalid.c
3810 
3811 Version 1.5.7 [December 15, 2011]
3812   Minor fixes to pngvalid.c for gcc 4.6.2 compatibility to remove warnings
3813     reported by earlier versions.
3814   Fixed minor memset/sizeof errors in pngvalid.c.
3815 
3816 Version 1.6.0beta01 [December 15, 2011]
3817   Removed machine-generated configure files from the GIT repository (they will
3818     continue to appear in the tarball distributions and in the libpng15 and
3819     earlier GIT branches).
3820   Restored the new 'simplified' API, which was started in libpng-1.5.7beta02
3821     but later deleted from libpng-1.5.7beta05.
3822   Added example programs for the new 'simplified' API.
3823   Added ANSI-C (C90) headers and require them, and take advantage of the
3824     change. Also fixed some of the projects/* and contrib/* files that needed
3825     updates for libpng16 and the move of pngvalid.c.
3826     With this change the required ANSI-C header files are assumed to exist: the
3827     implementation must provide float.h, limits.h, stdarg.h and stddef.h and
3828     libpng relies on limits.h and stddef.h existing and behaving as defined
3829     (the other two required headers aren't used).  Non-ANSI systems that don't
3830     have stddef.h or limits.h will have to provide an appropriate fake
3831     containing the relevant types and #defines.
3832   Dropped support for 16-bit platforms. The use of FAR/far has been eliminated
3833     and the definition of png_alloc_size_t is now controlled by a flag so
3834     that 'small size_t' systems can select it if necessary.  Libpng 1.6 may
3835     not currently work on such systems -- it seems likely that it will
3836     ask 'malloc' for more than 65535 bytes with any image that has a
3837     sufficiently large row size (rather than simply failing to read such
3838     images).
3839   New tools directory containing tools used to generate libpng code.
3840   Fixed race conditions in parallel make builds. With higher degrees of
3841     parallelism during 'make' the use of the same temporary file names such
3842     as 'dfn*' can result in a race where a temporary file from one arm of the
3843     build is deleted or overwritten in another arm.  This changes the
3844     temporary files for suffix rules to always use $* and ensures that the
3845     non-suffix rules use unique file names.
3846 
3847 Version 1.6.0beta02 [December 21, 2011]
3848   Correct configure builds where build and source directories are separate.
3849     The include path of 'config.h' was erroneously made relative in pngvalid.c
3850     in libpng 1.5.7.
3851 
3852 Version 1.6.0beta03 [December 22, 2011]
3853   Start-up code size improvements, error handler flexibility. These changes
3854     alter how the tricky allocation of the initial png_struct and png_info
3855     structures are handled. png_info is now handled in pretty much the same
3856     way as everything else, except that the allocations handle NULL return
3857     silently.  png_struct is changed in a similar way on allocation and on
3858     deallocation a 'safety' error handler is put in place (which should never
3859     be required).  The error handler itself is changed to permit mismatches
3860     in the application and libpng error buffer size; however, this means a
3861     silent change to the API to return the jmp_buf if the size doesn't match
3862     the size from the libpng compilation; libpng now allocates the memory and
3863     this may fail.  Overall these changes result in slight code size
3864     reductions; however, this is a reduction in code that is always executed
3865     so is particularly valuable.  Overall on a 64-bit system the libpng DLL
3866     decreases in code size by 1733 bytes.  pngerror.o increases in size by
3867     about 465 bytes because of the new functionality.
3868   Added png_convert_to_rfc1123_buffer() and deprecated png_convert_to_rfc1123()
3869     to avoid including a spurious buffer in the png_struct.
3870 
3871 Version 1.6.0beta04 [December 30, 2011]
3872   Regenerated configure scripts with automake-1.11.2
3873   Eliminated png_info_destroy(). It is now used only in png.c and only calls
3874     one other internal function and memset().
3875   Enabled png_get_sCAL_fixed() if floating point APIs are enabled. Previously
3876     it was disabled whenever internal fixed point arithmetic was selected,
3877     which meant it didn't exist even on systems where FP was available but not
3878     preferred.
3879   Added pngvalid.c compile time checks for const APIs.
3880   Implemented 'restrict' for png_info and png_struct. Because of the way
3881     libpng works both png_info and png_struct are always accessed via a
3882     single pointer.  This means adding C99 'restrict' to the pointer gives
3883     the compiler some opportunity to optimize the code.  This change allows
3884     that.
3885   Moved AC_MSG_CHECKING([if libraries can be versioned]) later to the proper
3886     location in configure.ac (Gilles Espinasse).
3887   Changed png_memcpy to C assignment where appropriate. Changed all those
3888     uses of png_memcpy that were doing a simple assignment to assignments
3889     (all those cases where the thing being copied is a non-array C L-value).
3890   Added some error checking to png_set_*() routines.
3891   Removed the reference to the non-exported function png_memcpy() from
3892     example.c.
3893   Fixed the Visual C 64-bit build - it requires jmp_buf to be aligned, but
3894     it had become misaligned.
3895   Revised contrib/pngminus/pnm2png.c to avoid warnings when png_uint_32
3896     and unsigned long are of different sizes.
3897 
3898 Version 1.6.0beta05 [January 15, 2012]
3899   Updated manual with description of the simplified API (copied from png.h)
3900   Fix bug in pngerror.c: some long warnings were being improperly truncated
3901     (CVE-2011-3464, bug introduced in libpng-1.5.3beta05).
3902 
3903 Version 1.6.0beta06 [January 24, 2012]
3904   Added palette support to the simplified APIs. This commit
3905     changes some of the macro definitions in png.h, app code
3906     may need corresponding changes.
3907   Increased the formatted warning buffer to 192 bytes.
3908   Added color-map support to simplified API. This is an initial version for
3909     review; the documentation has not yet been updated.
3910   Fixed Min/GW uninstall to remove libpng.dll.a
3911 
3912 Version 1.6.0beta07 [January 28, 2012]
3913   Eliminated Intel icc/icl compiler warnings. The Intel (GCC derived)
3914     compiler issues slightly different warnings from those issued by the
3915     current vesions of GCC. This eliminates those warnings by
3916     adding/removing casts and small code rewrites.
3917   Updated configure.ac from autoupdate: added --enable-werror option.
3918     Also some layout regularization and removal of introduced tab characters
3919     (replaced with 3-character indentation).  Obsolete macros identified by
3920     autoupdate have been removed; the replacements are all in 2.59 so
3921     the pre-req hasn't been changed.  --enable-werror checks for support
3922     for -Werror (or the given argument) in the compiler.  This mimics the
3923     gcc configure option by allowing -Werror to be turned on safely; without
3924     the option the tests written in configure itself fail compilation because
3925     they cause compiler warnings.
3926   Rewrote autogen.sh to run autoreconf instead of running tools one-by-one.
3927   Conditionalize the install rules for MINGW and CYGWIN in CMakeLists.txt and
3928     set CMAKE_LIBRARY_OUTPUT_DIRECTORY to "lib" on all platforms (C. Yapp).
3929   Freeze libtool files in the 'scripts' directory. This version of autogen.sh
3930     attempts to dissuade people from running it when it is not, or should not,
3931     be necessary.  In fact, autogen.sh does not work when run in a libpng
3932     directory extracted from a tar distribution anymore. You must run it in
3933     a GIT clone instead.
3934   Added two images to contrib/pngsuite (1-bit and 2-bit transparent grayscale),
3935     and renamed three whose names were inconsistent with those in
3936     pngsuite/README.txt.
3937 
3938 Version 1.6.0beta08 [February 1, 2012]
3939   Fixed Image::colormap misalignment in pngstest.c
3940   Check libtool/libtoolize version number (2.4.2) in configure.ac
3941   Divide test-pngstest.sh into separate pngstest runs for basic and
3942     transparent images.
3943   Moved automake options to AM_INIT_AUTOMAKE in configure.ac
3944   Added color-tests, silent-rules (Not yet implemented in Makefile.am) and
3945     version checking to configure.ac
3946   Improved pngstest speed by not doing redundant tests and add const to
3947     the background parameter of png_image_finish_read. The --background
3948     option is now done automagically only when required, so that commandline
3949     option no longer exists.
3950   Cleaned up pngpriv.h to consistently declare all functions and data.
3951     Also eliminated PNG_CONST_DATA, which is apparently not needed but we
3952     can't be sure until it is gone.
3953   Added symbol prefixing that allows all the libpng external symbols
3954     to be prefixed (suggested by Reuben Hawkins).
3955   Updated "ftbb*.png" list in the owatcom and vstudio projects.
3956   Fixed 'prefix' builds on clean systems. The generation of pngprefix.h
3957     should not require itself.
3958   Updated INSTALL to explain that autogen.sh must be run in a GIT clone,
3959     not in a libpng directory extracted from a tar distribution.
3960 
3961 Version 1.6.0beta09 [February 1, 2012]
3962   Reverted the prebuilt configure files to libpng-1.6.0beta05 condition.
3963 
3964 Version 1.6.0beta10 [February 3, 2012]
3965   Added Z_SOLO for zlib-1.2.6+ and correct pngstest tests
3966   Updated list of test images in CMakeLists.txt
3967   Updated the prebuilt configure files to current condition.
3968   Revised INSTALL information about autogen.sh; it works in tar distributions.
3969 
3970 Version 1.6.0beta11 [February 16, 2012]
3971   Fix character count in pngstest command in projects/owatcom/pngstest.tgt
3972   Revised test-pngstest.sh to report PASS/FAIL for each image.
3973   Updated documentation about the simplified API.
3974   Corrected estimate of error in libpng png_set_rgb_to_gray API.  The API is
3975     extremely inaccurate for sRGB conversions because it uses an 8-bit
3976     intermediate linear value and it does not use the sRGB transform, so it
3977     suffers from the known instability in gamma transforms for values close
3978     to 0 (see Poynton).  The net result is that the calculation has a maximum
3979     error of 14.99/255; 0.5/255^(1/2.2).  pngstest now uses 15 for the
3980     permitted 8-bit error. This may still not be enough because of arithmetic
3981     error.
3982   Removed some unused arrays (with #ifdef) from png_read_push_finish_row().
3983   Fixed a memory overwrite bug in simplified read of RGB PNG with
3984     non-linear gamma Also bugs in the error checking in pngread.c and changed
3985     quite a lot of the checks in pngstest.c to be correct; either correctly
3986     written or not over-optimistic.  The pngstest changes are insufficient to
3987     allow all possible RGB transforms to be passed; pngstest cmppixel needs
3988     to be rewritten to make it clearer which errors it allows and then changed
3989     to permit known inaccuracies.
3990   Removed tests for no-longer-used *_EMPTY_PLTE_SUPPORTED from pngstruct.h
3991   Fixed fixed/float API export conditionals. 1) If FIXED_POINT or
3992     FLOATING_POINT options were switched off, png.h ended up with lone ';'
3993     characters.  This is not valid ANSI-C outside a function.  The ';'
3994     characters have been moved inside the definition of PNG_FP_EXPORT and
3995     PNG_FIXED_EXPORT. 2) If either option was switched off, the declaration
3996     of the corresponding functions were completely omitted, even though some
3997     of them are still used internally.  The result is still valid, but
3998     produces warnings from gcc with some warning options (including -Wall). The
3999     fix is to cause png.h to declare the functions with PNG_INTERNAL_FUNCTION
4000     when png.h is included from pngpriv.h.
4001   Check for invalid palette index while reading paletted PNG.  When one is
4002     found, issue a warning and increase png_ptr->num_palette accordingly.
4003     Apps are responsible for checking to see if that happened.
4004 
4005 Version 1.6.0beta12 [February 18, 2012]
4006   Do not increase num_palette on invalid_index.
4007   Relocated check for invalid palette index to pngrtran.c, after unpacking
4008     the sub-8-bit pixels.
4009   Fixed CVE-2011-3026 buffer overrun bug.  This bug was introduced when
4010     iCCP chunk support was added at libpng-1.0.6. Deal more correctly with the
4011     test on iCCP chunk length. Also removed spurious casts that may hide
4012     problems on 16-bit systems.
4013 
4014 Version 1.6.0beta13 [February 24, 2012]
4015   Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from
4016     pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c;
4017     now that png_ptr->buffer is inaccessible to applications, the special
4018     handling is no longer useful.
4019   Added PNG_SAFE_LIMITS feature to pnglibconf.dfa, pngpriv.h, and new
4020     pngusr.dfa to reset the user limits to safe ones if PNG_SAFE_LIMITS is
4021     defined.  To enable, use "CPPFLAGS=-DPNG_SAFE_LIMITS_SUPPORTED=1" on the
4022     configure command or put #define PNG_SAFE_LIMITS_SUPPORTED in
4023     pnglibconf.h.prebuilt and pnglibconf.h.
4024 
4025 Version 1.6.0beta14 [February 27, 2012]
4026   Added information about the new limits in the manual.
4027   Updated Makefile.in
4028 
4029 Version 1.6.0beta15 [March 2, 2012]
4030   Removed unused "current_text" members of png_struct and the png_free()
4031     of png_ptr->current_text from pngread.c
4032   Rewrote pngstest.c for substantial speed improvement.
4033   Fixed transparent pixel and 16-bit rgb tests in pngstest and removed a
4034     spurious check in pngwrite.c
4035   Added PNG_IMAGE_FLAG_FAST for the benefit of applications that store
4036     intermediate files, or intermediate in-memory data, while processing
4037     image data with the simplified API.  The option makes the files larger
4038     but faster to write and read.  pngstest now uses this by default; this
4039     can be disabled with the --slow option.
4040   Improved pngstest fine tuning of error numbers, new test file generator.
4041     The generator generates images that test the full range of sample values,
4042     allow the error numbers in pngstest to be tuned and checked.  makepng
4043     also allows generation of images with extra chunks, although this is
4044     still work-in-progress.
4045   Added check for invalid palette index while reading.
4046   Fixed some bugs in ICC profile writing. The code should now accept
4047     all potentially valid ICC profiles and reject obviously invalid ones.
4048     It now uses png_error() to do so rather than casually writing a PNG
4049     without the necessary color data.
4050   Removed whitespace from the end of lines in all source files and scripts.
4051 
4052 Version 1.6.0beta16 [March 6, 2012]
4053   Relocated palette-index checking function from pngrutil.c to pngtrans.c
4054   Added palette-index checking while writing.
4055   Changed png_inflate() and calling routines to avoid overflow problems.
4056     This is an intermediate check-in that solves the immediate problems and
4057     introduces one performance improvement (avoiding a copy via png_ptr->zbuf.)
4058     Further changes will be made to make ICC profile handling more secure.
4059   Fixed build warnings (MSVC, GCC, GCC v3). Cygwin GCC with default options
4060     declares 'index' as a global, causing a warning if it is used as a local
4061     variable.  GCC 64-bit warns about assigning a (size_t) (unsigned 64-bit)
4062     to an (int) (signed 32-bit).  MSVC, however, warns about using the
4063     unary '-' operator on an unsigned value (even though it is well defined
4064     by ANSI-C to be ~x+1).  The padding calculation was changed to use a
4065     different method.  Removed the tests on png_ptr->pass.
4066   Added contrib/libtests/tarith.c to test internal arithmetic functions from
4067     png.c. This is a libpng maintainer program used to validate changes to the
4068     internal arithmetic functions.
4069   Made read 'inflate' handling like write 'deflate' handling. The read
4070     code now claims and releases png_ptr->zstream, like the write code.
4071     The bug whereby the progressive reader failed to release the zstream
4072     is now fixed, all initialization is delayed, and the code checks for
4073     changed parameters on deflate rather than always calling
4074     deflatedEnd/deflateInit.
4075   Validate the zTXt strings in pngvalid.
4076   Added code to validate the windowBits value passed to deflateInit2().
4077     If the call to deflateInit2() is wrong a png_warning will be issued
4078     (in fact this is harmless, but the PNG data produced may be sub-optimal).
4079 
4080 Version 1.6.0beta17 [March 10, 2012]
4081   Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition. 
4082   Reject all iCCP chunks after the first, even if the first one is invalid.
4083   Deflate/inflate was reworked to move common zlib calls into single
4084     functions [rw]util.c.  A new shared keyword check routine was also added
4085     and the 'zbuf' is no longer allocated on progressive read.  It is now
4086     possible to call png_inflate() incrementally.  A warning is no longer
4087     issued if the language tag or translated keyword in the iTXt chunk
4088     has zero length.
4089   If benign errors are disabled use maximum window on ancilliary inflate.
4090     This works round a bug introduced in 1.5.4 where compressed ancillary
4091     chunks could end up with a too-small windowBits value in the deflate
4092     header.
4093 
4094 Version 1.6.0beta18 [March 16, 2012]
4095   Issue a png_benign_error() instead of png_warning() about bad palette index.
4096   In pngtest, treat benign errors as errors if "-strict" is present.
4097   Fixed an off-by-one error in the palette index checking function.
4098   Fixed a compiler warning under Cygwin (Windows-7, 32-bit system)
4099   Revised example.c to put text strings in a temporary character array
4100     instead of directly assigning string constants to png_textp members.
4101     This avoids compiler warnings when -Wwrite-strings is enabled.
4102   Added output flushing to aid debugging under Visual Studio. Unfortunately
4103     this is necessary because the VS2010 output window otherwise simply loses
4104     the error messages on error (they weren't flushed to the window before
4105     the process exited, apparently!)
4106   Added configuration support for benign errors and changed the read
4107     default. Also changed some warnings in the iCCP and sRGB handling
4108     from to benign errors. Configuration now makes read benign
4109     errors warnings and write benign errors to errors by default (thus
4110     changing the behavior on read).  The simplified API always forces
4111     read benign errors to warnings (regardless of the system default, unless
4112     this is disabled in which case the simplified API can't be built.)
4113 
4114 Version 1.6.0beta19 [March 18, 2012]
4115   Work around for duplicate row start calls; added warning messages.
4116     This turns on PNG_FLAG_DETECT_UNINITIALIZED to detect app code that
4117     fails to call one of the 'start' routines (not enabled in libpng-1.5
4118     because it is technically an API change, since it did normally work
4119     before.)  It also makes duplicate calls to png_read_start_row (an
4120     internal function called at the start of the image read) benign, as
4121     they were before changes to use png_inflate_claim. Somehow webkit is
4122     causing this to happen; this is probably a mis-feature in the zlib
4123     changes so this commit is only a work-round.
4124   Removed erroneous setting of DETECT_UNINITIALIZED and added more
4125     checks. The code now does a png_error if an attempt is made to do the
4126     row initialization twice; this is an application error and it has
4127     serious consequences because the transform data in png_struct is
4128     changed by each call.
4129   Added application error reporting and added chunk names to read
4130     benign errors; also added --strict to pngstest - not enabled
4131     yet because a warning is produced.
4132   Avoid the double gamma correction warning in the simplified API.
4133     This allows the --strict option to pass in the pngstest checks
4134 
4135 Version 1.6.0beta20 [March 29, 2012]
4136   Changed chunk handler warnings into benign errors, incrementally load iCCP
4137   Added checksum-icc.c to contrib/tools
4138   Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice.
4139   Recognize known sRGB ICC profiles while reading; prefer writing the
4140     iCCP profile over writing the sRGB chunk, controlled by the
4141     PNG_sRGB_PROFILE_CHECKS option.
4142   Revised png_set_text_2() to avoid potential memory corruption (fixes
4143     CVE-2011-3048, also known as CVE-2012-3425).
4144 
4145 Version 1.6.0beta21 [April 27, 2012]
4146   Revised scripts/makefile.darwin: use system zlib; remove quotes around
4147     architecture list; add missing ppc architecture; add architecture options
4148     to shared library link; don't try to create a shared lib based on missing
4149     RELEASE variable.
4150   Enable png_set_check_for_invalid_index() for both read and write.
4151   Removed #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED in pngpriv.h around
4152     declaration of png_handle_unknown().
4153   Added -lssp_nonshared in a comment in scripts/makefile.freebsd
4154     and changed deprecated NOOBJ and NOPROFILE to NO_OBJ and NO_PROFILE.
4155 
4156 Version 1.6.0beta22 [May 23, 2012]
4157   Removed need for -Wno-cast-align with clang.  clang correctly warns on
4158     alignment increasing pointer casts when -Wcast-align is passed. This
4159     fixes the cases that clang warns about either by eliminating the
4160     casts from png_bytep to png_uint_16p (pngread.c), or, for pngrutil.c
4161     where the cast is previously verified or pngstest.c where it is OK, by
4162     introducing new png_aligncast macros to do the cast in a way that clang
4163     accepts.
4164 
4165 Version 1.6.0beta23 [June 6, 2012]
4166   Revised CMakeLists.txt to not attempt to make a symlink under mingw.
4167   Made fixes for new optimization warnings from gcc 4.7.0. The compiler
4168     performs an optimization which is safe; however it then warns about it.
4169     Changing the type of 'palette_number' in pngvalid.c removes the warning.
4170   Do not depend upon a GCC feature macro being available for use in generating
4171     the linker mapfile symbol prefix.
4172   Improved performance of new do_check_palette_indexes() function (only
4173     update the value when it actually increases, move test for whether
4174     the check is wanted out of the function.
4175 
4176 Version 1.6.0beta24 [June 7, 2012]
4177   Don't check palette indexes if num_palette is 0 (as it can be in MNG files).
4178 
4179 Version 1.6.0beta25 [June 16, 2012]
4180   Revised png_set_keep_unknown_chunks() so num_chunks < 0 means ignore all
4181     unknown chunks and all known chunks except for IHDR, PLTE, tRNS, IDAT,
4182     and IEND.  Previously it only meant ignore all unknown chunks, the
4183     same as num_chunks == 0. Revised png_image_skip_unused_chunks() to
4184     provide a list of chunks to be processed instead of a list of chunks to
4185     ignore.  Revised contrib/gregbook/readpng2.c accordingly.
4186 
4187 Version 1.6.0beta26 [July 10, 2012]
4188   Removed scripts/makefile.cegcc from the *.zip and *.7z distributions; it
4189     depends on configure, which is not included in those archives.
4190   Moved scripts/chkfmt to contrib/tools.
4191   Changed "a+w" to "u+w" in Makefile.in to fix CVE-2012-3386.
4192 
4193 Version 1.6.0beta27 [August 11, 2012]
4194   Do not compile PNG_DEPRECATED, PNG_ALLOC and PNG_PRIVATE when __GNUC__ < 3.
4195   Do not use __restrict when GNUC is <= 3.1
4196   Removed references to png_zalloc() and png_zfree() from the manual.
4197   Fixed configurations where floating point is completely disabled.  Because
4198     of the changes to support symbol prefixing PNG_INTERNAL_FUNCTION declares
4199     floating point APIs during libpng builds even if they are completely
4200     disabled. This requires the png floating point types (png_double*) to be
4201     declared even though the functions are never actually defined.  This
4202     change provides a dummy definition so that the declarations work, yet any
4203     implementation will fail to compile because of an incomplete type.
4204   Re-eliminated the use of strcpy() in pngtest.c.  An unncessary use of
4205     strcpy() was accidentally re-introduced in libpng16; this change replaces
4206     it with strncpy().
4207   Eliminated use of png_sizeof(); use sizeof() instead.
4208   Use a consistent style for (sizeof type) and (sizeof (array))
4209   Cleanup of png_set_filler().  This function does very different things on
4210     read and write.  In libpng 1.6 the two cases can be distinguished and
4211     considerable code cleanup, and extra error checking, is possible.  This
4212     makes calls on the write side that have no effect be ignored with a
4213     png_app_error(), which can be disabled in the app using
4214     png_set_benign_errors(), and removes the spurious use of usr_channels
4215     on the read side.
4216   Insist on autotools 1.12.1 for git builds because there are security issues
4217     with 1.12 and insisting on anything less would allow 1.12 to be used.
4218   Removed info_ptr->signature[8] from WRITE-only builds.
4219   Add some conditions for compiling png_fixed().  This is a small function
4220     but it requires "-lm" on some platforms.
4221   Cause pngtest --strict to fail on any warning from libpng (not just errors)
4222     and cause it not to fail at the comparison step if libpng lacks support
4223     for writing chunks that it reads from the input (currently only implemented
4224     for compressed text chunks).
4225   Make all three "make check" test programs work without READ or WRITE support.
4226     Now "make check" will succeed even if libpng is compiled with -DPNG_NO_READ
4227     or -DPNG_NO_WRITE.  The tests performed are reduced, but the basic reading
4228     and writing of a PNG file is always tested by one or more of the tests.
4229   Consistently use strlen(), memset(), memcpy(), and memcmp() instead of the
4230     png_strlen(), png_memset(), png_memcpy(), and png_memcmp() macros.
4231   Removed the png_sizeof(), png_strlen(), png_memset(), png_memcpy(), and
4232     png_memcmp() macros.
4233   Work around gcc 3.x and Microsoft Visual Studio 2010 complaints. Both object
4234     to the split initialization of num_chunks.
4235 
4236 Version 1.6.0beta28 [August 29, 2012]
4237   Unknown handling fixes and clean up. This adds more correct option
4238     control of the unknown handling, corrects the pre-existing bug where
4239     the per-chunk 'keep' setting is ignored and makes it possible to skip
4240     IDAT chunks in the sequential reader (broken in earlier 1.6 versions).
4241     There is a new test program, test-unknown.c, which is a work in progress
4242     (not currently part of the test suite).  Comments in the header files now
4243     explain how the unknown handling works.
4244   Allow fine grain control of unknown chunk APIs. This change allows
4245     png_set_keep_unknown_chunks() to be turned off if not required and causes
4246     both read and write to behave appropriately (on read this is only possible
4247     if the user callback is used to handle unknown chunks).  The change
4248     also removes the support for storing unknown chunks in the info_struct
4249     if the only unknown handling enabled is via the callback, allowing libpng
4250     to be configured with callback reading and none of the unnecessary code.
4251   Corrected fix for unknown handling in pngtest. This reinstates the
4252     libpng handling of unknown chunks other than vpAg and sTER (including
4253     unsafe-to-copy chunks which were dropped before) and eliminates the
4254     repositioning of vpAg and sTER in pngtest.png by changing pngtest.png
4255     (so the chunks are where libpng would put them).
4256   Added "tunknown" test and corrected a logic error in png_handle_unknown()
4257     when SAVE support is absent.  Moved the shell test scripts for
4258     contrib/libtests from the libpng top directory to contrib/libtests.
4259     png_handle_unknown() must always read or skip the chunk, if
4260     SAVE_UNKNOWN_CHUNKS is turned off *and* the application does not set
4261     a user callback an unknown chunk will not be read, leading to a read
4262     error, which was revealed by the "tunknown" test.
4263   Cleaned up and corrected ICC profile handling.
4264     contrib/libtests/makepng: corrected 'rgb' and 'gray' cases.  profile_error
4265     messages could be truncated; made a correct buffer size calculation and
4266     adjusted pngerror.c appropriately. png_icc_check_* checking improved;
4267     changed the functions to receive the correct color type of the PNG on read
4268     or write and check that it matches the color space of the profile (despite
4269     what the comments said before, there is danger in assuming the app will
4270     cope correctly with an RGB profile on a grayscale image and, since it
4271     violates the PNG spec, allowing it is certain to produce inconsistent
4272     app behavior and might even cause app crashes.) Check that profiles
4273     contain the tags needed to process the PNG (tags all required by the ICC
4274     spec). Removed unused PNG_STATIC from pngpriv.h.
4275 
4276 Version 1.6.0beta29 [September 4, 2012]
4277   Fixed the simplified API example programs to add the *colormap parameter
4278     to several of he API and improved the error message if the version field
4279     is not set.
4280   Added contrib/examples/* to the *.zip and *.7z distributions.
4281   Updated simplified API synopses and description of the png_image structure
4282     in the manual.
4283   Made makepng and pngtest produce identical PNGs, add "--relaxed" option
4284     to pngtest. The "--relaxed" option turns off the benign errors that are
4285     enabled by default in pre-RC builds. makepng can now write ICC profiles
4286     where the length has not been extended to a multiple of 4, and pngtest
4287     now intercepts all libpng errors, allowing the previously-introduced
4288     "--strict test" on no warnings to actually work.
4289   Improved ICC profile handling including cHRM chunk generation and fixed
4290     Cygwin+MSVC build errors. The ICC profile handling now includes more
4291     checking.  Several errors that caused rejection of the profile are now
4292     handled with a warning in such a way that the invalid profiles will be
4293     read by default in release (but not pre-RC) builds but will not be
4294     written by default.  The easy part of handling the cHRM chunk is written,
4295     where the ICC profile contains the required data.  The more difficult
4296     part plus guessing a gAMA value requires code to pass selected RGB values
4297     through the profile.
4298 
4299 Version 1.6.0beta30 [October 24, 2012]
4300   Changed ICC profile matrix/vector types to not depend on array type rules.
4301     By the ANSI-C standard the new types should be identical to the previous
4302     versions, and all known versions of gcc tested with the previous versions
4303     except for GCC-4.2.1 work with this version.  The change makes the ANSI-C
4304     rule that const applied to an array of elements applies instead to the
4305     elements in the array moot by explicitly applying const to the base
4306     elements of the png_icc_matrix and png_icc_vector types. The accidental
4307     (harmless) 'const' previously applied to the parameters of two of the
4308     functions have also been removed.
4309   Added a work around for GCC 4.2 optimization bug.
4310   Marked the broken (bad white point) original HP sRGB profiles correctly and
4311     correct comments.
4312   Added -DZ_SOLO to contrib/pngminim/*/makefile to work with zlib-1.2.7
4313   Use /MDd for vstudio debug builds. Also added pngunkown to the vstudio
4314     builds, fixed build errors and corrected a minor exit code error in
4315     pngvalid if the 'touch' file name is invalid.
4316   Add updated WARNING file to projects/vstudio from libpng 1.5/vstudio
4317   Fixed build when using #define PNG_NO_READ_GAMMA in png_do_compose() in
4318     pngrtran.c (Domani Hannes).
4319 
4320 Version 1.6.0beta31 [November 1, 2012]
4321   Undid the erroneous change to vstudio/pngvalid build in libpng-1.6.0beta30.
4322   Made pngvalid so that it will build outside the libpng source tree.
4323   Made builds -DPNG_NO_READ_GAMMA compile (the unit tests still fail).
4324   Made PNG_NO_READ_GAMMA switch off interfaces that depend on READ_GAMMA.
4325     Prior to 1.6.0 switching off READ_GAMMA did unpredictable things to the
4326     interfaces that use it (specifically, png_do_background in 1.4 would
4327     simply display composite for grayscale images but do composition
4328     with the incorrect arithmetic for color ones). In 1.6 the semantic
4329     of -DPNG_NO_READ_GAMMA is changed to simply disable any interface that
4330     depends on it; this obliges people who set it to consider whether they
4331     really want it off if they happen to use any of the interfaces in
4332     question (typically most users who disable it won't).
4333   Fixed GUIDs in projects/vstudio. Some were duplicated or missing,
4334     resulting in VS2010 having to update the files.
4335   Removed non-working ICC profile support code that was mostly added to
4336     libpng-1.6.0beta29 and beta30. There was too much code for too little
4337     gain; implementing full ICC color correction may be desireable but is left
4338     up to applications.
4339 
4340 Version 1.6.0beta32 [November 25, 2012]
4341   Fixed an intermittent SEGV in pngstest due to an uninitialized array element.
4342   Added the ability for contrib/libtests/makepng.c to make a PNG with just one
4343     color. This is useful for debugging pngstest color inaccuracy reports.
4344   Fixed error checking in the simplified write API (Olaf van der Spek)
4345   Made png_user_version_check() ok to use with libpng version 1.10.x and later.
4346 
4347 Version 1.6.0beta33 [December 15, 2012]
4348   Fixed typo in png.c (PNG_SET_CHUNK_MALLOC_MAX should be PNG_CHUNK_MALLOC_MAX)
4349     that causes the MALLOC_MAX limit not to work (John Bowler)
4350   Change png_warning() to png_app_error() in pngwrite.c and comment the
4351     fall-through condition.
4352   Change png_warning() to png_app_warning() in png_write_tRNS().
4353   Rearranged the ARM-NEON optimizations: Isolated the machine specific code
4354     to the hardware subdirectory and added comments to pngrutil.c so that
4355     implementors of other optimizations know what to do.
4356   Fixed cases of unquoted DESTDIR in Makefile.am
4357   Rebuilt Makefile.in, etc., with autoconf-2.69 and automake-1.12.5.
4358 
4359 Version 1.6.0beta34 [December 19, 2012]
4360   Cleaned up whitespace in the synopsis portion of the manpage "libpng.3"
4361   Disassembled the version number in scripts/options.awk (necessary for
4362     building on SunOs).
4363 
4364 Version 1.6.0beta35 [December 23, 2012]
4365   Made default Zlib compression settings be configurable. This adds #defines to
4366     pnglibconf.h to control the defaults.
4367   Fixed Windows build issues, enabled ARM compilation. Various warnings issued
4368     by earlier versions of GCC fixed for Cygwin and Min/GW (which both use old
4369     GCCs.) ARM support is enabled by default in zlib.props (unsupported by
4370     Microsoft) and ARM compilation is made possible by deleting the check for
4371     x86. The test programs cannot be run because they are not signed.
4372 
4373 Version 1.6.0beta36 [January 2, 2013]
4374   Discontinued distributing libpng-1.x.x.tar.bz2.
4375   Discontinued distributing libpng-1.7.0-1.6.0-diff.txt and similar.
4376   Rebuilt configure with autoconf-2.69 (inadvertently not done in beta33)
4377   Fixed 'make distcheck' on SUN OS - libpng.so was not being removed
4378 
4379 Version 1.6.0beta37 [January 10, 2013]
4380   Fixed conceivable but difficult to repro overflow. Also added two test
4381     programs to generate and test a PNG which should have the problem.
4382 
4383 Version 1.6.0beta39 [January 19, 2013]
4384   Again corrected attempt at overflow detection in png_set_unknown_chunks()
4385   (CVE-2013-7353).  Added overflow detection in png_set_sPLT() and
4386   png_set_text_2() (CVE-2013-7354).
4387 
4388 Version 1.6.0beta40 [January 20, 2013]
4389   Use consistent handling of overflows in text, sPLT and unknown png_set_* APIs
4390 
4391 Version 1.6.0rc01 [January 26, 2013]
4392   No changes.
4393 
4394 Version 1.6.0rc02 [February 4, 2013]
4395   Added png_get_palette_max() function.
4396 
4397 Version 1.6.0rc03 [February 5, 2013]
4398   Fixed the png_get_palette_max API.
4399 
4400 Version 1.6.0rc04 [February 7, 2013]
4401   Turn serial tests back on (recently turned off by autotools upgrade).
4402 
4403 Version 1.6.0rc05 [February 8, 2013]
4404   Update manual about png_get_palette_max().
4405 
4406 Version 1.6.0rc06 [February 9, 2013]
4407   Fixed missing dependency in --prefix builds The intermediate
4408     internal 'prefix.h' file can only be generated correctly after
4409     pnglibconf.h, however the dependency was not in Makefile.am.  The
4410     symptoms are unpredictable depending on the order make chooses to
4411     build pngprefix.h and pnglibconf.h, often the error goes unnoticed
4412     because there is a system pnglibconf.h to use instead.
4413 
4414 Version 1.6.0rc07 [February 10, 2013]
4415   Enclosed the new png_get_palette_max in #ifdef PNG_GET_PALETTE_MAX_SUPPORTED
4416     block, and revised pnglibconf.h and pnglibconf.h.prebuilt accordingly.
4417 
4418 Version 1.6.0rc08 [February 10, 2013]
4419   Fix typo in png.h #ifdef
4420 
4421 Version 1.6.0 [February 14, 2013]
4422   No changes.
4423 
4424 Version 1.6.1beta01 [February 16, 2013]
4425   Made symbol prefixing work with the ARM neon optimizations. Also allow
4426     pngpriv.h to be included for preprocessor definitions only, so it can
4427     be used in non-C/C++ files. Back ported from libpng 1.7.
4428   Made sRGB check numbers consistent.
4429   Ported libpng 1.5 options.awk/dfn file handling to 1.6, fixed one bug.
4430   Removed cc -E workround, corrected png_get_palette_max API Tested on
4431     SUN OS cc 5.9, which demonstrates the tokenization problem previously
4432     avoided by using /lib/cpp.  Since all .dfn output is now protected in
4433     double quotes unless it is to be macro substituted the fix should
4434     work everywhere.
4435   Enabled parallel tests - back ported from libpng-1.7.
4436   scripts/pnglibconf.dfa formatting improvements back ported from libpng17.
4437   Fixed a race condition in the creation of the build 'scripts' directory
4438     while building with a parallel make.
4439   Use approved/supported Android method to check for NEON, use Linux/POSIX
4440     1003.1 API to check /proc/self/auxv avoiding buffer allocation and other
4441     library calls (ported from libpng15).
4442 
4443 Version 1.6.1beta02 [February 19, 2013]
4444   Use parentheses more consistently in "#if defined(MACRO)" tests.
4445   Folded long lines.
4446   Reenabled code to allow zero length PLTE chunks for MNG.
4447 
4448 Version 1.6.1beta03 [February 22, 2013]
4449   Fixed ALIGNED_MEMORY support.
4450   Added a new configure option:
4451     --enable-arm-neon=always will stop the run-time checks. New checks
4452     within arm/arm_init.c will cause the code not to be compiled unless
4453     __ARM_NEON__ is set. This should make it fail safe (if someone asks
4454     for it on then the build will fail if it can't be done.)
4455   Updated the INSTALL document.
4456 
4457 Version 1.6.1beta04 [February 27, 2013]
4458   Revised INSTALL to recommend using CPPFLAGS instead of INCLUDES.
4459   Revised scripts/makefile.freebsd to respect ZLIBLIB and ZLIBINC.
4460   Revised scripts/dfn.awk to work with the buggy MSYS awk that has trouble
4461     with CRLF line endings.
4462 
4463 Version 1.6.1beta05 [March 1, 2013]
4464   Avoid a possible memory leak in contrib/gregbook/readpng.c
4465 
4466 Version 1.6.1beta06 [March 4, 2013]
4467   Better documentation of unknown handling API interactions.
4468   Corrected Android builds and corrected libpng.vers with symbol
4469     prefixing.  It also makes those tests compile and link on Android.
4470   Added an API png_set_option() to set optimization options externally,
4471     providing an alternative and general solution for the non-portable
4472     run-time tests used by the ARM Neon code, using the PNG_ARM_NEON option.
4473   The order of settings vs options in pnglibconf.h is reversed to allow
4474     settings to depend on options and options can now set (or override) the
4475     defaults for settings.
4476 
4477 Version 1.6.1beta07 [March 7, 2013]
4478   Corrected simplified API default gamma for color-mapped output, added
4479     a flag to change default. In 1.6.0 when the simplified API was used
4480     to produce color-mapped output from an input image with no gamma
4481     information the gamma assumed for the input could be different from
4482     that assumed for non-color-mapped output.  In particular 16-bit depth
4483     input files were assumed to be sRGB encoded, whereas in the 'direct'
4484     case they were assumed to have linear data.  This was an error.  The
4485     fix makes the simplified API treat all input files the same way and
4486     adds a new flag to the png_image::flags member to allow the
4487     application/user to specify that 16-bit files contain sRGB data
4488     rather than the default linear.
4489   Fixed bugs in the pngpixel and makepng test programs.
4490 
4491 Version 1.6.1beta08 [March 7, 2013]
4492   Fixed CMakelists.txt to allow building a single variant of the library
4493     (Claudio Bley):
4494   Introduced a PNG_LIB_TARGETS variable that lists all activated library
4495     targets.  It is an error if this variable ends up empty, ie. you have
4496     to build at least one library variant.
4497   Made the *_COPY targets only depend on library targets actually being build.
4498   Use PNG_LIB_TARGETS to unify a code path.
4499   Changed the CREATE_SYMLINK macro to expect the full path to a file as the
4500     first argument. When symlinking the filename component of that path is
4501     determined and used as the link target.
4502   Use copy_if_different in the CREATE_SYMLINK macro.
4503 
4504 Version 1.6.1beta09 [March 13, 2013]
4505   Eliminated two warnings from the Intel C compiler. The warnings are
4506     technically valid, although a reasonable treatment of division would
4507     show it to be incorrect.
4508 
4509 Version 1.6.1rc01 [March 21, 2013]
4510   No changes.
4511 
4512 Version 1.6.1 [March 28, 2013]
4513   No changes.
4514 
4515 Version 1.6.2beta01 [April 14, 2013]
4516   Updated documentation of 1.5.x to 1.6.x changes in iCCP chunk handling.
4517   Fixed incorrect warning of excess deflate data. End condition - the
4518     warning would be produced if the end of the deflate stream wasn't read
4519     in the last row.  The warning is harmless.
4520   Corrected the test on user transform changes on read. It was in the
4521     png_set of the transform function, but that doesn't matter unless the
4522     transform function changes the rowbuf size, and that is only valid if
4523     transform_info is called.
4524   Corrected a misplaced closing bracket in contrib/libtests/pngvalid.c
4525     (Flavio Medeiros).
4526   Corrected length written to uncompressed iTXt chunks (Samuli Suominen).
4527     Bug was introduced in libpng-1.6.0.
4528 
4529 Version 1.6.2rc01 [April 18, 2013]
4530   Added contrib/tools/fixitxt.c, to repair the erroneous iTXt chunk length
4531     written by libpng-1.6.0 and 1.6.1.
4532   Disallow storing sRGB information when the sRGB is not supported.
4533 
4534 Version 1.6.2rc02 [April 18, 2013]
4535   Merge pngtest.c with libpng-1.7.0
4536 
4537 Version 1.6.2rc03 [April 22, 2013]
4538   Trivial spelling cleanup.
4539 
4540 Version 1.6.2rc04 and 1.6.2rc05 [omitted]
4541 
4542 Version 1.6.2rc06 [April 24, 2013]
4543   Reverted to version 1.6.2rc03.  Recent changes to arm/neon support
4544     have been ported to libpng-1.7.0beta09 and will reappear in version
4545     1.6.3beta01.
4546 
4547 Version 1.6.2 [April 25, 2013]
4548   No changes.
4549 
4550 Version 1.6.3beta01 [April 25, 2013]
4551   Revised stack marking in arm/filter_neon.S and configure.ac.
4552   Ensure that NEON filter stuff is completely disabled when switched 'off'.
4553     Previously the ARM NEON specific files were still built if the option
4554     was switched 'off' as opposed to being explicitly disabled.
4555 
4556 Version 1.6.3beta02 [April 26, 2013]
4557   Test for 'arm*' not just 'arm' in the host_cpu configure variable.
4558   Rebuilt the configure scripts.
4559 
4560 Version 1.6.3beta03 [April 30, 2013]
4561   Expanded manual paragraph about writing private chunks, particularly
4562     the need to call png_set_keep_unknown_chunks() when writing them.
4563   Avoid dereferencing NULL pointer possibly returned from
4564     png_create_write_struct() (Andrew Church).
4565 
4566 Version 1.6.3beta05 [May 9, 2013]
4567   Calculate our own zlib windowBits when decoding rather than trusting the
4568     CMF bytes in the PNG datastream.
4569   Added an option to force maximum window size for inflating, which was
4570     the behavior of libpng15 and earlier, via a new PNG_MAXIMUM_INFLATE_WINDOW
4571     option for png_set_options().
4572   Added png-fix-itxt and png-fix-too-far-back to the built programs and
4573     removed warnings from the source code and timepng that are revealed as
4574     a result.
4575   Detect wrong libpng versions linked to png-fix-too-far-back, which currently
4576     only works with libpng versions that can be made to reliably fail when
4577     the deflate data contains an out-of-window reference.  This means only
4578     1.6 and later.
4579   Fixed gnu issues: g++ needs a static_cast, gcc 4.4.7 has a broken warning
4580     message which it is easier to work round than ignore.
4581   Updated contrib/pngminus/pnm2png.c (Paul Stewart):
4582     Check for EOF
4583     Ignore "#" delimited comments in input file to pnm2png.c.
4584     Fixed whitespace handling
4585     Added a call to png_set_packing()
4586     Initialize dimension values so if sscanf fails at least we have known
4587       invalid values.
4588   Attempt to detect configuration issues with png-fix-too-far-back, which
4589     requires both the correct libpng and the correct zlib to function
4590     correctly.
4591   Check ZLIB_VERNUM for mismatches, enclose #error in quotes
4592   Added information in the documentation about problems with and fixes for
4593     the bad CRC and bad iTXt chunk situations.
4594 
4595 Version 1.6.3beta06 [May 12, 2013]
4596   Allow contrib/pngminus/pnm2png.c to compile without WRITE_INVERT and
4597     WRITE_PACK supported (writes error message that it can't read P1 or
4598     P4 PBM files).
4599   Improved png-fix-too-far-back usage message, added --suffix option.
4600   Revised contrib/pngminim/*/makefile to generate pnglibconf.h with the
4601     right zlib header files.
4602   Separated CPPFLAGS and CFLAGS in contrib/pngminim/*/makefile
4603 
4604 Version 1.6.3beta07 [June 8, 2013]
4605   Removed a redundant test in png_set_IHDR().
4606   Added set(CMAKE_CONFIGURATION_TYPES ...) to CMakeLists.txt (Andrew Hundt)
4607   Deleted set(CMAKE_BUILD_TYPE) block from CMakeLists.txt
4608   Enclose the prototypes for the simplified write API in
4609     #ifdef PNG_STDIO_SUPPORTED/#endif
4610   Make ARM NEON support work at compile time (not just configure time).
4611     This moves the test on __ARM_NEON__ into pngconf.h to avoid issues when
4612     using a compiler that compiles for multiple architectures at one time.
4613   Removed PNG_FILTER_OPTIMIZATIONS and PNG_ARM_NEON_SUPPORTED from
4614     pnglibconf.h, allowing more of the decisions to be made internally
4615     (pngpriv.h) during the compile.  Without this, symbol prefixing is broken
4616     under certain circumstances on ARM platforms.  Now only the API parts of
4617     the optimizations ('check' vs 'api') are exposed in the public header files
4618     except that the new setting PNG_ARM_NEON_OPT documents how libpng makes the
4619     decision about whether or not to use the optimizations.
4620   Protect symbol prefixing against CC/CPPFLAGS/CFLAGS useage.
4621     Previous iOS/Xcode fixes for the ARM NEON optimizations moved the test
4622     on __ARM_NEON__ from configure time to compile time.  This breaks symbol
4623     prefixing because the definition of the special png_init_filter_functions
4624     call was hidden at configure time if the relevant compiler arguments are
4625     passed in CFLAGS as opposed to CC.  This change attempts to avoid all
4626     the confusion that would result by declaring the init function even when
4627     it is not used, so that it will always get prefixed.
4628 
4629 Version 1.6.3beta08 [June 18, 2013]
4630   Revised libpng.3 so that "doclifter" can process it.
4631 
4632 Version 1.6.3beta09 [June 27, 2013]
4633   Revised example.c to illustrate use of PNG_DEFAULT_sRGB and PNG_GAMMA_MAC_18
4634     as parameters for png_set_gamma().  These have been available since
4635     libpng-1.5.4.
4636   Renamed contrib/tools/png-fix-too-far-back.c to pngfix.c and revised it
4637     to check all compressed chunks known to libpng.
4638 
4639 Version 1.6.3beta10 [July 5, 2013]
4640   Updated documentation to show default behavior of benign errors correctly.
4641   Only compile ARM code when PNG_READ_SUPPORTED is defined.
4642   Fixed undefined behavior in contrib/tools/pngfix.c and added new strip
4643     option. pngfix relied on undefined behavior and even a simple change from
4644     gcc to g++ caused it to fail.  The new strip option 'unsafe' has been
4645     implemented and is the default if --max is given.  Option names have
4646     been clarified, with --strip=transform now stripping the bKGD chunk,
4647     which was stripped previously with --strip=unused.
4648   Added all documented chunk types to pngpriv.h
4649   Unified pngfix.c source with libpng17.
4650 
4651 Version 1.6.3rc01 [July 11, 2013]
4652   No changes.
4653 
4654 Version 1.6.3 [July 18, 2013]
4655   Revised manual about changes in iTXt chunk handling made in libpng-1.6.0.
4656   Added "/* SAFE */" comments in pngrutil.c and pngrtran.c where warnings
4657     may be erroneously issued by code-checking applications.
4658 
4659 Version 1.6.4beta01 [August 21, 2013]
4660   Added information about png_set_options() to the manual.
4661   Delay calling png_init_filter_functions() until a row with nonzero filter
4662     is found.
4663 
4664 Version 1.6.4beta02 [August 30, 2013]
4665   Fixed inconsistent conditional compilation of png_chunk_unknown_handling()
4666     prototype, definition, and usage.  Made it depend on
4667     PNG_HANDLE_AS_UNKNOWN_SUPPORTED everywhere.
4668 
4669 Version 1.6.4rc01 [September 5, 2013]
4670   No changes.
4671 
4672 Version 1.6.4 [September 12, 2013]
4673   No changes.
4674 
4675 Version 1.6.5 [September 14, 2013]
4676   Removed two stray lines of code from arm/arm_init.c.
4677 
4678 Version 1.6.6 [September 16, 2013]
4679   Removed two stray lines of code from arm/arm_init.c, again.
4680 
4681 Version 1.6.7beta01 [September 30, 2013]
4682   Revised unknown chunk code to correct several bugs in the NO_SAVE_/NO_WRITE
4683     combination
4684   Allow HANDLE_AS_UNKNOWN to work when other options are configured off. Also
4685     fixed the pngminim makefiles to work when $(MAKEFLAGS) contains stuff
4686     which terminates the make options (as by default in recent versions of
4687     Gentoo).
4688   Avoid up-cast warnings in pngvalid.c. On ARM the alignment requirements of
4689     png_modifier are greater than that of png_store and as a consequence
4690     compilation of pngvalid.c results in a warning about increased alignment
4691     requirements because of the bare cast to (png_modifier*). The code is safe,
4692     because the pointer is known to point to a stack allocated png_modifier,
4693     but this change avoids the warning.
4694   Fixed default behavior of ARM_NEON_API. If the ARM NEON API option was
4695     compiled without the CHECK option it defaulted to on, not off.
4696   Check user callback behavior in pngunknown.c. Previous versions compiled
4697     if SAVE_UNKNOWN was not available but did nothing since the callback
4698     was never implemented.
4699   Merged pngunknown.c with 1.7 version and back ported 1.7 improvements/fixes
4700 
4701 Version 1.6.7beta02 [October 12, 2013]
4702   Made changes for compatibility with automake 1.14:
4703     1) Added the 'compile' program to the list of programs that must be cleaned
4704        in autogen.sh
4705     2) Added 'subdir-objects' which causes .c files in sub-directories to be
4706        compiled such that the corresponding .o files are also in the
4707        sub-directory.  This is because automake 1.14 warns that the
4708        current behavior of compiling to the top level directory may be removed
4709        in the future.
4710     3) Updated dependencies on pnglibconf.h to match the new .o locations and
4711        added all the files in contrib/libtests and contrib/tools that depend
4712        on pnglibconf.h
4713     4) Added 'BUILD_SOURCES = pnglibconf.h'; this is the automake recommended
4714        way of handling the dependencies of sources that are machine generated;
4715        unfortunately it only works if the user does 'make all' or 'make check',
4716        so the dependencies (3) are still required.
4717   Cleaned up (char*) casts of zlib messages. The latest version of the Intel C
4718     compiler complains about casting a string literal as (char*), so copied the
4719     treatment of z_const from the library code into pngfix.c
4720   Simplified error message code in pngunknown. The simplification has the
4721     useful side effect of avoiding a bogus warning generated by the latest
4722     version of the Intel C compiler (it objects to
4723     condition ? string-literal : string-literal).
4724   Make autogen.sh work with automake 1.13 as well as 1.14. Do this by always
4725     removing the 1.14 'compile' script but never checking for it.
4726 
4727 Version 1.6.7beta03 [October 19, 2013]
4728   Added ARMv8 support (James Yu <james.yu at linaro.org>).  Added file
4729     arm/filter_neon_intrinsics.c; enable with -mfpu=neon.
4730   Revised pngvalid to generate size images with as many filters as it can
4731     manage, limited by the number of rows.
4732   Cleaned up ARM NEON compilation handling. The tests are now in pngpriv.h
4733     and detect the broken GCC compilers.
4734 
4735 Version 1.6.7beta04 [October 26, 2013]
4736   Allow clang derived from older GCC versions to use ARM intrinsics. This
4737     causes all clang builds that use -mfpu=neon to use the intrinsics code,
4738     not the assembler code.  This has only been tested on iOS 7. It may be
4739     necessary to exclude some earlier clang versions but this seems unlikely.
4740   Changed NEON implementation selection mechanism. This allows assembler
4741     or intrinsics to be turned on at compile time during the build by defining
4742     PNG_ARM_NEON_IMPLEMENTATION to the correct value (2 or 1).  This macro
4743     is undefined by default and the build type is selected in pngpriv.h.
4744 
4745 Version 1.6.7rc01 [November 2, 2013]
4746   No changes.
4747 
4748 Version 1.6.7rc02 [November 7, 2013]
4749   Fixed #include in filter_neon_intrinsics.c and ctype macros. The ctype char
4750     checking macros take an unsigned char argument, not a signed char.
4751 
4752 Version 1.6.7 [November 14, 2013]
4753   No changes.
4754 
4755 Version 1.6.8beta01 [November 24, 2013]
4756   Moved prototype for png_handle_unknown() in pngpriv.h outside of
4757     the #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED/#endif block.
4758   Added "-Wall" to CFLAGS in contrib/pngminim/*/makefile
4759   Conditionally compile some unused functions reported by -Wall in
4760     pngminim.
4761   Fixed 'minimal' builds. Various obviously useful minimal configurations
4762     don't build because of missing contrib/libtests test programs and
4763     overly complex dependencies in scripts/pnglibconf.dfa. This change
4764     adds contrib/conftest/*.dfa files that can be used in automatic build
4765     scripts to ensure that these configurations continue to build.
4766   Enabled WRITE_INVERT and WRITE_PACK in contrib/pngminim/encoder.
4767   Fixed pngvalid 'fail' function declaration on the Intel C Compiler.
4768     This reverts to the previous 'static' implementation and works round
4769     the 'unused static function' warning by using PNG_UNUSED().
4770 
4771 Version 1.6.8beta02 [November 30, 2013]
4772   Removed or marked PNG_UNUSED some harmless "dead assignments" reported
4773     by clang scan-build.
4774   Changed tabs to 3 spaces in png_debug macros and changed '"%s"m'
4775     to '"%s" m' to improve portability among compilers.
4776   Changed png_free_default() to free() in pngtest.c
4777 
4778 Version 1.6.8rc01 [December 12, 2013]
4779   Tidied up pngfix inits and fixed pngtest no-write builds.
4780 
4781 Version 1.6.8rc02 [December 14, 2013]
4782   Handle zero-length PLTE chunk or NULL palette with png_error()
4783     instead of png_chunk_report(), which by default issues a warning
4784     rather than an error, leading to later reading from a NULL pointer
4785     (png_ptr->palette) in png_do_expand_palette(). This is CVE-2013-6954
4786     and VU#650142.  Libpng-1.6.1 through 1.6.7 are vulnerable.
4787     Libpng-1.6.0 and earlier do not have this bug.
4788 
4789 Version 1.6.8 [December 19, 2013]
4790   No changes.
4791 
4792 Version 1.6.9beta01 [December 26, 2013]
4793   Bookkeeping: Moved functions around (no changes). Moved transform
4794     function definitions before the place where they are called so that
4795     they can be made static. Move the intrapixel functions and the
4796     grayscale palette builder out of the png?tran.c files. The latter
4797     isn't a transform function and is no longer used internally, and the
4798     former MNG specific functions are better placed in pngread/pngwrite.c
4799   Made transform implementation functions static. This makes the internal
4800     functions called by png_do_{read|write}_transformations static. On an
4801     x86-64 DLL build (Gentoo Linux) this reduces the size of the text
4802     segment of the DLL by 1208 bytes, about 0.6%. It also simplifies
4803     maintenance by removing the declarations from pngpriv.h and allowing
4804     easier changes to the internal interfaces.
4805   Rebuilt configure scripts with automake-1.14.1 and autoconf-2.69
4806     in the tar distributions.
4807 
4808 Version 1.6.9beta02 [January 1, 2014]
4809   Added checks for libpng 1.5 to pngvalid.c.  This supports the use of
4810     this version of pngvalid in libpng 1.5
4811   Merged with pngvalid.c from libpng-1.7 changes to create a single
4812     pngvalid.c
4813   Removed #error macro from contrib/tools/pngfix.c (Thomas Klausner).
4814   Merged pngrio.c, pngtrans.c, pngwio.c, and pngerror.c with libpng-1.7.0
4815   Merged libpng-1.7.0 changes to make no-interlace configurations work
4816     with test programs.
4817   Revised pngvalid.c to support libpng 1.5, which does not support the
4818     PNG_MAXIMUM_INFLATE_WINDOW option, so #define it out when appropriate in
4819     pngvalid.c
4820   Allow unversioned links created on install to be disabled in configure.
4821     In configure builds 'make install' changes/adds links like png.h
4822     and libpng.a to point to the newly installed, versioned, files (e.g.
4823     libpng17/png.h and libpng17.a). Three new configure options and some
4824     rearrangement of Makefile.am allow creation of these links to be disabled.
4825 
4826 Version 1.6.9beta03 [January 10, 2014]
4827   Removed potentially misleading warning from png_check_IHDR().
4828 
4829 Version 1.6.9beta04 [January 20, 2014]
4830   Updated scripts/makefile.* to use CPPFLAGS (Cosmin).
4831   Added clang attribute support (Cosmin).
4832 
4833 Version 1.6.9rc01 [January 28, 2014]
4834   No changes.
4835 
4836 Version 1.6.9rc02 [January 30, 2014]
4837   Quiet an uninitialized memory warning from VC2013 in png_get_png().
4838 
4839 Version 1.6.9 [February 6, 2014]
4840 
4841 Version 1.6.10beta01 [February 9, 2014]
4842   Backported changes from libpng-1.7.0beta30 and beta31:
4843   Fixed a large number of instances where PNGCBAPI was omitted from
4844     function definitions.
4845   Added pngimage test program for png_read_png() and png_write_png()
4846     with two new test scripts.
4847   Removed dependence on !PNG_READ_EXPAND_SUPPORTED for calling
4848     png_set_packing() in png_read_png().
4849   Fixed combination of ~alpha with shift. On read invert alpha, processing
4850     occurred after shift processing, which causes the final values to be
4851     outside the range that should be produced by the shift. Reversing the
4852     order on read makes the two transforms work together correctly and mirrors
4853     the order used on write.
4854   Do not read invalid sBIT chunks. Previously libpng only checked sBIT
4855     values on write, so a malicious PNG writer could therefore cause
4856     the read code to return an invalid sBIT chunk, which might lead to
4857     application errors or crashes.  Such chunks are now skipped (with
4858     chunk_benign_error).
4859   Make png_read_png() and png_write_png() prototypes in png.h depend
4860     upon PNG_READ_SUPPORTED and PNG_WRITE_SUPPORTED.
4861   Support builds with unsupported PNG_TRANSFORM_* values.  All of the
4862     PNG_TRANSFORM_* values are always defined in png.h and, because they
4863     are used for both read and write in some cases, it is not reliable
4864     to #if out ones that are totally unsupported. This change adds error
4865     detection in png_read_image() and png_write_image() to do a
4866     png_app_error() if the app requests something that cannot be done
4867     and it adds corresponding code to pngimage.c to handle such options
4868     by not attempting to test them.
4869 
4870 Version 1.6.10beta02 [February 23, 2014]
4871   Moved redefines of png_error(), png_warning(), png_chunk_error(),
4872     and png_chunk_warning() from pngpriv.h to png.h to make them visible
4873     to libpng-calling applications.
4874   Moved OS dependent code from arm/arm_init.c, to allow the included
4875     implementation of the ARM NEON discovery function to be set at
4876     build-time and provide sample implementations from the current code in the
4877     contrib/arm-neon subdirectory. The __linux__ code has also been changed to
4878     compile and link on Android by using /proc/cpuinfo, and the old linux code
4879     is in contrib/arm-neon/linux-auxv.c.  The new code avoids POSIX and Linux
4880     dependencies apart from opening /proc/cpuinfo and is C90 compliant.
4881   Check for info_ptr == NULL early in png_read_end() so we don't need to
4882     run all the png_handle_*() and depend on them to return if info_ptr == NULL.
4883     This improves the performance of png_read_end(png_ptr, NULL) and makes
4884     it more robust against future programming errors.
4885   Check for __has_extension before using it in pngconf.h, to
4886     support older Clang versions (Jeremy Sequoia).
4887   Treat CRC error handling with png_set_crc_action(), instead of with
4888     png_set_benign_errors(), which has been the case since libpng-1.6.0beta18.
4889   Use a user warning handler in contrib/gregbook/readpng2.c instead of default,
4890     so warnings will be put on stderr even if libpng has CONSOLE_IO disabled.
4891   Added png_ptr->process_mode = PNG_READ_IDAT_MODE in png_push_read_chunk
4892     after recognizing the IDAT chunk, which avoids an infinite loop while
4893     reading a datastream whose first IDAT chunk is of zero-length.
4894     This fixes CERT VU#684412 and CVE-2014-0333.
4895   Don't recognize known sRGB profiles as sRGB if they have been hacked,
4896     but don't reject them and don't issue a copyright violation warning.
4897 
4898 Version 1.6.10beta03 [February 25, 2014]
4899   Moved some documentation from png.h to libpng.3 and libpng-manual.txt
4900   Minor editing of contrib/arm-neon/README and contrib/examples/*.c
4901 
4902 Version 1.6.10rc01 [February 27, 2014]
4903   Fixed typos in the manual and in scripts/pnglibconf.dfa (CFLAGS -> CPPFLAGS
4904     and PNG_USR_CONFIG -> PNG_USER_CONFIG).
4905 
4906 Version 1.6.10rc02 [February 28, 2014]
4907   Removed unreachable return statement after png_chunk_error()
4908     in pngrutil.c
4909 
4910 Version 1.6.10rc03 [March 4, 2014]
4911   Un-deprecated png_data_freer().
4912 
4913 Version 1.6.10 [March 6, 2014]
4914   No changes.
4915 
4916 Version 1.6.11beta01 [March 17, 2014]
4917   Use "if (value != 0)" instead of "if (value)" consistently.
4918   Changed ZlibSrcDir from 1.2.5 to 1.2.8 in projects/vstudio.
4919   Moved configuration information from the manual to the INSTALL file.
4920 
4921 Version 1.6.11beta02 [April 6, 2014]
4922   Removed #if/#else/#endif from inside two pow() calls in pngvalid.c because
4923     they were handled improperly by Portland Group's PGI-14.1 - PGI-14.3
4924     when using its "__builtin_pow()" function.
4925   Silence 'unused parameter' build warnings (Cosmin Truta).
4926   $(CP) is now used alongside $(RM_F).  Also, use 'copy' instead of 'cp'
4927     where applicable, and applied other minor makefile changes (Cosmin).
4928   Don't warn about invalid dimensions exceeding user limits (Cosmin).
4929   Allow an easy replacement of the default pre-built configuration
4930     header with a custom header, via the make PNGLIBCONF_H_PREBUILT
4931     macro (Cosmin).
4932 
4933 Version 1.6.11beta03 [April 6, 2014]
4934   Fixed a typo in pngrutil.c, introduced in libpng-1.5.6, that interferes
4935     with "blocky" expansion of sub-8-bit interlaced PNG files (Eric Huss).
4936   Optionally use  __builtin_bswap16() in png_do_swap().
4937 
4938 Version 1.6.11beta04 [April 19, 2014]
4939   Made progressive reading of interlaced images consistent with the
4940     behavior of the sequential reader and consistent with the manual, by
4941     moving some code out of the PNG_READ_INTERLACING_SUPPORTED blocks. The
4942     row_callback now receives the proper pass number and unexpanded rows, when
4943     png_combine_row() isn't built or used, and png_set_interlace_handling()
4944     is not called.
4945   Allow PNG_sRGB_PROFILE_CHECKING = (-1) to mean no sRGB profile checking.
4946 
4947 Version 1.6.11beta05 [April 26, 2014]
4948   Do not reject ICC V2 profiles that lack padding (Kai-Uwe Behrmann).
4949   Relocated closing bracket of the sRGB profile test loop to avoid getting
4950     "Not recognizing known sRGB profile that has been edited" warning for
4951     ICC V2 profiles that lack the MD5 signature in the profile header.
4952 
4953 Version 1.6.11beta06 [May 19, 2014]
4954   Added PNG_SKIP_sRGB_CHECK_PROFILE choice for png_set_option().
4955 
4956 Version 1.6.11rc01 [May 27, 2014]
4957   No changes.
4958 
4959 Version 1.6.11rc02 [June 3, 2014]
4960   Test ZLIB_VERNUM instead of PNG_ZLIB_VERNUM in contrib/tools/pngfix.c
4961 
4962 Version 1.6.11 [June 5, 2014]
4963   No changes.
4964 
4965 Version 1.6.12rc01 [June 6, 2014]
4966   Relocated new code from 1.6.11beta06 in png.c to a point after the
4967     declarations (Max Stepin).
4968 
4969 Version 1.6.12rc02 [June 7, 2014]
4970   Changed file permissions of contrib/tools/intgamma.sh,
4971     test-driver, and compile from 0644 to 0755 (Cosmin).
4972 
4973 Version 1.6.12rc03 [June 8, 2014]
4974   Ensure "__has_attribute()" macro exists before trying to use it with
4975     old clang compilers (MacPorts Ticket #43939).
4976 
4977 Version 1.6.12 [June 12, 2014]
4978   No changes.
4979 
4980 Version 1.6.13beta01 [July 4, 2014]
4981   Quieted -Wsign-compare and -Wclobber compiler warnings in
4982     contrib/pngminus/*.c
4983   Added "(void) png_ptr;" where needed in contrib/gregbook to quiet
4984     compiler complaints about unused pointers.
4985   Split a long output string in contrib/gregbook/rpng2-x.c.
4986   Added "PNG_SET_OPTION" requirement for sRGB chunk support to pnglibconf.dfa,
4987     Needed for write-only support (John Bowler).
4988   Changed "if defined(__ARM_NEON__)" to
4989     "if (defined(__ARM_NEON__) || defined(__ARM_NEON))" (James Wu).
4990   Fixed clang no-warning builds: png_digit was defined but never used.
4991     
4992 Version 1.6.13beta02 [July 21, 2014]
4993   Fixed an incorrect separator ("/" should be "\") in scripts/makefile.vcwin32
4994     (bug report from Wolfgang S. Kechel).  Bug was introduced in libpng-1.6.11.
4995     Also fixed makefile.bc32, makefile.bor, makefile.msc, makefile.intel, and
4996     makefile.tc3 similarly.
4997 
4998 Version 1.6.13beta03 [August 3, 2014]
4999   Removed scripts/makefile.elf. It has not worked since libpng-1.5.0beta14
5000     due to elimination of the PNG_FUNCTION_EXPORT and PNG_DATA_EXPORT
5001     definitions from pngconf.h.
5002   Ensure that CMakeLists.txt makes the target "lib" directory before making
5003     symbolic link into it (SourceForge bug report #226 by Rolf Timmermans).
5004 
5005 Version 1.6.13beta04 [August 8, 2014]
5006   Added opinion that the ECCN (Export Control Classification Number) for
5007     libpng is EAR99 to the README file.
5008   Eliminated use of "$<" in makefile explicit rules, when copying
5009     $PNGLIBCONF_H_PREBUILT.  This does not work on some versions of make;
5010     bug introduced in libpng version 1.6.11.
5011 
5012 Version 1.6.13rc01 [August 14, 2014]
5013   Made "ccopts" agree with "CFLAGS" in scripts/makefile.hp* and makefile.*sunu
5014 
5015 Version 1.6.13 [August 21, 2014]
5016   No changes.
5017 
5018 Version 1.6.14beta01 [September 14, 2014]
5019   Guard usage of png_ptr->options with #ifdef PNG_SET_OPTION_SUPPORTED.
5020   Do not build contrib/tools/pngfix.c when PNG_SETJMP_NOT_SUPPORTED,
5021     to allow "make" to complete without setjmp support (bug report by
5022     Claudio Fontana)
5023   Add "#include <setjmp.h>" to contrib/tools/pngfix.c (John Bowler)
5024 
5025 Version 1.6.14beta02 [September 18, 2014]
5026   Use nanosleep() instead of usleep() in contrib/gregbook/rpng2-x.c
5027     because usleep() is deprecated.
5028   Define usleep() in contrib/gregbook/rpng2-x.c if not already defined
5029     in unistd.h and nanosleep() is not available; fixes error introduced
5030     in libpng-1.6.13.
5031   Disable floating point exception handling in pngvalid.c when
5032     PNG_FLOATING_ARITHMETIC is not supported (bug report by "zootus
5033     at users.sourceforge.net").
5034 
5035 Version 1.6.14beta03 [September 19, 2014]
5036   Define FE_DIVBYZERO, FE_INVALID, and FE_OVERFLOW in pngvalid.c if not
5037     already defined.  Revert floating point exception handling in pngvalid.c
5038     to version 1.6.14beta01 behavior.
5039 
5040 Version 1.6.14beta04 [September 27, 2014]
5041   Fixed incorrect handling of the iTXt compression flag in pngrutil.c
5042     (bug report by Shunsaku Hirata).  Bug was introduced in libpng-1.6.0.
5043 
5044 Version 1.6.14beta05 [October 1, 2014]
5045   Added "option READ_iCCP enables READ_COMPRESSED_TEXT" to pnglibconf.dfa
5046 
5047 Version 1.6.14beta06 [October 5, 2014]
5048   Removed unused "text_len" parameter from private function png_write_zTXt().
5049   Conditionally compile some code in png_deflate_claim(), when
5050     PNG_WARNINGS_SUPPORTED and PNG_ERROR_TEXT_SUPPORTED are disabled.
5051   Replaced repeated code in pngpread.c with PNG_PUSH_SAVE_BUFFER_IF_FULL.
5052   Added "chunk iTXt enables TEXT" and "chunk zTXt enables TEXT"
5053     to pnglibconf.dfa.
5054   Removed "option READ_COMPRESSED_TEXT enables READ_TEXT" from pnglibconf.dfa,
5055     to make it possible to configure a libpng that supports iCCP but not TEXT.
5056 
5057 Version 1.6.14beta07 [October 7, 2014]
5058   Removed "option WRITE_COMPRESSED_TEXT enables WRITE_TEXT" from pnglibconf.dfa
5059   Only mark text chunks as written after successfully writing them.
5060 
5061 Version 1.6.14rc01 [October 15, 2014]
5062   Fixed some typos in comments.
5063 
5064 Version 1.6.14rc02 [October 17, 2014]
5065   Changed png_convert_to_rfc_1123() to png_convert_to_rfc_1123_buffer()
5066     in the manual, to reflect the change made in libpng-1.6.0.
5067   Updated README file to explain that direct access to the png_struct
5068     and info_struct members has not been permitted since libpng-1.5.0.
5069 
5070 Version 1.6.14 [October 23, 2014]
5071   No changes.
5072 
5073 Version 1.6.15beta01 [October 29, 2014]
5074   Changed "if (!x)" to "if (x == 0)" and "if (x)" to "if (x != 0)"
5075   Simplified png_free_data().
5076   Added missing "ptr = NULL" after some instances of png_free().
5077 
5078 Version 1.6.15beta02 [November 1, 2014]
5079   Changed remaining "if (!x)" to "if (x == 0)" and "if (x)" to "if (x != 0)"
5080 
5081 Version 1.6.15beta03 [November 3, 2014]
5082   Added PNG_USE_ARM_NEON configuration flag (Marcin Juszkiewicz).
5083 
5084 Version 1.6.15beta04 [November 4, 2014]
5085   Removed new PNG_USE_ARM_NEON configuration flag and made a one-line
5086     revision to configure.ac to support ARM on aarch64 instead (John Bowler).
5087 
5088 Version 1.6.15beta05 [November 5, 2014]
5089   Use png_get_libpng_ver(NULL) instead of PNG_LIBPNG_VER_STRING in
5090     example.c, pngtest.c, and applications in the contrib directory.
5091   Avoid out-of-bounds memory access in png_user_version_check().
5092   Simplified and future-proofed png_user_version_check().
5093   Fixed GCC unsigned int->float warnings. Various versions of GCC
5094     seem to generate warnings when an unsigned value is implicitly
5095     converted to double. This is probably a GCC bug but this change
5096     avoids the issue by explicitly converting to (int) where safe.
5097   Free all allocated memory in pngimage. The file buffer cache was left
5098     allocated at the end of the program, harmless but it causes memory
5099     leak reports from clang.
5100   Fixed array size calculations to avoid warnings. At various points
5101     in the code the number of elements in an array is calculated using
5102     sizeof.  This generates a compile time constant of type (size_t) which
5103     is then typically assigned to an (unsigned int) or (int). Some versions
5104     of GCC on 64-bit systems warn about the apparent narrowing, even though
5105     the same compiler does apparently generate the correct, in-range,
5106     numeric constant.  This adds appropriate, safe, casts to make the
5107     warnings go away.
5108 
5109 Version 1.6.15beta06 [November 6, 2014]
5110   Reverted use png_get_libpng_ver(NULL) instead of PNG_LIBPNG_VER_STRING
5111     in the manual, example.c, pngtest.c, and applications in the contrib
5112     directory.  It was incorrect advice.
5113 
5114 Version 1.6.15beta07 [November 7, 2014]
5115   Removed #ifdef PNG_16BIT_SUPPORTED/#endif around png_product2(); it is
5116     needed by png_reciprocal2().
5117   Added #ifdef PNG_16BIT_SUPPORTED/#endif around png_log16bit() and
5118     png_do_swap().
5119   Changed all "#endif /* PNG_FEATURE_SUPPORTED */" to "#endif /* FEATURE */"
5120 
5121 Version 1.6.15beta08 [November 8, 2014]
5122   More housecleaning in *.h
5123 
5124 Version 1.6.15rc01 [November 13, 2014]
5125 
5126 Version 1.6.15rc02 [November 14, 2014]
5127   The macros passed in the command line to Borland make were ignored if
5128     similarly-named macros were already defined in makefiles. This behavior
5129     is different from POSIX make and other make programs.  Surround the
5130     macro definitions with ifndef guards (Cosmin).
5131 
5132 Version 1.6.15rc03 [November 16, 2014]
5133   Added "-D_CRT_SECURE_NO_WARNINGS" to CFLAGS in scripts/makefile.vcwin32.
5134   Removed the obsolete $ARCH variable from scripts/makefile.darwin.
5135 
5136 Version 1.6.15 [November 20, 2014]
5137   No changes.
5138 
5139 Version 1.6.16beta01 [December 14, 2014]
5140   Added ".align 2" to arm/filter_neon.S to support old GAS assemblers that
5141     don't do alignment correctly.
5142   Revised Makefile.am and scripts/symbols.dfn to work with MinGW/MSYS
5143     (Bob Friesenhahn).
5144 
5145 Version 1.6.16beta02 [December 15, 2014]
5146   Revised Makefile.am and scripts/*.dfn again to work with MinGW/MSYS;
5147     renamed scripts/*.dfn to scripts/*.c (John Bowler).
5148 
5149 Version 1.6.16beta03 [December 21, 2014]
5150   Quiet a "comparison always true" warning in pngstest.c (John Bowler).
5151 
5152 Version 1.6.16rc01 [December 21, 2014]
5153   Restored a test on width that was removed from png.c at libpng-1.6.9
5154     (Bug report by Alex Eubanks, CVE-2015-0973).
5155 
5156 Version 1.6.16rc02 [December 21, 2014]
5157   Undid the update to pngrutil.c in 1.6.16rc01.
5158 
5159 Version 1.6.16rc03 [December 21, 2014]
5160   Fixed an overflow in png_combine_row() with very wide interlaced images
5161     (Bug report and fix by John Bowler, CVE-2014-9495).
5162 
5163 Version 1.6.16 [December 22, 2014]
5164   No changes.
5165 
5166 Version 1.6.17beta01 [January 29, 2015]
5167   Removed duplicate PNG_SAFE_LIMITS_SUPPORTED handling from pngconf.h
5168   Corrected the width limit calculation in png_check_IHDR().
5169   Removed user limits from pngfix. Also pass NULL pointers to
5170     png_read_row to skip the unnecessary row de-interlace stuff.
5171   Added testing of png_set_packing() to pngvalid.c
5172   Regenerated configure scripts in the *.tar distributions with libtool-2.4.4
5173   Implement previously untested cases of libpng transforms in pngvalid.c
5174   Fixed byte order in png_do_read_filler() with 16-bit input. Previously
5175     the high and low bytes of the filler, from png_set_filler() or from
5176     png_set_add_alpha(), were read in the wrong order.
5177   Made the check for out-of-range values in png_set_tRNS() detect
5178     values that are exactly 2^bit_depth, and work on 16-bit platforms.
5179   Merged some parts of libpng-1.6.17beta01 and libpng-1.7.0beta47.
5180   Added #ifndef __COVERITY__ where needed in png.c, pngrutil.c and
5181     pngset.c to avoid warnings about dead code.
5182   Added "& 0xff" to many instances of expressions that are typecast
5183     to (png_byte), to avoid Coverity warnings.
5184 
5185 Version 1.6.17beta02 [February 7, 2015]
5186   Work around one more Coverity-scan dead-code warning.
5187   Do not build png_product2() when it is unused.
5188 
5189 Version 1.6.17beta03 [February 17, 2015]
5190   Display user limits in the output from pngtest.
5191   Eliminated the PNG_SAFE_LIMITS macro and restored the 1-million-column
5192     and 1-million-row default limits in pnglibconf.dfa, that can be reset
5193     by the user at build time or run time.  This provides a more robust
5194     defense against DOS and as-yet undiscovered overflows.
5195 
5196 Version 1.6.17beta04 [February 21, 2015]
5197   Added PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED macro, on by default.
5198   Allow user to call png_get_IHDR() with NULL arguments (Reuben Hawkins).
5199   Rebuilt configure scripts with automake-1.15 and libtool-2.4.6
5200 
5201 Version 1.6.17beta05 [February 25, 2015]
5202   Restored compiling of png_reciprocal2 with PNG_NO_16BIT.
5203 
5204 Version 1.6.17beta06 [February 27, 2015]
5205   Moved png_set_filter() prototype into a PNG_WRITE_SUPPORTED block
5206     of png.h.
5207   Avoid runtime checks when converting integer to png_byte with
5208     Visual Studio (Sergey Kosarevsky)
5209 
5210 Version 1.6.17rc01 [March 4, 2015]
5211   No changes.
5212 
5213 Version 1.6.17rc02 [March 9, 2015]
5214   Removed some comments that the configure script did not handle
5215     properly from scripts/pnglibconf.dfa and pnglibconf.h.prebuilt.
5216   Free the unknown_chunks structure even when it contains no data.
5217 
5218 Version 1.6.17rc03 [March 12, 2015]
5219   Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF
5220     for consistency, and remove some useless tests (Alexey Petruchik).
5221 
5222 Version 1.6.17rc04 [March 16, 2015]
5223   Remove pnglibconf.h, pnglibconf.c, and pnglibconf.out instead of
5224     pnglibconf.* in "make clean" (Cosmin).
5225   Fix bug in calculation of maxbits, in png_write_sBIT, introduced
5226     in libpng-1.6.17beta01 (John Bowler).
5227 
5228 Version 1.6.17rc05 [March 21, 2015]
5229   Define PNG_FILTER_* and PNG_FILTER_VALUE_* in png.h even when WRITE
5230     is not supported (John Bowler).  This fixes an error introduced in
5231     libpng-1.6.17beta06.
5232   Reverted "& 0xff" additions of version 1.6.17beta01. Libpng passes
5233     the Coverity scan without them.
5234 
5235 Version 1.6.17rc06 [March 23, 2015]
5236   Remove pnglibconf.dfn and pnglibconf.pre with "make clean".
5237   Reformatted some "&0xff" instances to "& 0xff".
5238   Fixed simplified 8-bit-linear to sRGB alpha. The calculated alpha
5239     value was wrong.  It's not clear if this affected the final stored
5240     value; in the obvious code path the upper and lower 8-bits of the
5241     alpha value were identical and the alpha was truncated to 8-bits
5242     rather than dividing by 257 (John Bowler).
5243 
5244 Version 1.6.17 [March 26, 2015]
5245   No changes.
5246 
5247 Version 1.6.18beta01 [April 1, 2015]
5248   Removed PNG_SET_CHUNK_[CACHE|MALLOC]_LIMIT_SUPPORTED macros.  They
5249     have been combined with PNG_SET_USER_LIMITS_SUPPORTED (resolves
5250     bug report by Andrew Church).
5251   Fixed rgb_to_gray checks and added tRNS checks to pngvalid.c.  This
5252     fixes some arithmetic errors that caused some tests to fail on
5253     some 32-bit platforms (Bug reports by Peter Breitenlohner [i686]
5254     and Petr Gajdos [i586]).
5255 
5256 Version 1.6.18beta02 [April 26, 2015]
5257   Suppressed some warnings from the Borland C++ 5.5.1/5.82 compiler
5258     (Bug report by Viktor Szakats).
5259 
5260 Version 1.6.18beta03 [May 6, 2015]
5261   Replaced "unexpected" with an integer (0xabadca11) in pngset.c
5262     where a long was expected, to avoid a compiler warning when PNG_DEBUG > 1.
5263   Added contrib/examples/simpleover.c, to demonstrate how to handle
5264     alpha compositing of multiple images, using the "simplified API"
5265     and an example PNG generation tool, contrib/examples/genpng.c
5266     (John Bowler).
5267 
5268 Version 1.6.18beta04 [May 20, 2015]
5269   PNG_RELEASE_BUILD replaces tests where the code depended on the build base
5270     type and can be defined on the command line, allowing testing in beta
5271     builds (John Bowler).
5272   Avoid Coverity issue 80858 (REVERSE NULL) in pngtest.c PNG_DEBUG builds.
5273   Avoid a harmless potential integer overflow in png_XYZ_from_xy() (Bug
5274     report from Christopher Ferris).
5275 
5276 Version 1.6.18beta05 [May 31, 2015]
5277   Backport filter selection code from libpng-1.7.0beta51, to combine
5278     sub_row, up_row, avg_row, and paeth_row into try_row and tst_row.
5279   Changed png_voidcast(), etc., to voidcast(), etc., in contrib/tools/pngfix.c
5280     to avoid confusion with the libpng private macros.
5281   Fixed old cut&paste bug in the weighted filter selection code in
5282     pngwutil.c, introduced in libpng-0.95, March 1997.
5283 
5284 Version 1.6.18beta06 [June 1, 2015]
5285   Removed WRITE_WEIGHTED_FILTERED code, to save a few kbytes of the
5286     compiled library size. It never worked properly and as far as we can
5287     tell, no one uses it. The png_set_filter_heuristics() and
5288     png_set_filter_heuristics_fixed() APIs are retained but deprecated
5289     and do nothing.
5290 
5291 Version 1.6.18beta07 [June 6, 2015]
5292   Removed non-working progressive reader 'skip' function. This
5293     function has apparently never been used. It was implemented
5294     to support back-door modification of png_struct in libpng-1.4.x
5295     but (because it does nothing and cannot do anything) was apparently
5296     never tested (John Bowler).
5297   Fixed cexcept.h in which GCC 5 now reports that one of the auto
5298     variables in the Try macro needs to be volatile to prevent value
5299     being lost over the setjmp (John Bowler).
5300   Fixed NO_WRITE_FILTER and -Wconversion build breaks (John Bowler).
5301   Fix g++ build breaks (John Bowler).
5302   Quieted some Coverity issues in pngfix.c, png-fix-itxt.c, pngvalid.c,
5303     pngstest.c, and pngimage.c. Most seem harmless, but png-fix-itxt
5304     would only work with iTXt chunks with length 255 or less.
5305   Added #ifdef's to contrib/examples programs so people don't try
5306     to compile them without the minimum required support enabled
5307     (suggested by Flavio Medeiros).
5308 
5309 Version 1.6.18beta08 [June 30, 2015]
5310   Eliminated the final two Coverity defects (insecure temporary file
5311     handling in contrib/libtests/pngstest.c; possible overflow of
5312     unsigned char in contrib/tools/png-fix-itxt.c). To use the "secure"
5313     file handling, define PNG_USE_MKSTEMP, otherwise "tmpfile()" will
5314     be used.
5315   Removed some unused WEIGHTED_FILTER macros from png.h and pngstruct.h
5316 
5317 Version 1.6.18beta09 [July 5, 2015]
5318   Removed some useless typecasts from contrib/tools/png-fix-itxt.c
5319   Fixed a new signed-unsigned comparison in pngrtran.c (Max Stepin).
5320   Replaced arbitrary use of 'extern' with #define PNG_LINKAGE_*.  To
5321     preserve API compatibility, the new defines all default to "extern"
5322     (requested by Jan Nijtmans).
5323 
5324 Version 1.6.18rc01 [July 9, 2015]
5325   Belatedly added Mans Rullgard and James Yu to the list of Contributing
5326     Authors.
5327 
5328 Version 1.6.18rc02 [July 12, 2015]
5329   Restored unused FILTER_HEURISTIC macros removed at libpng-1.6.18beta08
5330     to png.h to avoid compatibility warnings.
5331 
5332 Version 1.6.18rc03 [July 15, 2015]
5333   Minor changes to the man page
5334 
5335 Version 1.6.18 [July 23, 2015]
5336   No changes.
5337 
5338 Version 1.6.19beta01 [July 30, 2015]
5339   Updated obsolete information about the simplified API macros in the
5340     manual pages (Bug report by Arc Riley).
5341   Avoid potentially dereferencing NULL info_ptr in png_info_init_3().
5342   Rearranged png.h to put the major sections in the same order as
5343     in libpng17.
5344   Eliminated unused PNG_COST_SHIFT, PNG_WEIGHT_SHIFT, PNG_COST_FACTOR, and
5345     PNG_WEIGHT_FACTOR macros.
5346   Suppressed some warnings from the Borland C++ 5.5.1/5.82 compiler
5347     (Bug report by Viktor Szakats).  Several warnings remain and are
5348     unavoidable, where we test for overflow.
5349   Fixed potential leak of png_pixels in contrib/pngminus/pnm2png.c
5350   Fixed uninitialized variable in contrib/gregbook/rpng2-x.c
5351 
5352 Version 1.6.19beta02 [August 19, 2015]
5353   Moved config.h.in~ from the "libpng_autotools_files" list to the
5354     "libpng_autotools_extra" list in autogen.sh because it was causing a
5355     false positive for missing files (bug report by Robert C. Seacord).
5356   Removed unreachable "break" statements in png.c, pngread.c, and pngrtran.c
5357     to suppress clang warnings (Bug report by Viktor Szakats).
5358   Fixed some bad links in the man page.
5359   Changed "n bit" to "n-bit" in comments.
5360   Added signed/unsigned 16-bit safety net. This removes the dubious
5361     0x8000 flag definitions on 16-bit systems. They aren't supported
5362     yet the defs *probably* work, however it seems much safer to do this
5363     and be advised if anyone, contrary to advice, is building libpng 1.6
5364     on a 16-bit system. It also adds back various switch default clauses
5365     for GCC; GCC errors out if they are not present (with an appropriately
5366     high level of warnings).
5367   Safely convert num_bytes to a png_byte in png_set_sig_bytes() (Robert
5368     Seacord).
5369   Fixed the recently reported 1's complement security issue by replacing
5370     the value that is illegal in the PNG spec, in both signed and unsigned
5371     values, with 0. Illegal unsigned values (anything greater than or equal
5372     to  0x80000000) can still pass through, but since these are not illegal
5373     in ANSI-C (unlike 0x80000000 in the signed case) the checking that
5374     occurs later can catch them (John Bowler).
5375 
5376 Version 1.6.19beta03 [September 26, 2015]
5377   Fixed png_save_int_32 when int is not 2's complement (John Bowler).
5378   Updated libpng16 with all the recent test changes from libpng17,
5379     including changes to pngvalid.c to ensure that the original,
5380     distributed, version of contrib/visupng/cexcept.h can be used
5381     (John Bowler).
5382   pngvalid contains the correction to the use of SAVE/STORE_
5383     UNKNOWN_CHUNKS; a bug revealed by changes in libpng 1.7. More
5384     tests contain the --strict option to detect warnings and the
5385     pngvalid-standard test has been corrected so that it does not
5386     turn on progressive-read. There is a separate test which does
5387     that. (John Bowler)
5388   Also made some signed/unsigned fixes.
5389   Make pngstest error limits version specific. Splitting the machine
5390     generated error structs out to a file allows the values to be updated
5391     without changing pngstest.c itself. Since libpng 1.6 and 1.7 have
5392     slightly different error limits this simplifies maintenance. The
5393     makepngs.sh script has also been updated to more accurately reflect
5394     current problems in libpng 1.7 (John Bowler).
5395   Incorporated new test PNG files into make check.  tests/pngstest-*
5396     are changed so that the new test files are divided into 8 groups by
5397     gamma and alpha channel.  These tests have considerably better code
5398     and pixel-value coverage than contrib/pngsuite; however,coverage is
5399     still incomplete (John Bowler).
5400   Removed the '--strict' in 1.6 because of the double-gamma-correction
5401     warning, updated pngstest-errors.h for the errors detected with the
5402     new contrib/testspngs PNG test files (John Bowler).
5403 
5404 Version 1.6.19beta04 [October 15, 2015]
5405   Worked around rgb-to-gray issues in libpng 1.6.  The previous
5406     attempts to ignore the errors in the code aren't quite enough to
5407     deal with the 'channel selection' encoding added to libpng 1.7; abort.
5408     pngvalid.c is changed to drop this encoding in prior versions.
5409   Fixed 'pow' macros in pngvalid.c. It is legal for 'pow' to be a
5410     macro, therefore the argument list cannot contain preprocessing
5411     directives.  Make sure pow is a function where this happens. This is
5412     a minimal safe fix, the issue only arises in non-performance-critical
5413     code (bug report by Curtis Leach, fix by John Bowler).
5414   Added sPLT support to pngtest.c
5415 
5416 Version 1.6.19rc01 [October 23, 2015]
5417   No changes.
5418 
5419 Version 1.6.19rc02 [October 31, 2015]
5420   Prevent setting or writing over-length PLTE chunk (Cosmin Truta).
5421   Silently truncate over-length PLTE chunk while reading.
5422   Libpng incorrectly calculated the output rowbytes when the application
5423     decreased either the number of channels or the bit depth (or both) in
5424     a user transform.  This was safe; libpng overallocated buffer space
5425    (potentially by quite a lot; up to 4 times the amount required) but,
5426    from 1.5.4 on, resulted in a png_error (John Bowler).
5427 
5428 Version 1.6.19rc03 [November 3, 2015]
5429   Fixed some inconsequential cut-and-paste typos in png_set_cHRM_XYZ_fixed().
5430   Clarified COPYRIGHT information to state explicitly that versions
5431     are derived from previous versions.
5432   Removed much of the long list of previous versions from png.h and
5433     libpng.3.
5434 
5435 Version 1.6.19rc04 [November 5, 2015]
5436   Fixed new bug with CRC error after reading an over-length palette
5437     (bug report by Cosmin Truta) (CVE-2015-8126).
5438 
5439 Version 1.6.19 [November 12, 2015]
5440   Cleaned up coding style in png_handle_PLTE().
5441 
5442 Version 1.6.20beta01 [November 20, 2015]
5443   Avoid potential pointer overflow/underflow in png_handle_sPLT() and
5444     png_handle_pCAL() (Bug report by John Regehr).
5445 
5446 Version 1.6.20beta02 [November 23, 2015]
5447   Fixed incorrect implementation of png_set_PLTE() that uses png_ptr
5448     not info_ptr, that left png_set_PLTE() open to the CVE-2015-8126
5449     vulnerability.
5450 
5451 Version 1.6.20beta03 [November 24, 2015]
5452   Backported tests from libpng-1.7.0beta69.
5453 
5454 Version 1.6.20rc01 [November 26, 2015]
5455   Fixed an error in handling of bad zlib CMINFO field in pngfix, found by
5456     American Fuzzy Lop, reported by Brian Carpenter.  inflate() doesn't
5457     immediately fault a bad CMINFO field; instead a 'too far back' error
5458     happens later (at least some times).  pngfix failed to limit CMINFO to
5459     the allowed values but then assumed that window_bits was in range,
5460     triggering an assert. The bug is mostly harmless; the PNG file cannot
5461     be fixed.
5462 
5463 Version 1.6.20rc02 [November 29, 2015]
5464   In libpng 1.6 zlib initialization was changed to use the window size
5465     in the zlib stream, not a fixed value. This causes some invalid images,
5466     where CINFO is too large, to display 'correctly' if the rest of the
5467     data is valid.  This provides a workaround for zlib versions where the
5468     error arises (ones that support the API change to use the window size
5469     in the stream).
5470 
5471 Version 1.6.20 [December 3, 2015]
5472   No changes.
5473 
5474 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
5475 (subscription required; visit
5476 https://lists.sourceforge.net/lists/listinfo/png-mng-implement
5477 to subscribe)
5478 or to glennrp at users.sourceforge.net
5479 
5480 Glenn R-P
5481 #endif