Update libpng from 1.6.3 to 1.6.10

Change-Id: I76e81e7fd267d15991cd342c5caeb2fe77964ebf
diff --git a/ANNOUNCE b/ANNOUNCE
index 07d5bcc..9f19880 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,5 @@
 
-Libpng 1.6.3 - July 18, 2013
+Libpng 1.6.10 - March 6, 2014
 
 This is a public release of libpng, intended for use in production codes.
 
@@ -8,106 +8,80 @@
 Source files with LF line endings (for Unix/Linux) and with a
 "configure" script
 
-   libpng-1.6.3.tar.xz (LZMA-compressed, recommended)
-   libpng-1.6.3.tar.gz
+   libpng-1.6.10.tar.xz (LZMA-compressed, recommended)
+   libpng-1.6.10.tar.gz
 
 Source files with CRLF line endings (for Windows), without the
 "configure" script
 
-   lpng163.7z  (LZMA-compressed, recommended)
-   lpng163.zip
+   lpng1610.7z  (LZMA-compressed, recommended)
+   lpng1610.zip
 
 Other information:
 
-   libpng-1.6.3-README.txt
-   libpng-1.6.3-LICENSE.txt
+   libpng-1.6.10-README.txt
+   libpng-1.6.10-LICENSE.txt
+   libpng-1.6.10-*.asc (armored detached GPG signatures)
 
