diff --git a/ANNOUNCE b/ANNOUNCE index f82cb5031..6b7168cb3 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.2.40beta01 - August 13, 2009 +Libpng 1.2.40beta01 - August 20, 2009 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -42,8 +42,9 @@ Other information: Changes since the last public release (1.2.39): -version 1.2.40beta01 [August 13, 2009] +version 1.2.40beta01 [August 20, 2009] Removed an extra png_debug() recently added to png_write_find_filter(). + Fixed incorrect #ifdef in pngset.c regarding unknown chunk support. Send comments/corrections/commendations to png-mng-implement at lists.sf.net diff --git a/CHANGES b/CHANGES index 594828d03..0de1b5050 100644 --- a/CHANGES +++ b/CHANGES @@ -2459,8 +2459,9 @@ version 1.2.39c01 [August 6, 2009] version 1.2.39 and 1.0.48 [August 13, 2009] No changes. -version 1.2.40beta01 [August 13, 2009] +version 1.2.40beta01 [August 20, 2009] Removed an extra png_debug() recently added to png_write_find_filter(). + Fixed incorrect #ifdef in pngset.c regarding unknown chunk support. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngset.c b/pngset.c index 3c110eba9..91d2502c3 100644 --- a/pngset.c +++ b/pngset.c @@ -1,7 +1,7 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.2.39 [August 13, 2009] + * Last changed in libpng 1.2.40 [August 20, 2009] * 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.) @@ -25,6 +25,7 @@ void PNGAPI png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p background) { png_debug1(1, "in %s storage function", "bKGD"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -41,6 +42,7 @@ png_set_cHRM(png_structp png_ptr, png_infop info_ptr, double green_x, double green_y, double blue_x, double blue_y) { png_debug1(1, "in %s storage function", "cHRM"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -74,6 +76,7 @@ png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point blue_x, png_fixed_point blue_y) { png_debug1(1, "in %s storage function", "cHRM fixed"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -112,7 +115,9 @@ void PNGAPI png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma) { double png_gamma; + png_debug1(1, "in %s storage function", "gAMA"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -140,6 +145,7 @@ png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point png_fixed_point png_gamma; png_debug1(1, "in %s storage function", "gAMA"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -177,8 +183,10 @@ png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist) int i; png_debug1(1, "in %s storage function", "hIST"); + if (png_ptr == NULL || info_ptr == NULL) return; + if (info_ptr->num_palette == 0 || info_ptr->num_palette > PNG_MAX_PALETTE_LENGTH) { @@ -221,6 +229,7 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr, int filter_type) { png_debug1(1, "in %s storage function", "IHDR"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -328,6 +337,7 @@ png_set_oFFs(png_structp png_ptr, png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y, int unit_type) { png_debug1(1, "in %s storage function", "oFFs"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -348,6 +358,7 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr, int i; png_debug1(1, "in %s storage function", "pCAL"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -417,6 +428,7 @@ png_set_sCAL(png_structp png_ptr, png_infop info_ptr, int unit, double width, double height) { png_debug1(1, "in %s storage function", "sCAL"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -435,6 +447,7 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr, png_uint_32 length; png_debug1(1, "in %s storage function", "sCAL"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -480,6 +493,7 @@ png_set_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type) { png_debug1(1, "in %s storage function", "pHYs"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -496,6 +510,7 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr, { png_debug1(1, "in %s storage function", "PLTE"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -546,6 +561,7 @@ png_set_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p sig_bit) { png_debug1(1, "in %s storage function", "sBIT"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -559,6 +575,7 @@ void PNGAPI png_set_sRGB(png_structp png_ptr, png_infop info_ptr, int intent) { png_debug1(1, "in %s storage function", "sRGB"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -586,6 +603,7 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr, int_green_y, int_blue_x, int_blue_y; #endif png_debug1(1, "in %s storage function", "sRGB_gAMA_and_cHRM"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -655,6 +673,7 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length; png_debug1(1, "in %s storage function", "iCCP"); + if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL) return; @@ -869,6 +888,7 @@ void PNGAPI png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time) { png_debug1(1, "in %s storage function", "tIME"); + if (png_ptr == NULL || info_ptr == NULL || (png_ptr->mode & PNG_WROTE_tIME)) return; @@ -884,6 +904,7 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr, png_bytep trans, int num_trans, png_color_16p trans_values) { png_debug1(1, "in %s storage function", "tRNS"); + if (png_ptr == NULL || info_ptr == NULL) return; @@ -1008,7 +1029,7 @@ png_set_sPLT(png_structp png_ptr, } #endif /* PNG_sPLT_SUPPORTED */ -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED void PNGAPI png_set_unknown_chunks(png_structp png_ptr, png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns) @@ -1088,7 +1109,9 @@ png_permit_empty_plte (png_structp png_ptr, int empty_plte_permitted) { /* This function is deprecated in favor of png_permit_mng_features() and will be removed from libpng-1.3.0 */ + png_debug(1, "in png_permit_empty_plte, DEPRECATED."); + if (png_ptr == NULL) return; png_ptr->mng_features_permitted = (png_byte) @@ -1103,6 +1126,7 @@ png_uint_32 PNGAPI png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features) { png_debug(1, "in png_permit_mng_features"); + if (png_ptr == NULL) return (png_uint_32)0; png_ptr->mng_features_permitted = @@ -1164,8 +1188,10 @@ png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn) { png_debug(1, "in png_set_read_user_chunk_fn"); + if (png_ptr == NULL) return; + png_ptr->read_user_chunk_fn = read_user_chunk_fn; png_ptr->user_chunk_ptr = user_chunk_ptr; }