diff -ru4NwbB libpng-1.2.50/configure.ac libpng-1.2.51rc02/configure.ac --- libpng-1.2.50/configure.ac 2012-07-09 19:37:11.299422964 -0500 +++ libpng-1.2.51rc02/configure.ac 2014-01-30 15:34:42.771656984 -0600 @@ -30,9 +30,9 @@ dnl End of version number stuff AC_CONFIG_SRCDIR([pngget.c]) -AM_CONFIG_HEADER(config.h) +AC_CONFIG_HEADERS([config.h]) # Checks for programs. AC_PROG_CC AC_PROG_LD diff -ru4NwbB libpng-1.2.50/contrib/gregbook/readpng.c libpng-1.2.51rc02/contrib/gregbook/readpng.c --- libpng-1.2.50/contrib/gregbook/readpng.c 2012-07-09 19:36:57.183048788 -0500 +++ libpng-1.2.51rc02/contrib/gregbook/readpng.c 2014-01-30 15:34:28.853559853 -0600 @@ -213,8 +213,12 @@ /* setjmp() must be called in every function that calls a PNG-reading * libpng function */ if (setjmp(png_jmpbuf(png_ptr))) { + free(image_data); + image_data = NULL; + free(row_pointers); + row_pointers = NULL; png_destroy_read_struct(&png_ptr, &info_ptr, NULL); return NULL; } diff -ru4NwbB libpng-1.2.50/contrib/pngminim/encoder/README libpng-1.2.51rc02/contrib/pngminim/encoder/README --- libpng-1.2.50/contrib/pngminim/encoder/README 2012-07-09 19:36:57.677368183 -0500 +++ libpng-1.2.51rc02/contrib/pngminim/encoder/README 2014-01-30 15:34:29.372105637 -0600 @@ -1,7 +1,7 @@ This demonstrates the use of PNG_USER_CONFIG and pngusr.h -To build a minimal write-only decoder with embedded libpng and zlib, run +To build a minimal write-only encoder with embedded libpng and zlib, run gather.sh # to collect needed files from pngminus, libpng, and zlib make diff -ru4NwbB libpng-1.2.50/png.c libpng-1.2.51rc02/png.c --- libpng-1.2.50/png.c 2012-07-09 19:36:56.931670273 -0500 +++ libpng-1.2.51rc02/png.c 2014-01-30 15:34:28.600093344 -0600 @@ -1,9 +1,9 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.2.46 [February 25, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.2.51 [January 30, 2014] + * Copyright (c) 1998-2014 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.) * * This code is released under the libpng license. @@ -724,15 +724,15 @@ #else #ifdef __STDC__ return ((png_charp) PNG_STRING_NEWLINE \ "libpng version 1.2.51rc02 - January 30, 2014" PNG_STRING_NEWLINE \ - "Copyright (c) 1998-2011 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ + "Copyright (c) 1998-2014 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.2.51rc02 - January 30, 2014\ - Copyright (c) 1998-2011 Glenn Randers-Pehrson\ + Copyright (c) 1998-2014 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."); #endif #endif @@ -1008,16 +1008,8 @@ png_warning(png_ptr, "Invalid image height in IHDR"); error = 1; } - if ( width > (PNG_UINT_32_MAX - >> 3) /* 8-byte RGBA pixels */ - - 64 /* bigrowbuf hack */ - - 1 /* filter byte */ - - 7*8 /* rounding of width to multiple of 8 pixels */ - - 8) /* extra max_pixel_depth pad */ - png_warning(png_ptr, "Width is too large for libpng to process pixels"); - /* Check other values */ if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 && bit_depth != 8 && bit_depth != 16) { diff -ru4NwbB libpng-1.2.50/png.h libpng-1.2.51rc02/png.h --- libpng-1.2.50/png.h 2012-07-09 19:36:56.905164590 -0500 +++ libpng-1.2.51rc02/png.h 2014-01-30 15:34:28.573615918 -0600 @@ -1,8 +1,8 @@ /* png.h - header file for PNG reference library * * libpng version 1.2.51rc02 - January 30, 2014 - * Copyright (c) 1998-2012 Glenn Randers-Pehrson + * Copyright (c) 1998-2014 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.) * * This code is released under the libpng license (See LICENSE, below) @@ -283,8 +283,10 @@ * 1.0.59 10 10059 10.so.0.59[.0] * 1.2.49 13 10249 12.so.0.49[.0] * 1.0.60 10 10060 10.so.0.60[.0] * 1.2.50 13 10250 12.so.0.50[.0] + * 1.2.51beta01-05 13 10251 12.so.0.51[.0] + * 1.2.51rc01-02 13 10251 12.so.0.51[.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 @@ -315,9 +317,9 @@ * * This code is released under the libpng license. * * libpng versions 1.2.6, August 15, 2004, through 1.2.51rc02, January 30, 2014, are - * Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are + * Copyright (c) 2004, 2006-2013 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: * * Cosmin Truta diff -ru4NwbB libpng-1.2.50/pngconf.h libpng-1.2.51rc02/pngconf.h --- libpng-1.2.50/pngconf.h 2012-07-09 19:36:56.915063752 -0500 +++ libpng-1.2.51rc02/pngconf.h 2014-01-30 15:34:28.583536677 -0600 @@ -1,9 +1,9 @@ /* pngconf.h - machine configurable file for libpng * * libpng version 1.2.51rc02 - January 30, 2014 - * Copyright (c) 1998-2012 Glenn Randers-Pehrson + * Copyright (c) 1998-2013 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.) * * This code is released under the libpng license. @@ -867,9 +867,9 @@ /* Added at libpng-1.2.43. To accept all valid PNGs no matter * how large, set these two limits to 0. */ #ifndef PNG_USER_CHUNK_CACHE_MAX -# define PNG_USER_CHUNK_CACHE_MAX 0 +# define PNG_USER_CHUNK_CACHE_MAX 32765 #endif /* Added at libpng-1.2.43 */ #ifndef PNG_USER_CHUNK_MALLOC_MAX diff -ru4NwbB libpng-1.2.50/pngread.c libpng-1.2.51rc02/pngread.c --- libpng-1.2.50/pngread.c 2012-07-09 19:36:56.974932198 -0500 +++ libpng-1.2.51rc02/pngread.c 2014-01-30 15:34:28.643290886 -0600 @@ -1,9 +1,9 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.2.48 [March 8, 2012] - * Copyright (c) 1998-2012 Glenn Randers-Pehrson + * Last changed in libpng 1.2.51 [%RDATE%] + * Copyright (c) 1998-2014 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.) * * This code is released under the libpng license. @@ -1404,9 +1404,9 @@ */ if (transforms & PNG_TRANSFORM_EXPAND) if ((png_ptr->bit_depth < 8) || (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) || - (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) + (info_ptr->valid & PNG_INFO_tRNS)) png_set_expand(png_ptr); #endif /* We don't handle background color or gamma transformation or dithering. @@ -1423,16 +1423,10 @@ /* If you want to shift the pixel values from the range [0,255] or * [0,65535] to the original [0,7] or [0,31], or whatever range the * colors were originally in: */ - if ((transforms & PNG_TRANSFORM_SHIFT) - && png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT)) - { - png_color_8p sig_bit; - - png_get_sBIT(png_ptr, info_ptr, &sig_bit); - png_set_shift(png_ptr, sig_bit); - } + if ((transforms & PNG_TRANSFORM_SHIFT) && (info_ptr->valid & PNG_INFO_sBIT)) + png_set_shift(png_ptr, &info_ptr->sig_bit); #endif #ifdef PNG_READ_BGR_SUPPORTED /* Flip the RGB pixels to BGR (or RGBA to BGRA) diff -ru4NwbB libpng-1.2.50/pngrtran.c libpng-1.2.51rc02/pngrtran.c --- libpng-1.2.50/pngrtran.c 2012-07-09 19:36:56.996883555 -0500 +++ libpng-1.2.51rc02/pngrtran.c 2014-01-30 15:34:28.665423094 -0600 @@ -1,9 +1,9 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.2.49 [March 29, 2012] - * Copyright (c) 1998-2012 Glenn Randers-Pehrson + * Last changed in libpng 1.2.51 [January 30, 2014] + * Copyright (c) 1998-2014 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.) * * This code is released under the libpng license. @@ -916,9 +916,12 @@ k=0; for (i=0; inum_trans; i++) { if (png_ptr->trans[i] != 0 && png_ptr->trans[i] != 0xff) + { k=1; /* Partial transparency is present */ + break; + } } if (k == 0) png_ptr->transformations &= ~PNG_GAMMA; } diff -ru4NwbB libpng-1.2.50/pngset.c libpng-1.2.51rc02/pngset.c --- libpng-1.2.50/pngset.c 2012-07-09 19:36:57.019705149 -0500 +++ libpng-1.2.51rc02/pngset.c 2014-01-30 15:34:28.688202332 -0600 @@ -1,9 +1,9 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.2.49 [March 29, 2012] - * Copyright (c) 1998-2012 Glenn Randers-Pehrson + * Last changed in libpng 1.2.51 [January 30, 2014] + * Copyright (c) 1998-2014 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.) * * This code is released under the libpng license. @@ -554,16 +554,21 @@ #endif #endif #ifdef PNG_cHRM_SUPPORTED +# ifdef PNG_FIXED_POINT_SUPPORTED int_white_x = 31270L; int_white_y = 32900L; int_red_x = 64000L; int_red_y = 33000L; int_green_x = 30000L; int_green_y = 60000L; int_blue_x = 15000L; int_blue_y = 6000L; + png_set_cHRM_fixed(png_ptr, info_ptr, + int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, + int_green_y, int_blue_x, int_blue_y); +# endif #ifdef PNG_FLOATING_POINT_SUPPORTED white_x = (float).3127; white_y = (float).3290; @@ -572,16 +577,8 @@ green_x = (float).30; green_y = (float).60; blue_x = (float).15; blue_y = (float).06; -#endif - -#ifdef PNG_FIXED_POINT_SUPPORTED - png_set_cHRM_fixed(png_ptr, info_ptr, - int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, - int_green_y, int_blue_x, int_blue_y); -#endif -#ifdef PNG_FLOATING_POINT_SUPPORTED png_set_cHRM(png_ptr, info_ptr, white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y); #endif #endif /* cHRM */ @@ -849,8 +846,14 @@ if (png_ptr == NULL || info_ptr == NULL) return; + if (num_trans < 0 || num_trans > PNG_MAX_PALETTE_LENGTH) + { + png_warning(png_ptr, "Ignoring invalid num_trans value"); + return; + } + if (trans != NULL) { /* It may not actually be necessary to set png_ptr->trans here; * we do it for backward compatibility with the way the png_handle_tRNS diff -ru4NwbB libpng-1.2.50/projects/xcode/libpng.xcodeproj/project.pbxproj libpng-1.2.51rc02/projects/xcode/libpng.xcodeproj/project.pbxproj --- libpng-1.2.50/projects/xcode/libpng.xcodeproj/project.pbxproj 2012-07-09 19:36:58.112649000 -0500 +++ libpng-1.2.51rc02/projects/xcode/libpng.xcodeproj/project.pbxproj 2014-01-30 15:34:29.803734195 -0600 @@ -221,9 +221,9 @@ buildSettings = { COPY_PHASE_STRIP = NO; DYLIB_COMPATIBILITY_VERSION = 3; DYLIB_CURRENT_VERSION = 3; - FRAMEWORK_VERSION = 1.2.50; + FRAMEWORK_VERSION = 1.2.51rc02; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; @@ -239,9 +239,9 @@ isa = XCBuildConfiguration; buildSettings = { DYLIB_COMPATIBILITY_VERSION = 3; DYLIB_CURRENT_VERSION = 3; - FRAMEWORK_VERSION = 1.2.50; + FRAMEWORK_VERSION = 1.2.51rc02; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Frameworks";