From 0448d90f01415810d5c678c87561e4f521a5258b Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Mon, 9 Mar 2015 09:04:02 -0500 Subject: [PATCH] [libpng17] Merged png_free_data() with libpng-1.6.17rc02. --- ANNOUNCE | 6 ++++-- CHANGES | 4 +++- libpng-manual.txt | 10 +++++++--- libpng.3 | 18 +++++++++++------- png.c | 38 ++++++++++++++++---------------------- 5 files changed, 41 insertions(+), 35 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 849cd8eb3..a893dbd53 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.7.0beta55 - March 8, 2015 +Libpng 1.7.0beta55 - March 9, 2015 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. @@ -739,10 +739,12 @@ Version 1.7.0beta54 [March 4, 2015] Visual Studio (Sergey Kosarevsky) Merged pngwrite.c with libpng-1.6.17beta06/pngwrite.c -Version 1.7.0beta55 [March 8, 2015] +Version 1.7.0beta55 [March 9, 2015] Removed some comments that the configure script did not handle properly from scripts/pnglibconf.dfa and pnglibconf.h.prebuilt. Spelling fixes ("then", "occured") reported by Lauri Nurmi. + Added more error reporting in png_default_read_data(). + Merged png_free_data() with libpng-1.6.17rc02. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 7de02cd5b..1b24cf46a 100644 --- a/CHANGES +++ b/CHANGES @@ -5029,10 +5029,12 @@ Version 1.7.0beta54 [March 4, 2015] Visual Studio (Sergey Kosarevsky) Merged pngwrite.c with libpng-1.6.17beta06/pngwrite.c -Version 1.7.0beta55 [March 8, 2015] +Version 1.7.0beta55 [March 9, 2015] Removed some comments that the configure script did not handle properly from scripts/pnglibconf.dfa and pnglibconf.h.prebuilt. Spelling fixes ("then", "occured") reported by Lauri Nurmi. + Added more error reporting in png_default_read_data(). + Merged png_free_data() with libpng-1.6.17rc02. 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 892c294e5..cec1c89fc 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.7.0beta55 - March 7, 2015 + libpng version 1.7.0beta55 - March 9, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.7.0beta55 - March 7, 2015 + libpng versions 0.97, January 1998, through 1.7.0beta55 - March 9, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -5040,6 +5040,10 @@ The signatures of many exported functions were changed, such that png_infop became png_inforp or png_const_inforp where "rp" indicates a "restricted pointer". +The support for FAR/far types has been eliminated and the definition of +png_alloc_size_t is now controlled by a flag so that 'small size_t' systems +can select it if necessary. + Error detection in some chunks has improved; in particular the iCCP chunk reader now does pretty complete validation of the basic format. Some bad profiles that were previously accepted are now accepted with a warning or @@ -5332,7 +5336,7 @@ Other rules can be inferred by inspecting the libpng source. XVII. Y2K Compliance in libpng -March 7, 2015 +March 9, 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 3e80ff8e4..349e9ffb6 100644 --- a/libpng.3 +++ b/libpng.3 @@ -1,4 +1,4 @@ -.TH LIBPNG 3 "March 7, 2015" +.TH LIBPNG 3 "March 9, 2015" .SH NAME libpng \- Portable Network Graphics (PNG) Reference Library 1.7.0beta55 .SH SYNOPSIS @@ -494,7 +494,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng. .SH LIBPNG.TXT libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.7.0beta55 - March 7, 2015 + libpng version 1.7.0beta55 - March 9, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -505,7 +505,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.7.0beta55 - March 7, 2015 + libpng versions 0.97, January 1998, through 1.7.0beta55 - March 9, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -5534,6 +5534,10 @@ The signatures of many exported functions were changed, such that png_infop became png_inforp or png_const_inforp where "rp" indicates a "restricted pointer". +The support for FAR/far types has been eliminated and the definition of +png_alloc_size_t is now controlled by a flag so that 'small size_t' systems +can select it if necessary. + Error detection in some chunks has improved; in particular the iCCP chunk reader now does pretty complete validation of the basic format. Some bad profiles that were previously accepted are now accepted with a warning or @@ -5826,7 +5830,7 @@ Other rules can be inferred by inspecting the libpng source. .SH XVII. Y2K Compliance in libpng -March 7, 2015 +March 9, 2015 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. @@ -6143,7 +6147,7 @@ possible without all of you. Thanks to Frank J. T. Wojcik for helping with the documentation. -Libpng version 1.7.0beta55 - March 7, 2015: +Libpng version 1.7.0beta55 - March 9, 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). @@ -6166,7 +6170,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.7.0beta55, March 7, 2015, are +libpng versions 1.2.6, August 15, 2004, through 1.7.0beta55, March 9, 2015, are Copyright (c) 2004,2006-2007 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 @@ -6265,7 +6269,7 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -March 7, 2015 +March 9, 2015 .\" end of man page diff --git a/png.c b/png.c index ef01f078e..d4597e418 100644 --- a/png.c +++ b/png.c @@ -492,20 +492,17 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, else { - if (info_ptr->splt_palettes_num != 0) + int i; + + for (i = 0; i < info_ptr->splt_palettes_num; i++) { - int i; - - for (i = 0; i < info_ptr->splt_palettes_num; i++) - { - png_free(png_ptr, info_ptr->splt_palettes[i].name); - png_free(png_ptr, info_ptr->splt_palettes[i].entries); - } - - png_free(png_ptr, info_ptr->splt_palettes); - info_ptr->splt_palettes = NULL; - info_ptr->splt_palettes_num = 0; + png_free(png_ptr, info_ptr->splt_palettes[i].name); + png_free(png_ptr, info_ptr->splt_palettes[i].entries); } + + png_free(png_ptr, info_ptr->splt_palettes); + info_ptr->splt_palettes = NULL; + info_ptr->splt_palettes_num = 0; info_ptr->valid &= ~PNG_INFO_sPLT; } } @@ -525,15 +522,12 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, { int i; - if (info_ptr->unknown_chunks_num != 0) - { - for (i = 0; i < info_ptr->unknown_chunks_num; i++) - png_free(png_ptr, info_ptr->unknown_chunks[i].data); + for (i = 0; i < info_ptr->unknown_chunks_num; i++) + png_free(png_ptr, info_ptr->unknown_chunks[i].data); - png_free(png_ptr, info_ptr->unknown_chunks); - info_ptr->unknown_chunks = NULL; - info_ptr->unknown_chunks_num = 0; - } + png_free(png_ptr, info_ptr->unknown_chunks); + info_ptr->unknown_chunks = NULL; + info_ptr->unknown_chunks_num = 0; } } #endif @@ -694,13 +688,13 @@ png_get_copyright(png_const_structrp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.7.0beta55 - March 7, 2015" PNG_STRING_NEWLINE \ + "libpng version 1.7.0beta55 - March 9, 2015" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2015 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.0beta55 - March 7, 2015\ + return "libpng version 1.7.0beta55 - March 9, 2015\ Copyright (c) 1998-2015 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";