summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ANNOUNCE9
-rw-r--r--CHANGES7
-rw-r--r--pngget.c7
3 files changed, 17 insertions, 6 deletions
diff --git a/ANNOUNCE b/ANNOUNCE
index 6d3f11d28..46b5786aa 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,5 @@
-Libpng 1.5.7beta02 - November 4, 2011
+Libpng 1.5.7beta02 - November 5, 2011
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.
@@ -43,7 +43,12 @@ Version 1.5.7beta01 [November 4, 2011]
just the changes that definitely improve speed and remain simple.
The changes also slightly increase the clarity of the code.
-Version 1.5.7beta02 [November 4, 2011]
+Version 1.5.7beta02 [November 5, 2011]
+ Check compression_type parameter in png_get_iCCP and remove spurious
+ casts. The compression_type parameter is always assigned to, so must
+ be non-NULL. The cast of the profile length potentially truncated the
+ value unnecessarily on a 16-bit int system, so the cast of the (byte)
+ compression type to (int) is specified by ANSI-C anyway.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit
diff --git a/CHANGES b/CHANGES
index e8c79570b..9ee895027 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3686,7 +3686,12 @@ Version 1.5.7beta01 [November 4, 2011]
just the changes that definitely improve speed and remain simple.
The changes also slightly increase the clarity of the code.
-Version 1.5.7beta02 [November 4, 2011]
+Version 1.5.7beta02 [November 5, 2011]
+ Check compression_type parameter in png_get_iCCP and remove spurious
+ casts. The compression_type parameter is always assigned to, so must
+ be non-NULL. The cast of the profile length potentially truncated the
+ value unnecessarily on a 16-bit int system, so the cast of the (byte)
+ compression type to (int) is specified by ANSI-C anyway.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
diff --git a/pngget.c b/pngget.c
index 9f05ecffd..736282306 100644
--- a/pngget.c
+++ b/pngget.c
@@ -682,15 +682,16 @@ png_get_iCCP(png_const_structp png_ptr, png_const_infop info_ptr,
png_debug1(1, "in %s retrieval function", "iCCP");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP)
- && name != NULL && profile != NULL && proflen != NULL)
+ && name != NULL && compression_type != NULL && profile != NULL &&
+ proflen != NULL)
{
*name = info_ptr->iccp_name;
*profile = info_ptr->iccp_profile;
/* Compression_type is a dummy so the API won't have to change
* if we introduce multiple compression types later.
*/
- *proflen = (int)info_ptr->iccp_proflen;
- *compression_type = (int)info_ptr->iccp_compression;
+ *proflen = info_ptr->iccp_proflen;
+ *compression_type = info_ptr->iccp_compression;
return (PNG_INFO_iCCP);
}