[libpng17] Exposed PNG chunk types in png.h, modified png_uint_32 macros/code

to make as few assumptions as possible
This commit is contained in:
John Bowler
2013-04-19 07:06:02 -05:00
committed by Glenn Randers-Pehrson
parent 57d6907d89
commit 0bcf5fb451
7 changed files with 229 additions and 207 deletions

8
png.c
View File

@@ -115,7 +115,7 @@ png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, png_size_t length)
{
int need_crc = 1;
if (PNG_CHUNK_ANCILLIARY(png_ptr->chunk_name))
if (PNG_CHUNK_ANCILLARY(png_ptr->chunk_name))
{
if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) ==
(PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN))
@@ -691,13 +691,13 @@ png_get_copyright(png_const_structrp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
"libpng version 1.7.0beta09 - April 18, 2013" PNG_STRING_NEWLINE \
"libpng version 1.7.0beta09 - April 19, 2013" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2013 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
# else
return "libpng version 1.7.0beta09 - April 18, 2013\
return "libpng version 1.7.0beta09 - April 19, 2013\
Copyright (c) 1998-2013 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@@ -1774,7 +1774,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace,
"length does not match profile");
temp = png_get_uint_32(profile+128); /* tag count: 12 bytes/tag */
if (temp > 357913930 || /* (2^32-4-132)/12: maxium possible tag count */
if (temp > 357913930 || /* (2^32-4-132)/12: maximum possible tag count */
profile_length < 132+12*temp) /* truncated tag table */
return png_icc_profile_error(png_ptr, colorspace, name, temp,
"tag count too large");