[libpng17] Allow calling png_get_IHDR() with NULL arguments (Reuben Hawkins).
diff --git a/ANNOUNCE b/ANNOUNCE
index e2ccc21..c9ee0da 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,5 @@
 
-Libpng 1.7.0beta46 - January 1, 2015
+Libpng 1.7.0beta46 - January 2, 2015
 
 This is not intended to be a public release.  It will be replaced
 within a few weeks by a public version or by another test version.
@@ -681,10 +681,11 @@
     png_read_row to skip the unnecessary row de-interlace stuff.
   Added testing of png_set_packing() to pngvalid.c
 
-Version 1.7.0beta46 [January 1, 2015]
+Version 1.7.0beta46 [January 2, 2015]
   Regenerated configure scripts in the tar distributions with libtool-2.4.4
   Implement previously untested cases of libpng transforms in pngvalid.c
   Fixed byte order in 2-byte filler, in png_do_read_filler().
+  Allow user to call png_get_IHDR() with NULL arguments (Reuben Hawkins).
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
diff --git a/CHANGES b/CHANGES
index 28b58b7..bb546b4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4970,10 +4970,11 @@
     png_read_row to skip the unnecessary row de-interlace stuff.
   Added testing of png_set_packing() to pngvalid.c
 
-Version 1.7.0beta46 [January 1, 2015]
+Version 1.7.0beta46 [January 2, 2015]
   Regenerated configure scripts in the tar distributions with libtool-2.4.4
   Implement previously untested cases of libpng transforms in pngvalid.c
   Fixed byte order in 2-byte filler, in png_do_read_filler().
+  Allow user to call png_get_IHDR() with NULL arguments (Reuben Hawkins).
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
diff --git a/libpng-manual.txt b/libpng-manual.txt
index 06f6717..fb5ab50 100644
--- a/libpng-manual.txt
+++ b/libpng-manual.txt
@@ -1,6 +1,6 @@
 libpng-manual.txt - A description on how to use and modify libpng
 
- libpng version 1.7.0beta46 - January 1, 2015
+ libpng version 1.7.0beta46 - January 2, 2015
  Updated and distributed by Glenn Randers-Pehrson
  <glennrp at users.sourceforge.net>
  Copyright (c) 1998-2015 Glenn Randers-Pehrson
@@ -11,7 +11,7 @@
 
  Based on:
 
- libpng versions 0.97, January 1998, through 1.7.0beta46 - January 1, 2015
+ libpng versions 0.97, January 1998, through 1.7.0beta46 - January 2, 2015
  Updated and distributed by Glenn Randers-Pehrson
  Copyright (c) 1998-2015 Glenn Randers-Pehrson
 
@@ -1266,16 +1266,17 @@
                      the PNG datastream is embedded in
                      a MNG-1.0 datastream)
 
-    Any or all of interlace_type, compression_type, or
-    filter_method can be NULL if you are
-    not interested in their values.
+    Any or all of color_tye, bit_depth, interlace_type,
+    compression_type, or filter_method can be NULL if you
+    are not interested in their values.
 
-    Note that png_get_IHDR() returns 32-bit data into
+    Note that png_get_IHDR() returns png_uint_32 data into
     the application's width and height variables.
     This is an unsafe situation if these are 16-bit
-    variables.  In such situations, the
-    png_get_image_width() and png_get_image_height()
-    functions described below are safer.
+    variables, or if they are 32-bit variables on a 64-bit
+    platform.  In such situations, the png_get_image_width()
+    and png_get_image_height() functions described below are
+    safer.
 
     width            = png_get_image_width(png_ptr,
                          info_ptr);
@@ -5320,7 +5321,7 @@
 
 XVII. Y2K Compliance in libpng
 
-January 1, 2015
+January 2, 2015
 
 Since the PNG Development group is an ad-hoc body, we can't make
 an official declaration.
diff --git a/libpng.3 b/libpng.3
index 4e62633..a0eb43a 100644
--- a/libpng.3
+++ b/libpng.3
@@ -1,4 +1,4 @@
-.TH LIBPNG 3 "January 1, 2015"
+.TH LIBPNG 3 "January 2, 2015"
 .SH NAME
 libpng \- Portable Network Graphics (PNG) Reference Library 1.7.0beta46
 .SH SYNOPSIS
