diff -ru4NwbB libpng-1.2.34/example.c libpng-1.2.35beta02/example.c --- libpng-1.2.34/example.c 2008-12-22 12:51:04.701668709 -0600 +++ libpng-1.2.35beta02/example.c 2009-02-04 14:38:34.779043752 -0600 @@ -1,11 +1,11 @@ #if 0 /* in case someone actually tries to compile this */ /* example.c - an example of using libpng - * Last changed in libpng 1.2.33 [October 31, 2008] + * Last changed in libpng 1.2.35 [February 4, 2009] * This file has been placed in the public domain by the authors. - * Maintained 1998-2008 Glenn Randers-Pehrson + * Maintained 1998-2009 Glenn Randers-Pehrson * Maintained 1996, 1997 Andreas Dilger) * Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) */ @@ -341,13 +341,15 @@ /* The easiest way to read the image: */ png_bytep row_pointers[height]; + /* Clear the pointer array */ + for (row = 0; row < height; row++) + row_pointers[row] = NULL; + for (row = 0; row < height; row++) - { row_pointers[row] = png_malloc(png_ptr, png_get_rowbytes(png_ptr, info_ptr)); - } /* Now it's time to read the image. One of these methods is REQUIRED */ #ifdef entire /* Read the entire image in one go */ png_read_image(png_ptr, row_pointers); @@ -770,12 +772,10 @@ png_write_rows(png_ptr, &row_pointers[first_row], number_of_rows); /* If you are only writing one row at a time, this works */ for (y = 0; y < height; y++) - { png_write_rows(png_ptr, &row_pointers[y], 1); } - } #endif no_entire /* use only one output method */ /* You can write optional chunks like tEXt, zTXt, and tIME at the end * as well. Shouldn't be necessary in 1.1.0 and up as all the public diff -ru4NwbB libpng-1.2.34/png.h libpng-1.2.35beta02/png.h --- libpng-1.2.34/png.h 2008-12-18 05:45:16.330746499 -0600 +++ libpng-1.2.35beta02/png.h 2009-02-04 14:38:34.762565024 -0600 @@ -1,8 +1,8 @@ /* png.h - header file for PNG reference library * * libpng version 1.2.35beta02 - February 4, 2009 - * Copyright (c) 1998-2008 Glenn Randers-Pehrson + * 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.) * * Authors and maintainers: @@ -216,8 +216,9 @@ * 1.0.42rc01 10 10042 10.so.0.42[.0] * 1.2.34rc01 13 10234 12.so.0.34[.0] * 1.0.42 10 10042 10.so.0.42[.0] * 1.2.34 13 10234 12.so.0.34[.0] + * 1.2.35beta01-02 13 10235 12.so.0.35[.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.2.34/pngconf.h libpng-1.2.35beta02/pngconf.h --- libpng-1.2.34/pngconf.h 2008-12-18 05:45:16.339349374 -0600 +++ libpng-1.2.35beta02/pngconf.h 2009-02-04 14:38:34.771603460 -0600 @@ -2,9 +2,9 @@ /* pngconf.h - machine configurable file for libpng * * libpng version 1.2.35beta02 - February 4, 2009 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2008 Glenn Randers-Pehrson + * 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.34/pngget.c libpng-1.2.35beta02/pngget.c --- libpng-1.2.34/pngget.c 2008-12-18 05:45:16.370508200 -0600 +++ libpng-1.2.35beta02/pngget.c 2009-02-04 14:38:34.803360473 -0600 @@ -882,9 +882,9 @@ #endif /* ?PNG_1_0_X */ #endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */ #ifdef PNG_SET_USER_LIMITS_SUPPORTED -/* these functions were added to libpng 1.2.6 */ +/* These functions were added to libpng 1.2.6 */ png_uint_32 PNGAPI png_get_user_width_max (png_structp png_ptr) { return (png_ptr? png_ptr->user_width_max : 0); diff -ru4NwbB libpng-1.2.34/pngread.c libpng-1.2.35beta02/pngread.c --- libpng-1.2.34/pngread.c 2008-12-18 05:45:16.392000603 -0600 +++ libpng-1.2.35beta02/pngread.c 2009-02-04 14:38:34.826060287 -0600 @@ -1,10 +1,10 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.2.30 [August 15, 2008] + * Last changed in libpng 1.2.35 [February 4, 2009] * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2008 Glenn Randers-Pehrson + * 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.) * * This file contains routines that an application calls directly to @@ -1437,13 +1437,13 @@ #ifdef PNG_FREE_ME_SUPPORTED info_ptr->free_me |= PNG_FREE_ROWS; #endif for (row = 0; row < (int)info_ptr->height; row++) - { + info_ptr->row_pointers[row] = NULL; + for (row = 0; row < (int)info_ptr->height; row++) info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr, png_get_rowbytes(png_ptr, info_ptr)); } - } png_read_image(png_ptr, info_ptr->row_pointers); info_ptr->valid |= PNG_INFO_IDAT; diff -ru4NwbB libpng-1.2.34/pngrtran.c libpng-1.2.35beta02/pngrtran.c --- libpng-1.2.34/pngrtran.c 2008-12-18 05:45:16.409964684 -0600 +++ libpng-1.2.35beta02/pngrtran.c 2009-02-04 14:38:34.845156736 -0600 @@ -1,10 +1,10 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.2.30 [August 15, 2008] + * Last changed in libpng 1.2.35 [February 4, 2009] * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2008 Glenn Randers-Pehrson + * 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.) * * This file contains functions optionally called by an application @@ -4133,8 +4133,11 @@ double fin, fout; png_uint_32 last, max; for (i = 0; i < num; i++) + png_ptr->gamma_16_table[i] = NULL; + + for (i = 0; i < num; i++) { png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr, (png_uint_32)(256 * png_sizeof(png_uint_16))); } @@ -4188,8 +4191,11 @@ png_ptr->gamma_16_to_1 = (png_uint_16pp)png_malloc(png_ptr, (png_uint_32)(num * png_sizeof(png_uint_16p ))); for (i = 0; i < num; i++) + png_ptr->gamma_16_to_1[i] = NULL; + + for (i = 0; i < num; i++) { png_ptr->gamma_16_to_1[i] = (png_uint_16p)png_malloc(png_ptr, (png_uint_32)(256 * png_sizeof(png_uint_16))); @@ -4211,8 +4217,11 @@ png_ptr->gamma_16_from_1 = (png_uint_16pp)png_malloc(png_ptr, (png_uint_32)(num * png_sizeof(png_uint_16p))); for (i = 0; i < num; i++) + png_ptr->gamma_16_from_1[i] = NULL; + + for (i = 0; i < num; i++) { png_ptr->gamma_16_from_1[i] = (png_uint_16p)png_malloc(png_ptr, (png_uint_32)(256 * png_sizeof(png_uint_16))); diff -ru4NwbB libpng-1.2.34/pngrutil.c libpng-1.2.35beta02/pngrutil.c --- libpng-1.2.34/pngrutil.c 2008-12-22 10:46:25.365703055 -0600 +++ libpng-1.2.35beta02/pngrutil.c 2009-02-04 14:38:34.857662949 -0600 @@ -3203,11 +3211,11 @@ png_debug1(3, "width = %lu,", png_ptr->width); png_debug1(3, "height = %lu,", png_ptr->height); png_debug1(3, "iwidth = %lu,", png_ptr->iwidth); - png_debug1(3, "num_rows = %lu", png_ptr->num_rows); + 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_ptr->irowbytes); png_ptr->flags |= PNG_FLAG_ROW_INIT; } #endif /* PNG_READ_SUPPORTED */ diff -ru4NwbB libpng-1.2.34/pngset.c libpng-1.2.35beta02/pngset.c --- libpng-1.2.34/pngset.c 2008-12-22 10:46:28.691451710 -0600 +++ libpng-1.2.35beta02/pngset.c 2009-02-04 14:38:34.865640635 -0600 @@ -1,10 +1,10 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.2.34 [December 18, 2008] + * Last changed in libpng 1.2.35 [February 4, 2009] * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2008 Glenn Randers-Pehrson + * 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.) * * The functions here are used during reads to store data from the file @@ -60,9 +60,10 @@ info_ptr->int_y_blue = (png_fixed_point)( blue_y*100000.+0.5); #endif info_ptr->valid |= PNG_INFO_cHRM; } -#endif +#endif /* PNG_FLOATING_POINT_SUPPORTED */ + #ifdef PNG_FIXED_POINT_SUPPORTED void PNGAPI png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x, @@ -381,9 +382,13 @@ png_warning(png_ptr, "Insufficient memory for pCAL params."); return; } - info_ptr->pcal_params[nparams] = NULL; +#ifdef PNG_FREE_ME_SUPPORTED + info_ptr->free_me |= PNG_FREE_PCAL; +#endif + for (i = 0; i < nparams; i++) + info_ptr->pcal_params[i] = NULL; for (i = 0; i < nparams; i++) { length = png_strlen(params[i]) + 1; @@ -398,11 +403,8 @@ png_memcpy(info_ptr->pcal_params[i], params[i], (png_size_t)length); } info_ptr->valid |= PNG_INFO_pCAL; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_PCAL; -#endif } #endif #if defined(PNG_READ_sCAL_SUPPORTED) || defined(PNG_WRITE_sCAL_SUPPORTED) @@ -634,9 +636,9 @@ #endif } #endif /* cHRM */ } -#endif +#endif /* sRGB */ #if defined(PNG_iCCP_SUPPORTED) void PNGAPI diff -ru4NwbB libpng-1.2.34/pngtest.c libpng-1.2.35beta02/pngtest.c --- libpng-1.2.34/pngtest.c 2008-12-18 05:45:16.437734816 -0600 +++ libpng-1.2.35beta02/pngtest.c 2009-02-04 14:38:34.874565569 -0600 @@ -1215,9 +1215,9 @@ png_debug1(0, "Writing row data for pass %d", pass); for (y = 0; y < height; y++) { #ifndef SINGLE_ROWBUF_ALLOC - png_debug2(0, "\nAllocating row buffer (pass %d, y = %ld)...", pass, y); + png_debug2(0, "Allocating row buffer (pass %d, y = %ld)...", pass, y); row_buf = (png_bytep)png_malloc(read_ptr, png_get_rowbytes(read_ptr, read_info_ptr)); png_debug2(0, "0x%08lx (%ld bytes)", (unsigned long)row_buf, png_get_rowbytes(read_ptr, read_info_ptr)); diff -ru4NwbB libpng-1.2.34/pngwio.c libpng-1.2.35beta02/pngwio.c --- libpng-1.2.34/pngwio.c 2008-12-18 05:45:16.453563498 -0600 +++ libpng-1.2.35beta02/pngwio.c 2009-02-04 14:38:34.891345036 -0600 @@ -1,10 +1,10 @@ /* pngwio.c - functions for data output * - * Last changed in libpng 1.2.30 [August 15, 2008] + * Last changed in libpng 1.2.35 [February 4, 2009] * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2008 Glenn Randers-Pehrson + * 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.) * * This file provides a location for all output. Users who need @@ -136,9 +136,9 @@ #endif if (png_ptr == NULL) return; #if !defined(_WIN32_WCE) io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); - if (io_ptr != NULL) + if (io_ptr != NULL && fileno(io_ptr) != -1) fflush(io_ptr); #endif } #endif diff -ru4NwbB libpng-1.2.34/pngwrite.c libpng-1.2.35beta02/pngwrite.c --- libpng-1.2.34/pngwrite.c 2008-12-18 05:45:16.461190176 -0600 +++ libpng-1.2.35beta02/pngwrite.c 2009-02-04 14:38:34.899438157 -0600 @@ -1,8 +1,8 @@ /* pngwrite.c - general routines to write a PNG file * - * Last changed in libpng 1.2.31 [August 19, 2008] + * Last changed in libpng 1.2.34 [December 18, 2008] * For conditions of distribution and use, see copyright notice in png.h * 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.)