[libpng16] Imported from libpng-1.6.11beta01.tar
diff --git a/INSTALL b/INSTALL
index 8e42354..781f760 100644
--- a/INSTALL
+++ b/INSTALL
@@ -12,10 +12,10 @@
  VII. Building with makefiles
 VIII. Configuring libpng for 16-bit platforms
   IX. Configuring for DOS
-  X. Configuring for Medium Model
+   X. Configuring for Medium Model
   XI. Prepending a prefix to exported symbols
  XII. Configuring for compiler xxx:
-XIII Removing unwanted object code
+XIII. Removing unwanted object code
  XIV. Changes to the build and configuration of libpng in libpng-1.5.x
   XV. Configuring libpng for multiprocessing
  XVI. Other sources of information about libpng:
diff --git a/LICENSE b/LICENSE
index 2d2e033..b4365cd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -10,7 +10,7 @@
 
 This code is released under the libpng license.
 
-libpng versions 1.2.6, August 15, 2004, through 1.6.11beta01, March 7, 2014, are
+libpng versions 1.2.6, August 15, 2004, through 1.6.11beta01, March 17, 2014, are
 Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are
 distributed according to the same disclaimer and license as libpng-1.2.5
 with the following individual added to the list of Contributing Authors
@@ -108,4 +108,4 @@
 
 Glenn Randers-Pehrson
 glennrp at users.sourceforge.net
-March 7, 2014
+March 17, 2014
diff --git a/README b/README
index 2902819..ffc518c 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-README for libpng version 1.6.11beta01 - March 7, 2014 (shared library 16.0)
+README for libpng version 1.6.11beta01 - March 17, 2014 (shared library 16.0)
 See the note about version numbers near the top of png.h
 
 See INSTALL for instructions on how to install libpng.
diff --git a/TODO b/TODO
index 63613b8..7263377 100644
--- a/TODO
+++ b/TODO
@@ -6,6 +6,7 @@
 Fix problem with C++ and EXTERN "C".
 cHRM transformation.
 Remove setjmp/longjmp usage in favor of returning error codes.
+Palette creation.
 Add "grayscale->palette" transformation and "palette->grayscale" detection.
 Improved dithering.
 Multi-lingual error and warning message support.
