[libpng16]Allow calling png_get_IHDR() with NULL arguments (Reuben Hawkins).
diff --git a/ANNOUNCE b/ANNOUNCE
index db35203..4b57083 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -53,6 +53,7 @@
Version 1.6.17beta04 [February 18, 2015]
Added PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED macro, on by default.
+ 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 6635645..4fd01ab 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5154,6 +5154,7 @@
Version 1.6.17beta04 [February 18, 2015]
Added PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED macro, on by default.
+ 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 f35ae3a..af8301c 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.6.17beta04 - February 17, 2015
+ libpng version 1.6.17beta04 - February 18, 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.6.17beta04 - February 17, 2015
+ libpng versions 0.97, January 1998, through 1.6.17beta04 - February 18, 2015
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2015 Glenn Randers-Pehrson
@@ -1265,13 +1265,13 @@
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 of width, height, color_type, 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
the application's width and height variables.
- This is an unsafe situation if these are 16-bit
+ This is an unsafe situation if these are not png_uint_32
variables. In such situations, the
png_get_image_width() and png_get_image_height()
functions described below are safer.
@@ -5046,7 +5046,7 @@
PNG_OPTION_ON);
#endif
-It's not a good idea to do this if you are using the new "simplified API",
+It's not a good idea to do this if you are using the "simplified API",
which needs to be able to recognize sRGB profiles conveyed via the iCCP
chunk.
@@ -5275,7 +5275,7 @@
XVI. Y2K Compliance in libpng
-February 17, 2015
+February 18, 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 3f45579..4a2dc64 100644
--- a/libpng.3
+++ b/libpng.3
@@ -1,4 +1,4 @@
-.TH LIBPNG 3 "February 17, 2015"
+.TH LIBPNG 3 "February 18, 2015"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.17beta04
.SH SYNOPSIS
@@ -504,7 +504,7 @@
.SH LIBPNG.TXT
libpng-manual.txt - A description on how to use and modify libpng
- libpng version 1.6.17beta04 - February 17, 2015
+ libpng version 1.6.17beta04 - February 18, 2015
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
Copyright (c) 1998-2015 Glenn Randers-Pehrson
@@ -515,7 +515,7 @@
Based on:
- libpng versions 0.97, January 1998, through 1.6.17beta04 - February 17, 2015
+ libpng versions 0.97, January 1998, through 1.6.17beta04 - February 18, 2015
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2015 Glenn Randers-Pehrson
@@ -1769,13 +1769,13 @@
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 of width, height, color_type, 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
the application's width and height variables.
- This is an unsafe situation if these are 16-bit
+ This is an unsafe situation if these are not png_uint_32
variables. In such situations, the
png_get_image_width() and png_get_image_height()
functions described below are safer.
@@ -5550,7 +5550,7 @@
PNG_OPTION_ON);
#endif
-It's not a good idea to do this if you are using the new "simplified API",
+It's not a good idea to do this if you are using the "simplified API",
which needs to be able to recognize sRGB profiles conveyed via the iCCP
chunk.
@@ -5779,7 +5779,7 @@
.SH XVI. Y2K Compliance in libpng
-February 17, 2015
+February 18, 2015
Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.
@@ -6094,7 +6094,7 @@
Thanks to Frank J. T. Wojcik for helping with the documentation.
-Libpng version 1.6.17beta04 - February 17, 2015:
+Libpng version 1.6.17beta04 - February 18, 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).
@@ -6117,7 +6117,7 @@
This code is released under the libpng license.
-libpng versions 1.2.6, August 15, 2004, through 1.6.17beta04, February 17, 2015, are
+libpng versions 1.2.6, August 15, 2004, through 1.6.17beta04, February 18, 2015, 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
@@ -6216,7 +6216,7 @@
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
-February 17, 2015
+February 18, 2015
.\" end of man page
diff --git a/pngget.c b/pngget.c
index 0f0d264..0a47f97 100644
--- a/pngget.c
+++ b/pngget.c
@@ -1,8 +1,8 @@
/* pngget.c - retrieval of values from info struct
*
- * Last changed in libpng 1.6.15 [November 20, 2014]
- * Copyright (c) 1998-2014 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.17 [(PENDING RELEASE)]
+ * Copyright (c) 1998-2015 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.)
*
@@ -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;