[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).
This commit is contained in:
Glenn Randers-Pehrson
2012-02-21 14:22:01 -06:00
parent 932d7ac5e9
commit 8a2033d77f
3 changed files with 15 additions and 5 deletions

View File

@@ -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];