Binary files libpng-1.2.25/contrib/gregbook/toucan.png and libpng-1.2.26beta02/contrib/gregbook/toucan.png differ diff -ru4N libpng-1.2.25/png.h libpng-1.2.26beta02/png.h --- libpng-1.2.25/png.h Mon Feb 18 16:31:08 2008 +++ libpng-1.2.26beta02/png.h Wed Mar 12 20:44:29 2008 @@ -176,8 +176,11 @@ * 1.2.24rc01 13 10224 12.so.0.24[.0] * 1.2.24 13 10224 12.so.0.24[.0] * 1.2.25beta01-06 13 10225 12.so.0.25[.0] * 1.2.25rc01-02 13 10225 12.so.0.25[.0] + * 1.0.31 10 10031 10.so.0.31[.0] + * 1.2.25 13 10225 12.so.0.25[.0] + * 1.2.26beta01-2 13 10226 12.so.0.26[.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 -ru4N libpng-1.2.25/pngmem.c libpng-1.2.26beta02/pngmem.c --- libpng-1.2.25/pngmem.c Mon Feb 18 16:31:08 2008 +++ libpng-1.2.26beta02/pngmem.c Wed Mar 12 20:44:29 2008 @@ -1,10 +1,10 @@ /* pngmem.c - stub functions for memory allocation * - * Last changed in libpng 1.2.13 November 13, 2006 + * Last changed in libpng 1.2.26 [March 13, 2008] * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2006 Glenn Randers-Pehrson + * Copyright (c) 1998-2008 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 file provides a location for all memory allocation. Users who @@ -455,9 +455,9 @@ #ifdef PNG_MAX_MALLOC_64K if (size > (png_uint_32)65536L) { #ifndef PNG_USER_MEM_SUPPORTED - if(png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) + if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) png_error(png_ptr, "Cannot Allocate > 64K"); else #endif return NULL; diff -ru4N libpng-1.2.25/pngpread.c libpng-1.2.26beta02/pngpread.c --- libpng-1.2.25/pngpread.c Mon Feb 18 23:27:46 2008 +++ libpng-1.2.26beta02/pngpread.c Wed Mar 12 20:44:29 2008 @@ -223,8 +223,10 @@ if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4)) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { + if (png_ptr->push_length != 13) + png_error(png_ptr, "Invalid IHDR length"); png_push_save_buffer(png_ptr); return; } png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length); diff -ru4N libpng-1.2.25/pngwutil.c libpng-1.2.26beta02/pngwutil.c --- libpng-1.2.25/pngwutil.c Mon Feb 18 16:31:09 2008 +++ libpng-1.2.26beta02/pngwutil.c Wed Mar 12 20:44:30 2008 @@ -1,10 +1,10 @@ /* pngwutil.c - utilities to write a PNG file * - * Last changed in libpng 1.2.20 Septhember 3, 2007 + * Last changed in libpng 1.2.26 [March 13, 2008 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2007 Glenn Randers-Pehrson + * Copyright (c) 1998-2008 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.) */ @@ -379,8 +379,10 @@ { #ifdef PNG_USE_LOCAL_ARRAYS PNG_IHDR; #endif + int ret; + png_byte buf[13]; /* buffer to store the IHDR info */ png_debug(1, "in png_write_IHDR\n"); /* Check that we have valid input data from the application info */ @@ -522,12 +524,21 @@ if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS)) png_ptr->zlib_window_bits = 15; if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_METHOD)) png_ptr->zlib_method = 8; - if (deflateInit2(&png_ptr->zstream, png_ptr->zlib_level, - png_ptr->zlib_method, png_ptr->zlib_window_bits, - png_ptr->zlib_mem_level, png_ptr->zlib_strategy) != Z_OK) - png_error(png_ptr, "zlib failed to initialize compressor"); + ret = deflateInit2(&png_ptr->zstream, png_ptr->zlib_level, + png_ptr->zlib_method, png_ptr->zlib_window_bits, + png_ptr->zlib_mem_level, png_ptr->zlib_strategy); + if (ret != Z_OK) + { + if (ret == Z_VERSION_ERROR) png_error(png_ptr, + "zlib failed to initialize compressor -- version error"); + if (ret == Z_STREAM_ERROR) png_error(png_ptr, + "zlib failed to initialize compressor -- stream error"); + if (ret == Z_MEM_ERROR) png_error(png_ptr, + "zlib failed to initialize compressor -- mem error"); + png_error(png_ptr, "zlib failed to initialize compressor"); + } png_ptr->zstream.next_out = png_ptr->zbuf; png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; /* libpng is not interested in zstream.data_type */ /* set it to a predefined value, to avoid its evaluation inside zlib */