diff --git a/ANNOUNCE b/ANNOUNCE index 165d20dd5..b811ddb9d 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.4.0beta89 - October 31, 2009 +Libpng 1.4.0beta89 - November 1, 2009 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. @@ -588,9 +588,11 @@ version 1.4.0beta88 [October 30, 2009] Revised libpng*.txt section about differences between 1.2.x and 1.4.0 because most of the new features have now been ported back to 1.2.41 -version 1.4.0beta89 [October 31, 2009] +version 1.4.0beta89 [November 1, 2009] More bugfixes and improvements to CMakeLists.txt (Philip Lowman) Removed a harmless extra png_set_invert_alpha() from pngwrite.c + Apply png_user_chunk_cache_max within png_decompress_chunk(). + Merged libpng-1.2.41.txt with libpng-1.4.0.txt where appropriate. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 3090a744b..141a0e36d 100644 --- a/CHANGES +++ b/CHANGES @@ -2274,9 +2274,11 @@ version 1.4.0beta88 [October 30, 2009] Revised libpng*.txt section about differences between 1.2.x and 1.4.0 because most of the new features have now been ported back to 1.2.41 -version 1.4.0beta89 [October 31, 2009] +version 1.4.0beta89 [November 1, 2009] More bugfixes and improvements to CMakeLists.txt (Philip Lowman) Removed a harmless extra png_set_invert_alpha() from pngwrite.c + Apply png_user_chunk_cache_max within png_decompress_chunk(). + Merged libpng-1.2.41.txt with libpng-1.4.0.txt where appropriate. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/libpng-1.4.0beta89.txt b/libpng-1.4.0beta89.txt index 1e6ab6a73..066fded72 100644 --- a/libpng-1.4.0beta89.txt +++ b/libpng-1.4.0beta89.txt @@ -1,6 +1,6 @@ libpng.txt - A description on how to use and modify libpng - libpng version 1.4.0beta89 - October 30, 2009 + libpng version 1.4.0beta89 - November 1, 2009 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2009 Glenn Randers-Pehrson @@ -11,7 +11,7 @@ libpng.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.4.0beta89 - October 30, 2009 + libpng versions 0.97, January 1998, through 1.4.0beta89 - November 1, 2009 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2009 Glenn Randers-Pehrson @@ -420,6 +420,9 @@ where 0x7fffffffL means unlimited. You can retrieve this limit with chunk_cache_max = png_get_chunk_cache_max(png_ptr); +This limit also applies to the number of buffers that can be allocated +by png_decompress_chunk(). + The high-level read interface At this point there are two ways to proceed; through the high-level @@ -692,6 +695,10 @@ into the info_ptr is returned for any complex types. string for unknown). text_ptr[i].lang_key - keyword in UTF-8 (empty string for unknown). + Note that the itxt_length, lang, and lang_key + members of the text_ptr structure only exist + when the library is built with iTXt chunk support. + num_text - number of comments (same as num_comments; you can put NULL here to avoid the duplication) @@ -1931,6 +1938,10 @@ width, height, bit_depth, and color_type must be the same in each call. empty for unknown). text_ptr[i].translated_keyword - keyword in UTF-8 (NULL or empty for unknown). + Note that the itxt_length, lang, and lang_key + members of the text_ptr structure only exist + when the library is built with iTXt chunk support. + num_text - number of comments png_set_sPLT(png_ptr, info_ptr, &palette_ptr, @@ -3214,7 +3225,7 @@ source. XIII. Y2K Compliance in libpng -October 30, 2009 +November 1, 2009 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. diff --git a/pngread.c b/pngread.c index 522e68969..75953d062 100644 --- a/pngread.c +++ b/pngread.c @@ -1,7 +1,7 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.4.0 [October 30, 2009] + * Last changed in libpng 1.4.0 [November 1, 2009] * Copyright (c) 1998-2009 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.) @@ -65,8 +65,10 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, /* Added at libpng-1.2.6 */ #ifdef PNG_SET_USER_LIMITS_SUPPORTED - png_ptr->user_width_max=PNG_USER_WIDTH_MAX; - png_ptr->user_height_max=PNG_USER_HEIGHT_MAX; + png_ptr->user_width_max = PNG_USER_WIDTH_MAX; + png_ptr->user_height_max = PNG_USER_HEIGHT_MAX; + /* Added at libpng-1.2.41 */ + png_ptr->user_chunk_cache_max = PNG_USER_CHUNK_CACHE_MAX; #endif #ifdef PNG_SETJMP_SUPPORTED diff --git a/pngrutil.c b/pngrutil.c index 0ed836d22..6fb99a593 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -1,7 +1,7 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.4.0 [October 30, 2009] + * Last changed in libpng 1.4.0 [November 1, 2009] * Copyright (c) 1998-2009 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.) @@ -286,9 +286,23 @@ png_decompress_chunk(png_structp png_ptr, int comp_type, png_charp tmp; tmp = text; - text = (png_charp)png_malloc_warn(png_ptr, - (png_size_t)(text_size + - png_ptr->zbuf_size - png_ptr->zstream.avail_out + 1)); +#ifdef PNG_SET_USER_LIMITS_SUPPORTED + if ((png_ptr->user_chunk_cache_max != 0) && + (--png_ptr->user_chunk_cache_max == 0)) + { + png_warning(png_ptr, "No space in chunk cache"); + text = NULL; + } + + else + { +#endif + text = (png_charp)png_malloc_warn(png_ptr, + (png_size_t)(text_size + + png_ptr->zbuf_size - png_ptr->zstream.avail_out + 1)); +#ifdef PNG_SET_USER_LIMITS_SUPPORTED + } +#endif if (text == NULL) { png_free(png_ptr, tmp); diff --git a/pngset.c b/pngset.c index 9782d679d..7a1d512eb 100644 --- a/pngset.c +++ b/pngset.c @@ -1,7 +1,7 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.4.0 [October 30, 2009] + * Last changed in libpng 1.4.0 [November 1, 2009] * Copyright (c) 1998-2009 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.) @@ -696,6 +696,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, lang_len = 0; lang_key_len = 0; } + else #ifdef PNG_iTXt_SUPPORTED { @@ -709,6 +710,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, else lang_key_len = 0; } + #else { png_warning(png_ptr, "iTXt chunk not supported"); @@ -726,6 +728,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, #endif textp->compression = PNG_TEXT_COMPRESSION_NONE; } + else { text_length = png_strlen(text_ptr[i].text); @@ -777,6 +780,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, } else #endif + { textp->text_length = text_length; #ifdef PNG_iTXt_SUPPORTED @@ -817,8 +821,7 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr, if (trans_alpha != NULL) { - /* - * It may not actually be necessary to set png_ptr->trans_alpha here; + /* It may not actually be necessary to set png_ptr->trans_alpha here; * we do it for backward compatibility with the way the png_handle_tRNS * function used to do the allocation. */ diff --git a/pngwrite.c b/pngwrite.c index e1eb9fc03..fc1bee79a 100644 --- a/pngwrite.c +++ b/pngwrite.c @@ -1,7 +1,7 @@ /* pngwrite.c - general routines to write a PNG file * - * Last changed in libpng 1.4.0 [October 31, 2009] + * Last changed in libpng 1.4.0 [November 1, 2009] * Copyright (c) 1998-2009 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.)