diff -ru4NwbB libpng-1.4.10/png.h libpng-1.4.11/png.h --- libpng-1.4.10/png.h 2012-03-14 23:26:49.927590059 -0500 +++ libpng-1.4.11/png.h 2012-03-29 00:02:32.727549996 -0500 @@ -166,8 +166,10 @@ * 1.4.9 14 10409 14.so.14.9[.0] * 1.4.10beta01 14 10410 14.so.14.10[.0] * 1.4.10rc01-02 14 10410 14.so.14.10[.0] * 1.4.10 14 10410 14.so.14.10[.0] + * 1.4.11rc01 14 10411 14.so.14.11[.0] + * 1.4.11 14 10411 14.so.14.11[.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 diff -ru4NwbB libpng-1.4.10/pngpread.c libpng-1.4.11/pngpread.c --- libpng-1.4.10/pngpread.c 2012-03-14 23:26:49.991178654 -0500 +++ libpng-1.4.11/pngpread.c 2012-03-29 00:02:32.796200955 -0500 @@ -1,8 +1,8 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.4.10 [March 29, 2012] + * Last changed in libpng 1.4.10 [March 8, 2012] * Copyright (c) 1998-2012 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.4.10/pngread.c libpng-1.4.11/pngread.c --- libpng-1.4.10/pngread.c 2012-03-14 23:26:50.000554631 -0500 +++ libpng-1.4.11/pngread.c 2012-03-29 00:02:32.806197455 -0500 @@ -1,8 +1,8 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.4.10 [March 29, 2012] + * Last changed in libpng 1.4.10 [March 8, 2012] * Copyright (c) 1998-2012 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.4.10/pngrtran.c libpng-1.4.11/pngrtran.c --- libpng-1.4.10/pngrtran.c 2012-03-14 23:26:50.023866048 -0500 +++ libpng-1.4.11/pngrtran.c 2012-03-29 00:02:32.829884029 -0500 @@ -1,9 +1,9 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.4.8 [July 7, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.4.11 [March 29, 2012] + * Copyright (c) 1998-2012 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. @@ -1158,8 +1158,9 @@ #endif /* PNG_READ_BACKGROUND_SUPPORTED */ #ifdef PNG_READ_SHIFT_SUPPORTED if ((png_ptr->transformations & PNG_SHIFT) && + !(png_ptr->transformations & PNG_EXPAND) && (color_type == PNG_COLOR_TYPE_PALETTE)) { png_uint_16 i; png_uint_16 istop = png_ptr->num_palette; @@ -1178,8 +1179,10 @@ png_ptr->palette[i].red >>= sr; png_ptr->palette[i].green >>= sg; png_ptr->palette[i].blue >>= sb; } + + png_ptr->transformations &= ~PNG_SHIFT; } #endif /* PNG_READ_SHIFT_SUPPORTED */ } #if !defined(PNG_READ_GAMMA_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) \ diff -ru4NwbB libpng-1.4.10/pngrutil.c libpng-1.4.11/pngrutil.c --- libpng-1.4.10/pngrutil.c 2012-03-14 23:26:50.039358854 -0500 +++ libpng-1.4.11/pngrutil.c 2012-03-29 00:02:32.845725332 -0500 @@ -1,8 +1,8 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.4.10 [March 29, 2012] + * Last changed in libpng 1.4.10 [March 8, 2012] * Copyright (c) 1998-2012 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.4.10/pngset.c libpng-1.4.11/pngset.c --- libpng-1.4.10/pngset.c 2012-03-14 23:26:50.048529767 -0500 +++ libpng-1.4.11/pngset.c 2012-03-29 00:02:32.855101520 -0500 @@ -1,9 +1,9 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.4.6 [January 14, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.4.11 [March 29, 2012] + * Copyright (c) 1998-2012 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. @@ -648,16 +648,18 @@ * to hold all of the incoming text_ptr objects. */ if (info_ptr->num_text + num_text > info_ptr->max_text) { + int old_max_text = info_ptr->max_text; + int old_num_text = info_ptr->num_text; + if (info_ptr->text != NULL) { png_textp old_text; - int old_max; - old_max = info_ptr->max_text; info_ptr->max_text = info_ptr->num_text + num_text + 8; old_text = info_ptr->text; + info_ptr->text = (png_textp)png_malloc_warn(png_ptr, (png_size_t)(info_ptr->max_text * png_sizeof(png_text))); if (info_ptr->text == NULL) { @@ -660,12 +662,14 @@ info_ptr->text = (png_textp)png_malloc_warn(png_ptr, (png_size_t)(info_ptr->max_text * png_sizeof(png_text))); if (info_ptr->text == NULL) { - png_free(png_ptr, old_text); + /* Restore to previous condition */ + info_ptr->max_text = old_max_text; + info_ptr->text = old_text; return(1); } - png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max * + png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max_text * png_sizeof(png_text))); png_free(png_ptr, old_text); } else @@ -674,9 +678,14 @@ info_ptr->num_text = 0; info_ptr->text = (png_textp)png_malloc_warn(png_ptr, (png_size_t)(info_ptr->max_text * png_sizeof(png_text))); if (info_ptr->text == NULL) + { + /* Restore to previous condition */ + info_ptr->num_text = old_num_text; + info_ptr->max_text = old_max_text; return(1); + } info_ptr->free_me |= PNG_FREE_TEXT; } png_debug1(3, "allocated %d entries for info_ptr->text", info_ptr->max_text);