From b025757328ca7a364bbfedf9a1899342864a3f2c Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Sat, 6 Feb 2010 12:12:59 -0600 Subject: [PATCH] [master] Bump to version libpng-1.4.1beta07 --- INSTALL | 2 +- LICENSE | 4 ++-- README | 2 +- png.5 | 2 +- png.c | 4 ++-- pngget.c | 5 +++-- pngread.c | 6 ++++-- pngrutil.c | 28 ++++++++++++---------------- pngset.c | 19 +++++++------------ scripts/README.txt | 2 +- 10 files changed, 34 insertions(+), 40 deletions(-) diff --git a/INSTALL b/INSTALL index bdd263f4f..43de1a137 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,5 @@ -Installing libpng version 1.4.1beta07 - February 5, 2010 +Installing libpng version 1.4.1beta07 - February 6, 2010 On Unix/Linux and similar systems, you can simply type diff --git a/LICENSE b/LICENSE index d2b4a9a91..1f136495d 100644 --- a/LICENSE +++ b/LICENSE @@ -10,7 +10,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.4.1beta07, February 5, 2010, are +libpng versions 1.2.6, August 15, 2004, through 1.4.1beta07, February 6, 2010, 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 @@ -108,4 +108,4 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -February 5, 2010 +February 6, 2010 diff --git a/README b/README index 6e90d5f03..d9c00712d 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -README for libpng version 1.4.1beta07 - February 5, 2010 (shared library 14.0) +README for libpng version 1.4.1beta07 - February 6, 2010 (shared library 14.0) See the note about version numbers near the top of png.h See INSTALL for instructions on how to install libpng. diff --git a/png.5 b/png.5 index 72a6a43b6..983eaa17e 100644 --- a/png.5 +++ b/png.5 @@ -1,4 +1,4 @@ -.TH PNG 5 "February 5, 2010" +.TH PNG 5 "February 6, 2010" .SH NAME png \- Portable Network Graphics (PNG) format .SH DESCRIPTION diff --git a/png.c b/png.c index e4da2d388..2e7bc8292 100644 --- a/png.c +++ b/png.c @@ -551,13 +551,13 @@ png_get_copyright(png_structp png_ptr) #else #ifdef __STDC__ return ((png_charp) PNG_STRING_NEWLINE \ - "libpng version 1.4.1beta07 - February 5, 2010" PNG_STRING_NEWLINE \ + "libpng version 1.4.1beta07 - February 6, 2010" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2010 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 ((png_charp) "libpng version 1.4.1beta07 - February 5, 2010\ + return ((png_charp) "libpng version 1.4.1beta07 - February 6, 2010\ Copyright (c) 1998-2010 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."); diff --git a/pngget.c b/pngget.c index 3240c6ea3..4c79c2335 100644 --- a/pngget.c +++ b/pngget.c @@ -1,7 +1,7 @@ /* pngget.c - retrieval of values from info struct * - * Last changed in libpng 1.4.1 [February 5, 2010] + * Last changed in libpng 1.4.1 [February 6, 2010] * Copyright (c) 1998-2010 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.) @@ -902,7 +902,8 @@ png_get_chunk_cache_max (png_structp png_ptr) png_uint_32 PNGAPI png_get_chunk_malloc_max (png_structp png_ptr) { - return (png_ptr? png_ptr->user_chunk_malloc_max : 0); + return (png_ptr? + (png_uint_32)png_ptr->user_chunk_malloc_max : 0); } #endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */ diff --git a/pngread.c b/pngread.c index 8d0224b26..ba1da0241 100644 --- a/pngread.c +++ b/pngread.c @@ -1,7 +1,7 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.4.1 [February 5, 2010] + * Last changed in libpng 1.4.1 [February 6, 2010] * Copyright (c) 1998-2010 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.) @@ -584,7 +584,9 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) png_error(png_ptr, "Invalid attempt to read row data"); png_ptr->zstream.next_out = png_ptr->row_buf; - png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes; + png_ptr->zstream.avail_out = + (uInt)(PNG_ROWBYTES(png_ptr->pixel_depth, + png_ptr->iwidth) + 1); do { if (!(png_ptr->zstream.avail_in)) diff --git a/pngrutil.c b/pngrutil.c index 4a3b94bc5..a0e3dbea3 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.1 [February 5, 2010] + * Last changed in libpng 1.4.1 [February 6, 2010] * Copyright (c) 1998-2010 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.) @@ -242,9 +242,11 @@ png_measure_decompressed_chunk(png_structp png_ptr, int comp_type, { text_size += png_ptr->zbuf_size - png_ptr->zstream.avail_out; #ifdef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED - if (text_size >= png_ptr->user_chunk_malloc_max - 1) + if (png_ptr->user_chunk_malloc_max && + (text_size >= png_ptr->user_chunk_malloc_max - 1)) #else - if (text_size >= PNG_USER_CHUNK_MALLOC_MAX) + if ((PNG_USER_CHUNK_MALLOC_MAX > 0) && + text_size >= PNG_USER_CHUNK_MALLOC_MAX)) #endif return 0; } @@ -1181,7 +1183,7 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) png_debug(1, "in png_handle_sPLT"); -#ifdef PNG_SET_USER_LIMITS_SUPPORTED +#ifdef PNG_USER_LIMITS_SUPPORTED if (png_ptr->user_chunk_cache_max != 0) { @@ -1986,7 +1988,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) png_debug(1, "in png_handle_tEXt"); -#ifdef PNG_SET_USER_LIMITS_SUPPORTED +#ifdef PNG_USER_LIMITS_SUPPORTED if (png_ptr->user_chunk_cache_max != 0) { if (png_ptr->user_chunk_cache_max == 1) @@ -2088,7 +2090,7 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) png_debug(1, "in png_handle_zTXt"); -#ifdef PNG_SET_USER_LIMITS_SUPPORTED +#ifdef PNG_USER_LIMITS_SUPPORTED if (png_ptr->user_chunk_cache_max != 0) { if (png_ptr->user_chunk_cache_max == 1) @@ -2209,7 +2211,7 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) png_debug(1, "in png_handle_iTXt"); -#ifdef PNG_SET_USER_LIMITS_SUPPORTED +#ifdef PNG_USER_LIMITS_SUPPORTED if (png_ptr->user_chunk_cache_max != 0) { if (png_ptr->user_chunk_cache_max == 1) @@ -2353,7 +2355,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) png_debug(1, "in png_handle_unknown"); -#ifdef PNG_SET_USER_LIMITS_SUPPORTED +#ifdef PNG_USER_LIMITS_SUPPORTED if (png_ptr->user_chunk_cache_max != 0) { if (png_ptr->user_chunk_cache_max == 1) @@ -3077,9 +3079,6 @@ png_read_finish_row(png_structp png_ptr) png_pass_start[png_ptr->pass]) / png_pass_inc[png_ptr->pass]; - png_ptr->irowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, - png_ptr->iwidth) + 1; - if (!(png_ptr->transformations & PNG_INTERLACE)) { png_ptr->num_rows = (png_ptr->height + @@ -3204,16 +3203,12 @@ png_read_start_row(png_structp png_ptr) png_pass_inc[png_ptr->pass] - 1 - png_pass_start[png_ptr->pass]) / png_pass_inc[png_ptr->pass]; - - png_ptr->irowbytes = - PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1; } else #endif /* PNG_READ_INTERLACING_SUPPORTED */ { png_ptr->num_rows = png_ptr->height; png_ptr->iwidth = png_ptr->width; - png_ptr->irowbytes = png_ptr->rowbytes + 1; } max_pixel_depth = png_ptr->pixel_depth; @@ -3378,7 +3373,8 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) png_debug1(3, "iwidth = %lu,", png_ptr->iwidth); png_debug1(3, "num_rows = %lu,", png_ptr->num_rows); png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes); - png_debug1(3, "irowbytes = %lu", png_ptr->irowbytes); + png_debug1(3, "irowbytes = %lu", + PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1); png_ptr->flags |= PNG_FLAG_ROW_INIT; } diff --git a/pngset.c b/pngset.c index 2a0ff6056..7a1be2f4c 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.1 [February 5, 2010] + * Last changed in libpng 1.4.1 [February 6, 2010] * Copyright (c) 1998-2010 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.) @@ -1136,23 +1136,18 @@ void PNGAPI png_set_chunk_cache_max (png_structp png_ptr, png_uint_32 user_chunk_cache_max) { - if (png_ptr == NULL) - return; - png_ptr->user_chunk_cache_max = user_chunk_cache_max; - if (user_chunk_cache_max == 0x7fffffffL) /* Unlimited */ - png_ptr->user_chunk_cache_max = 0; - else - png_ptr->user_chunk_cache_max = user_chunk_cache_max + 1; + if (png_ptr) + png_ptr->user_chunk_cache_max = user_chunk_cache_max; } /* This function was added to libpng 1.4.1 */ void PNGAPI png_set_chunk_malloc_max (png_structp png_ptr, - png_uint_32 user_chunk_malloc_max) + png_alloc_size_t user_chunk_malloc_max) { - if (png_ptr == NULL) - return; - png_ptr->user_chunk_malloc_max = user_chunk_malloc_max; + if (png_ptr) + png_ptr->user_chunk_malloc_max = + (png_size_t)user_chunk_malloc_max; } #endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */ diff --git a/scripts/README.txt b/scripts/README.txt index 7b8011020..8022a1e93 100644 --- a/scripts/README.txt +++ b/scripts/README.txt @@ -1,5 +1,5 @@ -Makefiles for libpng version 1.4.1beta07 - February 5, 2010 +Makefiles for libpng version 1.4.1beta07 - February 6, 2010 makefile.linux => Linux/ELF makefile (gcc, creates libpng14.so.14.1.4.1beta07)