diff --git a/arm/arm_init.c b/arm/arm_init.c
index 5800530..a672eae 100644
--- a/arm/arm_init.c
+++ b/arm/arm_init.c
@@ -22,7 +22,7 @@
 /* WARNING: it is strongly recommended that you do not build libpng with
  * run-time checks for CPU features if at all possible.  In the case of the ARM
  * NEON instructions there is no processor-specific way of detecting the
- * presense of the required support, therefore run-time detectioon is extremely
+ * presence of the required support, therefore run-time detection is extremely
  * OS specific.
  *
  * You may set the macro PNG_ARM_NEON_FILE to the file name of file containing
diff --git a/libpngpf.3 b/libpngpf.3
index c45061b..ee0f020 100644
--- a/libpngpf.3
+++ b/libpngpf.3
@@ -1,4 +1,4 @@
-.TH LIBPNGPF 3 "March 7, 2014"
+.TH LIBPNGPF 3 "March 17, 2014"
 .SH NAME
 libpng \- Portable Network Graphics (PNG) Reference Library 1.6.11beta01
 (private functions)
diff --git a/png.5 b/png.5
index e461b6d..f0157e4 100644
--- a/png.5
+++ b/png.5
@@ -1,4 +1,4 @@
-.TH PNG 5 "March 7, 2014"
+.TH PNG 5 "March 17, 2014"
 .SH NAME
 png \- Portable Network Graphics (PNG) format
 .SH DESCRIPTION
diff --git a/png.c b/png.c
index c8dc69b..b8a78a9 100644
--- a/png.c
+++ b/png.c
@@ -773,13 +773,13 @@
 #else
 #  ifdef __STDC__
    return PNG_STRING_NEWLINE \
-     "libpng version 1.6.11beta01 - March 8, 2014" PNG_STRING_NEWLINE \
+     "libpng version 1.6.11beta01 - March 17, 2014" PNG_STRING_NEWLINE \
      "Copyright (c) 1998-2014 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
      "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
      "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
      PNG_STRING_NEWLINE;
 #  else
-      return "libpng version 1.6.11beta01 - March 8, 2014\
+      return "libpng version 1.6.11beta01 - March 17, 2014\
       Copyright (c) 1998-2014 Glenn Randers-Pehrson\
       Copyright (c) 1996-1997 Andreas Dilger\
       Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
diff --git a/png.h b/png.h
index ef94f1f..0012961 100644
--- a/png.h
+++ b/png.h
@@ -1,7 +1,7 @@
 
 /* png.h - header file for PNG reference library
  *
- * libpng version 1.6.11beta01 - March 7, 2014
+ * libpng version 1.6.11beta01 - March 17, 2014
  * Copyright (c) 1998-2014 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -11,7 +11,7 @@
  * Authors and maintainers:
  *   libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
  *   libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
- *   libpng versions 0.97, January 1998, through 1.6.11beta01 - March 7, 2014: Glenn
+ *   libpng versions 0.97, January 1998, through 1.6.11beta01 - March 17, 2014: Glenn
  *   See also "Contributing Authors", below.
  *
  * Note about libpng version numbers:
@@ -227,7 +227,7 @@
  *
  * This code is released under the libpng license.
  *
- * libpng versions 1.2.6, August 15, 2004, through 1.6.11beta01, March 7, 2014, are
+ * libpng versions 1.2.6, August 15, 2004, through 1.6.11beta01, March 17, 2014, are
  * Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
  * distributed according to the same disclaimer and license as libpng-1.2.5
  * with the following individual added to the list of Contributing Authors:
@@ -339,7 +339,7 @@
  * Y2K compliance in libpng:
  * =========================
  *
- *    March 7, 2014
+ *    March 17, 2014
  *
  *    Since the PNG Development group is an ad-hoc body, we can't make
  *    an official declaration.
@@ -398,7 +398,9 @@
 /* This is not the place to learn how to use libpng. The file libpng-manual.txt
  * describes how to use libpng, and the file example.c summarizes it
  * with some code on which to build.  This file is useful for looking
- * at the actual function definitions and structure components.
+ * at the actual function definitions and structure components.  If that
+ * file has been stripped from your copy of libpng, you can find it at
+ * <http://www.libpng.org/pub/png/libpng-manual.txt>
  *
  * If you just need to read a PNG file and don't want to read the documentation
  * skip to the end of this file and read the section entitled 'simplified API'.
@@ -407,7 +409,7 @@
 /* Version information for png.h - this should match the version in png.c */
 #define PNG_LIBPNG_VER_STRING "1.6.11beta01"
 #define PNG_HEADER_VERSION_STRING \
-     " libpng version 1.6.11beta01 - March 7, 2014\n"
+     " libpng version 1.6.11beta01 - March 17, 2014\n"
 
 #define PNG_LIBPNG_VER_SONUM   16
 #define PNG_LIBPNG_VER_DLLNUM  16
diff --git a/pngconf.h b/pngconf.h
index e638406..97d6cef 100644
--- a/pngconf.h
+++ b/pngconf.h
@@ -1,7 +1,7 @@
 
 /* pngconf.h - machine configurable file for libpng
  *
- * libpng version 1.6.11beta01 - March 7, 2014
+ * libpng version 1.6.11beta01 - March 17, 2014
  *
  * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngread.c b/pngread.c
index 10d8389..32043ca 100644
--- a/pngread.c
+++ b/pngread.c
@@ -3317,11 +3317,11 @@
  * PNG_COMPOSITE
  * PNG_GAMMA
  *
- * This is a work-round for the fact that both the PNG_RGB_TO_GRAY and
+ * This is a work-around for the fact that both the PNG_RGB_TO_GRAY and
  * PNG_COMPOSITE code performs gamma correction, so we get double gamma
- * correction.  The fix-up is to prevent the PNG_COMPOSITE operation happening
- * inside libpng, so this routine sees an 8 or 16-bit gray+alpha row and handles
- * the removal or pre-multiplication of the alpha channel.
+ * correction.  The fix-up is to prevent the PNG_COMPOSITE operation from
+ * happening inside libpng, so this routine sees an 8 or 16-bit gray+alpha
+ * row and handles the removal or pre-multiplication of the alpha channel.
  */
 static int
 png_image_read_background(png_voidp argument)
