diff -ru4N libpng-1.2.21/png.h libpng-1.2.22rc1/png.h --- libpng-1.2.21/png.h 2007-10-06 17:49:08.142842000 -0500 +++ libpng-1.2.22rc1/png.h 2007-10-08 10:47:34.726174000 -0500 @@ -163,8 +163,11 @@ * 1.2.21beta1-2 13 10221 12.so.0.21[.0] * 1.2.21rc1-3 13 10221 12.so.0.21[.0] * 1.0.29 10 10029 10.so.0.29[.0] * 1.2.21 13 10221 12.so.0.21[.0] + * 1.2.22beta1-4 13 10222 12.so.0.22[.0] + * 1.0.30rc1 13 10030 10.so.0.30[.0] + * 1.2.22rc1 13 10222 12.so.0.22[.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.21/pngconf.h libpng-1.2.22rc1/pngconf.h --- libpng-1.2.21/pngconf.h 2007-10-06 17:18:11.651376000 -0500 +++ libpng-1.2.22rc1/pngconf.h 2007-10-08 10:47:34.791069000 -0500 @@ -76,9 +76,12 @@ /* End of material added to libpng-1.2.8 */ /* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble Restored at libpng-1.2.21 */ -# define PNG_WARN_UNINITIALIZED_ROW 1 +#if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \ + !defined(PNG_WARN_UNINITIALIZED_ROW) +# define PNG_WARN_UNINITIALIZED_ROW 1 +#endif /* End of material added at libpng-1.2.19/1.2.21 */ /* This is the size of the compression buffer, and thus the size of * an IDAT chunk. Make this whatever size you feel is best for your diff -ru4N libpng-1.2.21/pngerror.c libpng-1.2.22rc1/pngerror.c --- libpng-1.2.21/pngerror.c 2007-10-06 17:18:11.763590000 -0500 +++ libpng-1.2.22rc1/pngerror.c 2007-10-08 10:47:34.901275000 -0500 @@ -1,8 +1,8 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * Last changed in libpng 1.2.20 September 7, 2007 + * Last changed in libpng 1.2.22 [%DATE%] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2007 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.) @@ -159,15 +159,15 @@ } } if (error_message == NULL) - buffer[iout] = 0; + buffer[iout] = '\0'; else { buffer[iout++] = ':'; buffer[iout++] = ' '; png_strncpy(buffer+iout, error_message, 63); - buffer[iout+63] = 0; + buffer[iout+63] = '\0'; } } #ifdef PNG_READ_SUPPORTED diff -ru4N libpng-1.2.21/pngpread.c libpng-1.2.22rc1/pngpread.c --- libpng-1.2.21/pngpread.c 2007-10-06 17:18:11.905361000 -0500 +++ libpng-1.2.22rc1/pngpread.c 2007-10-08 10:47:35.050062000 -0500 @@ -1,8 +1,8 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.2.21 October 4, 2007 + * Last changed in libpng 1.2.22 [%DATE%] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2007 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.) @@ -1490,9 +1490,10 @@ length = (png_uint_32)65535L; } #endif png_strncpy((png_charp)png_ptr->unknown_chunk.name, - (png_charp)png_ptr->chunk_name, 5); + (png_charp)png_ptr->chunk_name, 4); + png_ptr->unknown_chunk.name[4] = '\0'; png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr, length); png_ptr->unknown_chunk.size = (png_size_t)length; png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length); #if defined(PNG_READ_USER_CHUNKS_SUPPORTED) diff -ru4N libpng-1.2.21/pngrtran.c libpng-1.2.22rc1/pngrtran.c --- libpng-1.2.21/pngrtran.c 2007-10-06 17:34:20.344574000 -0500 +++ libpng-1.2.22rc1/pngrtran.c 2007-10-08 10:47:35.288610000 -0500 @@ -577,9 +577,8 @@ png_debug(1, "in png_set_palette_to_rgb\n"); if(png_ptr == NULL) return; png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); #ifdef PNG_WARN_UNINITIALIZED_ROW - png_ptr->flags &= !(PNG_FLAG_ROW_INIT); png_ptr->flags &= ~PNG_FLAG_ROW_INIT; #endif } @@ -857,9 +856,9 @@ if (png_ptr->trans[i] != 0 && png_ptr->trans[i] != 0xff) k=1; /* partial transparency is present */ } if (k == 0) - png_ptr->transformations &= ~(PNG_GAMMA); + png_ptr->transformations &= ~PNG_GAMMA; } if ((png_ptr->transformations & (PNG_GAMMA | PNG_RGB_TO_GRAY)) && png_ptr->gamma != 0.0) diff -ru4N libpng-1.2.21/pngrutil.c libpng-1.2.22rc1/pngrutil.c --- libpng-1.2.21/pngrutil.c 2007-10-06 17:18:12.262096000 -0500 +++ libpng-1.2.22rc1/pngrutil.c 2007-10-08 10:47:35.400843000 -0500 @@ -1,8 +1,8 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.2.21 October 4, 2007 + * Last changed in libpng 1.2.22 [%DATE%] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2007 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.) @@ -2223,9 +2223,10 @@ length = (png_uint_32)65535L; } #endif png_strncpy((png_charp)png_ptr->unknown_chunk.name, - (png_charp)png_ptr->chunk_name, 5); + (png_charp)png_ptr->chunk_name, 4); + png_ptr->unknown_chunk.name[4] = '\0'; png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr, length); png_ptr->unknown_chunk.size = (png_size_t)length; png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length); #if defined(PNG_READ_USER_CHUNKS_SUPPORTED) diff -ru4N libpng-1.2.21/pngset.c libpng-1.2.22rc1/pngset.c --- libpng-1.2.21/pngset.c 2007-10-07 16:56:56.062965000 -0500 +++ libpng-1.2.22rc1/pngset.c 2007-10-08 10:47:35.462755000 -0500 @@ -1,8 +1,8 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.2.21 [%DATE%] + * Last changed in libpng 1.2.22 [%DATE%] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2007 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.) @@ -689,9 +689,10 @@ { png_warning(png_ptr, "Insufficient memory to process iCCP chunk."); return; } - png_strncpy(new_iccp_name, name, png_strlen(new_iccp_name)+1); + png_strncpy(new_iccp_name, name, png_strlen(name)); + new_iccp_name[png_strlen(name)] = '\0'; new_iccp_profile = (png_charp)png_malloc_warn(png_ptr, proflen); if (new_iccp_profile == NULL) { png_free (png_ptr, new_iccp_name); @@ -979,9 +980,10 @@ png_warning(png_ptr, "Out of memory while processing sPLT chunk"); } /* TODO: use png_malloc_warn */ - png_strncpy(to->name, from->name, png_strlen(from->name)+1); + png_strncpy(to->name, from->name, png_strlen(from->name)); + to->name[png_strlen(from->name)] = '\0'; to->entries = (png_sPLT_entryp)png_malloc_warn(png_ptr, from->nentries * png_sizeof(png_sPLT_entry)); /* TODO: use png_malloc_warn */ png_memcpy(to->entries, from->entries, @@ -1036,9 +1038,10 @@ { png_unknown_chunkp to = np + info_ptr->unknown_chunks_num + i; png_unknown_chunkp from = unknowns + i; - png_strncpy((png_charp)to->name, (png_charp)from->name, 5); + png_strncpy((png_charp)to->name, (png_charp)from->name, 4); + to->name[4] = '\0'; to->data = (png_bytep)png_malloc_warn(png_ptr, from->size); if (to->data == NULL) { png_warning(png_ptr, @@ -1081,9 +1084,9 @@ png_debug(1, "in png_permit_empty_plte, DEPRECATED.\n"); if (png_ptr == NULL) return; png_ptr->mng_features_permitted = (png_byte) - ((png_ptr->mng_features_permitted & (~(PNG_FLAG_MNG_EMPTY_PLTE))) | + ((png_ptr->mng_features_permitted & (~PNG_FLAG_MNG_EMPTY_PLTE)) | ((empty_plte_permitted & PNG_FLAG_MNG_EMPTY_PLTE))); } #endif #endif diff -ru4N libpng-1.2.21/pngtest.c libpng-1.2.22rc1/pngtest.c --- libpng-1.2.21/pngtest.c 2007-10-06 17:18:12.384848000 -0500 +++ libpng-1.2.22rc1/pngtest.c 2007-10-08 10:47:35.520420000 -0500 @@ -1,8 +1,8 @@ /* pngtest.c - a simple test program to test libpng * - * Last changed in libpng 1.2.6 - August 15, 2004 + * Last changed in libpng 1.2.22 - [%DATE%] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2004 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.) @@ -1005,9 +1005,10 @@ /* we have to use png_strncpy instead of "=" because the string pointed to by png_convert_to_rfc1123() gets free'ed before we use it */ png_strncpy(tIME_string,png_convert_to_rfc1123(read_ptr, - mod_time),30); + mod_time),29); + tIME_string[29] = '\0'; tIME_chunk_present++; #endif /* PNG_TIME_RFC1123_SUPPORTED */ } } @@ -1146,9 +1147,10 @@ /* we have to use png_strncpy instead of "=" because the string pointed to by png_convert_to_rfc1123() gets free'ed before we use it */ png_strncpy(tIME_string,png_convert_to_rfc1123(read_ptr, - mod_time),30); + mod_time),29); + tIME_string[29] = '\0'; tIME_chunk_present++; #endif /* PNG_TIME_RFC1123_SUPPORTED */ } }