diff -ru4NwbB libpng-1.2.38/Makefile.am libpng-1.2.39rc01/Makefile.am --- libpng-1.2.38/Makefile.am 2009-07-16 05:58:47.791827013 -0500 +++ libpng-1.2.39rc01/Makefile.am 2009-08-05 21:18:58.637773161 -0500 @@ -1,11 +1,11 @@ # Makefile.am: # Source file for Makefile.in (and hence Makefile) # # Makefile.am need only be changed on a major version number -# change (e.g. libpng12 --> libpng13). In that case seach +# change (e.g. libpng12 --> libpng14). In that case seach # this file for every instance of the old base name (libpng12) -# and change to the new one (libpng13), then change the +# and change to the new one (libpng14), then change the # -version-number settings below so that the new values have # the correct major part (first field). PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ diff -ru4NwbB libpng-1.2.38/png.c libpng-1.2.39rc01/png.c --- libpng-1.2.38/png.c 2009-07-16 05:58:32.186509840 -0500 +++ libpng-1.2.39rc01/png.c 2009-08-05 21:18:43.843982198 -0500 @@ -147,9 +147,9 @@ /* Function to allocate memory for zlib and clear it to 0. */ #ifdef PNG_1_0_X voidpf PNGAPI #else -voidpf /* private */ +voidpf /* PRIVATE */ #endif png_zalloc(voidpf png_ptr, uInt items, uInt size) { png_voidp ptr; @@ -191,9 +191,9 @@ /* Function to free memory for zlib */ #ifdef PNG_1_0_X void PNGAPI #else -void /* private */ +void /* PRIVATE */ #endif png_zfree(voidpf png_ptr, voidpf ptr) { png_free((png_structp)png_ptr, (png_voidp)ptr); @@ -827,9 +827,10 @@ * C and D are the 16-bit words of V2, AD is the product of * A and D, and X || Y is (X << 16) + Y. */ -void png_64bit_product (long v1, long v2, unsigned long *hi_product, +void /* PRIVATE */ +png_64bit_product (long v1, long v2, unsigned long *hi_product, unsigned long *lo_product) { int a, b, c, d; long lo, hi, x, y; @@ -851,9 +852,9 @@ *hi_product = (unsigned long)hi; *lo_product = (unsigned long)lo; } -int /* private */ +int /* PRIVATE */ png_check_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x, png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x, png_fixed_point blue_y) diff -ru4NwbB libpng-1.2.38/png.h libpng-1.2.39rc01/png.h --- libpng-1.2.38/png.h 2009-07-19 13:30:15.661713321 -0500 +++ libpng-1.2.39rc01/png.h 2009-08-05 21:18:43.820795678 -0500 @@ -1,7 +1,7 @@ /* png.h - header file for PNG reference library * - * libpng version 1.2.38 - July 16, 2009 + * libpng version 1.2.39rc01 - August 6, 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.) * @@ -9,9 +9,9 @@ * * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.2.38 - July 16, 2009: Glenn + * libpng versions 0.97, January 1998, through 1.2.39rc01 - August 6, 2009: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: * @@ -236,8 +236,10 @@ * 1.2.38beta01 13 10238 12.so.0.38[.0] * 1.2.38rc01-03 13 10238 12.so.0.38[.0] * 1.0.47 10 10047 10.so.0.47[.0] * 1.2.38 13 10238 12.so.0.38[.0] + * 1.2.39beta01-05 13 10239 12.so.0.39[.0] + * 1.2.39rc01 13 10239 12.so.0.39[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be * used for changes in backward compatibility, as it is intended. The @@ -267,9 +269,9 @@ * this sentence. * * This code is released under the libpng license. * - * libpng versions 1.2.6, August 15, 2004, through 1.2.38, July 16, 2009, are + * libpng versions 1.2.6, August 15, 2004, through 1.2.39rc01, August 6, 2009, are * Copyright (c) 2004, 2006-2009 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: * @@ -379,15 +381,15 @@ /* * Y2K compliance in libpng: * ========================= * - * July 16, 2009 + * August 6, 2009 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. * * This is your unofficial assurance that libpng from version 0.71 and - * upward through 1.2.38 are Y2K compliant. It is my belief that earlier + * upward through 1.2.39rc01 are Y2K compliant. It is my belief that earlier * versions were also Y2K compliant. * * Libpng only has three year fields. One is a 2-byte unsigned integer * that will hold years up to 65535. The other two hold the date in text @@ -441,11 +443,11 @@ * at the actual function definitions and structure components. */ /* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.2.38" +#define PNG_LIBPNG_VER_STRING "1.2.39rc01" #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.2.38 - July 16, 2009\n" + " libpng version 1.2.39rc01 - August 6, 2009\n" #define PNG_LIBPNG_VER_SONUM %SONUM% #define PNG_LIBPNG_VER_DLLNUM %DLLNUM% @@ -3696,8 +3698,16 @@ int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, png_fixed_point int_blue_y)); #endif +#if defined(PNG_cHRM_SUPPORTED) +#if !defined(PNG_NO_CHECK_cHRM) +/* Added at libpng version 1.2.34 */ +PNG_EXTERN void png_64bit_product (long v1, long v2, unsigned long *hi_product, + unsigned long *lo_product); +#endif +#endif + /* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ #endif /* PNG_INTERNAL */ diff -ru4NwbB libpng-1.2.38/pngconf.h libpng-1.2.39rc01/pngconf.h --- libpng-1.2.38/pngconf.h 2009-07-19 13:30:32.001356007 -0500 +++ libpng-1.2.39rc01/pngconf.h 2009-08-05 21:18:43.829553445 -0500 @@ -1,8 +1,8 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.2.38 - July 16, 2009 + * libpng version 1.2.39rc01 - August 6, 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.) * diff -ru4NwbB libpng-1.2.38/pngrutil.c libpng-1.2.39rc01/pngrutil.c --- libpng-1.2.38/pngrutil.c 2009-07-19 13:31:12.427315118 -0500 +++ libpng-1.2.39rc01/pngrutil.c 2009-08-05 21:18:43.916739858 -0500 @@ -1,8 +1,8 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.2.38 [July 16, 2009] + * Last changed in libpng 1.2.38 [June 16, 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.) * diff -ru4NwbB libpng-1.2.38/pngset.c libpng-1.2.39rc01/pngset.c --- libpng-1.2.38/pngset.c 2009-07-19 13:31:09.105481885 -0500 +++ libpng-1.2.39rc01/pngset.c 2009-08-05 21:18:43.924936094 -0500 @@ -1,8 +1,8 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.2.38 [July 16, 2009] + * Last changed in libpng 1.2.39 [August 6, 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.) * @@ -707,9 +707,10 @@ int num_text) { int i; - png_debug1(1, "in %s storage function", (png_ptr->chunk_name[0] == '\0' ? + png_debug1(1, "in %s storage function", ((png_ptr == NULL || + png_ptr->chunk_name[0] == '\0') ? "text" : (png_const_charp)png_ptr->chunk_name)); if (png_ptr == NULL || info_ptr == NULL || num_text == 0) return(0); diff -ru4NwbB libpng-1.2.38/pngwutil.c libpng-1.2.39rc01/pngwutil.c --- libpng-1.2.38/pngwutil.c 2009-07-16 05:58:32.316707345 -0500 +++ libpng-1.2.39rc01/pngwutil.c 2009-08-05 21:18:43.974772459 -0500 @@ -787,8 +787,16 @@ ((*( (png_bytep)profile + 1))<<16) | ((*( (png_bytep)profile + 2))<< 8) | ((*( (png_bytep)profile + 3)) ); + if (embedded_profile_len < 0) + { + png_warning(png_ptr, + "Embedded profile length in iCCP chunk is negative"); + png_free(png_ptr, new_name); + return; + } + if (profile_len < embedded_profile_len) { png_warning(png_ptr, "Embedded profile length too large in iCCP chunk"); @@ -2118,13 +2126,16 @@ png_bytep prev_row, row_buf; png_uint_32 mins, bpp; png_byte filter_to_do = png_ptr->do_filter; png_uint_32 row_bytes = row_info->rowbytes; -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) +#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED int num_p_filters = (int)png_ptr->num_prev_filters; #endif png_debug(1, "in png_write_find_filter"); + + + png_debug(1, "in png_write_find_filter"); /* Find out how many bytes offset each pixel is */ bpp = (row_info->pixel_depth + 7) >> 3; prev_row = png_ptr->prev_row;