@@ -494,7 +494,7 @@
 .SH LIBPNG.TXT
 libpng-manual.txt - A description on how to use and modify libpng
 
- libpng version 1.7.0beta46 - January 1, 2015
+ libpng version 1.7.0beta46 - January 2, 2015
  Updated and distributed by Glenn Randers-Pehrson
  <glennrp at users.sourceforge.net>
  Copyright (c) 1998-2015 Glenn Randers-Pehrson
@@ -505,7 +505,7 @@
 
  Based on:
 
- libpng versions 0.97, January 1998, through 1.7.0beta46 - January 1, 2015
+ libpng versions 0.97, January 1998, through 1.7.0beta46 - January 2, 2015
  Updated and distributed by Glenn Randers-Pehrson
  Copyright (c) 1998-2015 Glenn Randers-Pehrson
 
@@ -1760,16 +1760,17 @@
                      the PNG datastream is embedded in
                      a MNG-1.0 datastream)
 
-    Any or all of interlace_type, compression_type, or
-    filter_method can be NULL if you are
-    not interested in their values.
+    Any or all of color_tye, bit_depth, interlace_type,
+    compression_type, or filter_method can be NULL if you
+    are not interested in their values.
 
-    Note that png_get_IHDR() returns 32-bit data into
+    Note that png_get_IHDR() returns png_uint_32 data into
     the application's width and height variables.
     This is an unsafe situation if these are 16-bit
-    variables.  In such situations, the
-    png_get_image_width() and png_get_image_height()
-    functions described below are safer.
+    variables, or if they are 32-bit variables on a 64-bit
+    platform.  In such situations, the png_get_image_width()
+    and png_get_image_height() functions described below are
+    safer.
 
     width            = png_get_image_width(png_ptr,
                          info_ptr);
@@ -5814,7 +5815,7 @@
 
 .SH XVII. Y2K Compliance in libpng
 
-January 1, 2015
+January 2, 2015
 
 Since the PNG Development group is an ad-hoc body, we can't make
 an official declaration.
@@ -6084,7 +6085,7 @@
 
 Thanks to Frank J. T. Wojcik for helping with the documentation.
 
-Libpng version 1.7.0beta46 - January 1, 2015:
+Libpng version 1.7.0beta46 - January 2, 2015:
 Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
 Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
 
@@ -6107,7 +6108,7 @@
 
 This code is released under the libpng license.
 
-libpng versions 1.2.6, August 15, 2004, through 1.7.0beta46, January 1, 2015, are
+libpng versions 1.2.6, August 15, 2004, through 1.7.0beta46, January 2, 2015, are
 Copyright (c) 2004,2006-2007 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
@@ -6206,7 +6207,7 @@
 
 Glenn Randers-Pehrson
 glennrp at users.sourceforge.net
-January 1, 2015
+January 2, 2015
 
 .\" end of man page
 
diff --git a/pngget.c b/pngget.c
index 133d542..a1bd5a0 100644
--- a/pngget.c
+++ b/pngget.c
@@ -799,14 +799,20 @@
 {
    png_debug1(1, "in %s retrieval function", "IHDR");
 
-   if (png_ptr == NULL || info_ptr == NULL || width == NULL ||
-       height == NULL || bit_depth == NULL || color_type == NULL)
+   if (png_ptr == NULL || info_ptr == NULL)
       return (0);
 
-   *width = info_ptr->width;
-   *height = info_ptr->height;
-   *bit_depth = info_ptr->bit_depth;
-   *color_type = info_ptr->color_type;
+   if (width != NULL)
+       *width = info_ptr->width;
+
+   if (height != NULL)
+       *height = info_ptr->height;
+
+   if (bit_depth != NULL)
+       *bit_depth = info_ptr->bit_depth;
+
+   if (color_type != NULL)
+       *color_type = info_ptr->color_type;
 
    if (compression_type != NULL)
       *compression_type = info_ptr->compression_type;