diff --git a/pngwrite.c b/pngwrite.c
index 2718dfc..73ff601 100644
--- a/pngwrite.c
+++ b/pngwrite.c
@@ -432,6 +432,7 @@
 
    /* Write end of PNG file */
    png_write_IEND(png_ptr);
+
    /* This flush, added in libpng-1.0.8, removed from libpng-1.0.9beta03,
     * and restored again in libpng-1.2.30, may cause some applications that
     * do not set png_ptr->output_flush_fn to crash.  If your application
@@ -479,7 +480,7 @@
 {
 #ifndef PNG_USER_MEM_SUPPORTED
    png_structrp png_ptr = png_create_png_struct(user_png_ver, error_ptr,
-      error_fn, warn_fn, NULL, NULL, NULL);
+       error_fn, warn_fn, NULL, NULL, NULL);
 #else
    return png_create_write_struct_2(user_png_ver, error_ptr, error_fn,
        warn_fn, NULL, NULL, NULL);
@@ -492,7 +493,7 @@
     png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED)
 {
    png_structrp png_ptr = png_create_png_struct(user_png_ver, error_ptr,
-      error_fn, warn_fn, mem_ptr, malloc_fn, free_fn);
+       error_fn, warn_fn, mem_ptr, malloc_fn, free_fn);
 #endif /* PNG_USER_MEM_SUPPORTED */
    if (png_ptr != NULL)
    {
@@ -525,10 +526,10 @@
        * applications that must not fail to write at all costs!
        */
 #ifdef PNG_BENIGN_WRITE_ERRORS_SUPPORTED
-      png_ptr->flags |= PNG_FLAG_BENIGN_ERRORS_WARN;
       /* In stable builds only warn if an application error can be completely
        * handled.
        */
+      png_ptr->flags |= PNG_FLAG_BENIGN_ERRORS_WARN;
 #endif
 
       /* App warnings are warnings in release (or release candidate) builds but
diff --git a/projects/vstudio/readme.txt b/projects/vstudio/readme.txt
index dd2b2f2..5a16a51 100644
--- a/projects/vstudio/readme.txt
+++ b/projects/vstudio/readme.txt
@@ -1,7 +1,7 @@
 
 VisualStudio instructions
 
-libpng version 1.6.11beta01 - March 7, 2014
+libpng version 1.6.11beta01 - March 17, 2014
 
 Copyright (c) 1998-2010 Glenn Randers-Pehrson
 
diff --git a/projects/vstudio/zlib.props b/projects/vstudio/zlib.props
index 949a42a..e347099 100644
--- a/projects/vstudio/zlib.props
+++ b/projects/vstudio/zlib.props
@@ -2,7 +2,7 @@
 <!--
  * zlib.props - location of zlib source
  *
- * libpng version 1.6.11beta01 - March 9, 2014
+ * libpng version 1.6.11beta01 - March 17, 2014
  *
  * Copyright (c) 1998-2011 Glenn Randers-Pehrson
  *
diff --git a/scripts/README.txt b/scripts/README.txt
index 785cbc9..005b403 100644
--- a/scripts/README.txt
+++ b/scripts/README.txt
@@ -1,5 +1,5 @@
 
-Makefiles for  libpng version 1.6.11beta01 - March 7, 2014
+Makefiles for  libpng version 1.6.11beta01 - March 17, 2014
 
 pnglibconf.h.prebuilt       =>  Stores configuration settings
  makefile.linux    =>  Linux/ELF makefile
diff --git a/scripts/pnglibconf.h.prebuilt b/scripts/pnglibconf.h.prebuilt
index d2b881f..3f7415f 100644
--- a/scripts/pnglibconf.h.prebuilt
+++ b/scripts/pnglibconf.h.prebuilt
@@ -2,7 +2,7 @@
 
 /* pnglibconf.h - library build configuration */
 
-/* Libpng version 1.6.11beta01 - March 7, 2014 */
+/* Libpng version 1.6.11beta01 - March 17, 2014 */
 
 /* Copyright (c) 1998-2013 Glenn Randers-Pehrson */