summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2012-02-21 14:22:01 -0600
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2012-02-21 14:22:01 -0600
commit8a2033d77f2b236d34dcbae9aecae06a6f049e4d (patch)
tree941fcbea38e8d7cb41a833b72e868b4a4e4bee6b
parent932d7ac5e9802a1619ac27317162634caf077975 (diff)
downloadlibpng-8a2033d77f2b236d34dcbae9aecae06a6f049e4d.tar.gz
[libpng15] Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from
pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c; now that png_ptr->buffer is inaccessible to applications, the special handling is no longer useful. Fixed bug with png_handle_hIST with odd chunk length (Frank Busse).
-rw-r--r--ANNOUNCE5
-rw-r--r--CHANGES5
-rw-r--r--pngrutil.c10
3 files changed, 15 insertions, 5 deletions
diff --git a/ANNOUNCE b/ANNOUNCE
index 978897a7e..551aa275c 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -30,6 +30,11 @@ Version 1.5.10beta01 [February 21, 2012]
Removed two useless #ifdef directives from pngread.c and one from pngrutil.c
Always put the CMAKE_LIBRARY in "lib" (removed special WIN32 case).
Removed empty vstudio/pngstest directory (Clifford Yapp).
+ Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from
+ pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c;
+ now that png_ptr->buffer is inaccessible to applications, the special
+ handling is no longer useful.
+ Fixed bug with png_handle_hIST with odd chunk length (Frank Busse).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit
diff --git a/CHANGES b/CHANGES
index ea36dd989..4058701e3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3814,6 +3814,11 @@ Version 1.5.10beta01 [February 21, 2012]
Removed two useless #ifdef directives from pngread.c and one from pngrutil.c
Always put the CMAKE_LIBRARY in "lib" (removed special WIN32 case).
Removed empty vstudio/pngstest directory (Clifford Yapp).
+ Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from
+ pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c;
+ now that png_ptr->buffer is inaccessible to applications, the special
+ handling is no longer useful.
+ Fixed bug with png_handle_hIST with odd chunk length (Frank Busse).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
diff --git a/pngrutil.c b/pngrutil.c
index 1a6250340..74822a92b 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -1,7 +1,7 @@
/* pngrutil.c - utilities to read a PNG file
*
- * Last changed in libpng 1.5.9 [(PENDING RELEASE)]
+ * Last changed in libpng 1.5.10 [(PENDING RELEASE)]
* Copyright (c) 1998-2012 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.)
@@ -1793,16 +1793,16 @@ png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
return;
}
- num = length / 2 ;
-
- if (num != (unsigned int)png_ptr->num_palette || num >
- (unsigned int)PNG_MAX_PALETTE_LENGTH)
+ if (length > 2*PNG_MAX_PALETTE_LENGTH ||
+ length != (unsigned int) (2*png_ptr->num_palette))
{
png_warning(png_ptr, "Incorrect hIST chunk length");
png_crc_finish(png_ptr, length);
return;
}
+ num = length / 2 ;
+
for (i = 0; i < num; i++)
{
png_byte buf[2];