-Changes since the last public release (1.6.2):
-
-  Revised stack marking in arm/filter_neon.S and configure.ac.
-  Ensure that NEON filter stuff is completely disabled when switched 'off'.
-    Previously the ARM NEON specific files were still built if the option
-    was switched 'off' as opposed to being explicitly disabled.
-  Test for 'arm*' not just 'arm' in the host_cpu configure variable.
-  Rebuilt the configure scripts.
-  Expanded manual paragraph about writing private chunks, particularly
-    the need to call png_set_keep_unknown_chunks() when writing them.
-  Avoid dereferencing NULL pointer possibly returned from
-     png_create_write_struct() (Andrew Church).
-  Calculate our own zlib windowBits when decoding rather than trusting the
-    CMF bytes in the PNG datastream.
-  Added an option to force maximum window size for inflating, which was
-    the behavior of libpng15 and earlier.
-  Added png-fix-itxt and png-fix-too-far-back to the built programs and
-    removed warnings from the source code and timepng that are revealed as
-    a result.
-  Detect wrong libpng versions linked to png-fix-too-far-back, which currently
-    only works with libpng versions that can be made to reliably fail when
-    the deflate data contains an out-of-window reference.  This means only
-    1.6 and later.
-  Fixed gnu issues: g++ needs a static_cast, gcc 4.4.7 has a broken warning
-    message which it is easier to work round than ignore.
-  Updated contrib/pngminus/pnm2png.c (Paul Stewart):
-    Check for EOF
-    Ignore "#" delimited comments in input file to pnm2png.c.
-    Fixed whitespace handling
-    Added a call to png_set_packing()
-    Initialize dimension values so if sscanf fails at least we have known
-      invalid values.
-  Attempt to detect configuration issues with png-fix-too-far-back, which
-    requires both the correct libpng and the correct zlib to function
-    correctly.
-  Check ZLIB_VERNUM for mismatches, enclose #error in quotes
-  Added information in the documentation about problems with and fixes for
-    the bad CRC and bad iTXt chunk situations.
-  Allow contrib/pngminus/pnm2png.c to compile without WRITE_INVERT and
-    WRITE_PACK supported (writes error message that it can't read P1 or
-  Improved png-fix-too-far-back usage message, added --suffix option.
-  Revised contrib/pngminim/*/makefile to generate pnglibconf.h with the
-    right zlib header files.
-  Separated CPPFLAGS and CFLAGS in contrib/pngminim/*/makefile
-  Removed a redundant test in png_set_IHDR().
-  Added set(CMAKE_CONFIGURATION_TYPES ...) to CMakeLists.txt (Andrew Hundt)
-  Deleted set(CMAKE_BUILD_TYPE) block from CMakeLists.txt
-  Enclose the prototypes for the simplified write API in
-    #ifdef PNG_STDIO_SUPPORTED/#endif
-  Make ARM NEON support work at compile time (not just configure time).
-    This moves the test on __ARM_NEON__ into pngconf.h to avoid issues when
-    using a compiler that compiles for multiple architectures at one time.
-  Removed PNG_FILTER_OPTIMIZATIONS and PNG_ARM_NEON_SUPPORTED from
-    pnglibconf.h, allowing more of the decisions to be made internally
-    (pngpriv.h) during the compile.  Without this, symbol prefixing is broken
-    under certain circumstances on ARM platforms.  Now only the API parts of
-    the optimizations ('check' vs 'api') are exposed in the public header files
-    except that the new setting PNG_ARM_NEON_OPT documents how libpng makes the
-    decision about whether or not to use the optimizations.
-  Protect symbol prefixing against CC/CPPFLAGS/CFLAGS useage.
-    Previous iOS/Xcode fixes for the ARM NEON optimizations moved the test
-    on __ARM_NEON__ from configure time to compile time.  This breaks symbol
-    prefixing because the definition of the special png_init_filter_functions
-    call was hidden at configure time if the relevant compiler arguments are
-    passed in CFLAGS as opposed to CC.  This change attempts to avoid all
-    the confusion that would result by declaring the init function even when
-    it is not used, so that it will always get prefixed.
-  Revised libpng.3 so that "doclifter" can process it.
-  Revised example.c to illustrate use of PNG_DEFAULT_sRGB and PNG_GAMMA_MAC_18
-    as parameters for png_set_gamma().  These have been available since
-    libpng-1.5.4.
-  Renamed contrib/tools/png-fix-too-far-back.c to pngfix.c and revised it
-    to check all compressed chunks known to libpng.
-  Updated documentation to show default behavior of benign errors correctly.
-  Only compile ARM code when PNG_READ_SUPPORTED is defined.
-  Fixed undefined behavior in contrib/tools/pngfix.c and added new strip
-    option. pngfix relied on undefined behavior and even a simple change from
-    gcc to g++ caused it to fail.  The new strip option 'unsafe' has been
-    implemented and is the default if --max is given.  Option names have
-    been clarified, with --strip=transform now stripping the bKGD chunk,
-    which was stripped previously with --strip=unused.
-  Added all documented chunk types to pngpriv.h
-  Unified pngfix.c source with libpng17.
-  Revised manual about changes in iTXt chunk handling made in libpng-1.6.0.
-  Added "/* SAFE */" comments in pngrutil.c and pngrtran.c where warnings
-    may be erroneously issued by code-checking applications.
+Changes since the last public release (1.6.9):
+  Backported changes from libpng-1.7.0beta30 and beta31:
+  Fixed a large number of instances where PNGCBAPI was omitted from
+    function definitions.
+  Added pngimage test program for png_read_png() and png_write_png()
+    with two new test scripts.
+  Removed dependence on !PNG_READ_EXPAND_SUPPORTED for calling
+    png_set_packing() in png_read_png().
+  Fixed combination of ~alpha with shift. On read invert alpha, processing
+    occurred after shift processing, which causes the final values to be
+    outside the range that should be produced by the shift. Reversing the
+    order on read makes the two transforms work together correctly and mirrors
+    the order used on write.
+  Do not read invalid sBIT chunks. Previously libpng only checked sBIT
+    values on write, so a malicious PNG writer could therefore cause
+    the read code to return an invalid sBIT chunk, which might lead to
+    application errors or crashes.  Such chunks are now skipped (with
+    chunk_benign_error).
+  Make png_read_png() and png_write_png() prototypes in png.h depend
+    upon PNG_READ_SUPPORTED and PNG_WRITE_SUPPORTED.
+  Support builds with unsupported PNG_TRANSFORM_* values.  All of the
+    PNG_TRANSFORM_* values are always defined in png.h and, because they
+    are used for both read and write in some cases, it is not reliable
+    to #if out ones that are totally unsupported. This change adds error
+    detection in png_read_image() and png_write_image() to do a
+    png_app_error() if the app requests something that cannot be done
+    and it adds corresponding code to pngimage.c to handle such options
+    by not attempting to test them.
+  Moved redefines of png_error(), png_warning(), png_chunk_error(),
+    and png_chunk_warning() from pngpriv.h to png.h to make them visible
+    to libpng-calling applications.
+  Moved OS dependent code from arm/arm_init.c, to allow the included
+    implementation of the ARM NEON discovery function to be set at
+    build-time and provide sample implementations from the current code in the
+    contrib/arm-neon subdirectory. The __linux__ code has also been changed to
+    compile and link on Android by using /proc/cpuinfo, and the old linux code
+    is in contrib/arm-neon/linux-auxv.c.  The new code avoids POSIX and Linux
+    dependencies apart from opening /proc/cpuinfo and is C90 compliant.
+  Check for info_ptr == NULL early in png_read_end() so we don't need to
+    run all the png_handle_*() and depend on them to return if info_ptr == NULL.
+    This improves the performance of png_read_end(png_ptr, NULL) and makes
+    it more robust against future programming errors.
+  Check for __has_extension before using it in pngconf.h, to
+    support older Clang versions (Jeremy Sequoia).
+  Treat CRC error handling with png_set_crc_action(), instead of with
+    png_set_benign_errors(), which has been the case since libpng-1.6.0beta18.
+  Use a user warning handler in contrib/gregbook/readpng2.c instead of default,
+    so warnings will be put on stderr even if libpng has CONSOLE_IO disabled.
+  Added png_ptr->process_mode = PNG_READ_IDAT_MODE in png_push_read_chunk
+    after recognizing the IDAT chunk, which avoids an infinite loop while
+    reading a datastream whose first IDAT chunk is of zero-length.
+    This fixes CERT VU#684412 and CVE-2014-0333.
+  Don't recognize known sRGB profiles as sRGB if they have been hacked,
+    but don't reject them and don't issue a copyright violation warning.
+  Moved some documentation from png.h to libpng.3 and libpng-manual.txt
+  Minor editing of contrib/arm-neon/README and contrib/examples/*.c
+  Fixed typos in the manual and in scripts/pnglibconf.dfa (CFLAGS -> CPPFLAGS
+    and PNG_USR_CONFIG -> PNG_USER_CONFIG).
+  Un-deprecated png_data_freer().
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
@@ -116,3 +90,4 @@
 or to glennrp at users.sourceforge.net
 
 Glenn R-P
+#endif