From: Elan Ruusamäe Date: Mon, 14 Apr 2008 18:16:11 +0000 (+0000) Subject: - raw http://littlesvr.ca/apng/diff/libpng-1.2.25-apng.patch X-Git-Tag: auto/ac/libpng-1_2_26-2~6 X-Git-Url: http://git.pld-linux.org/?a=commitdiff_plain;h=e4744232e1f3b0dcfb7bfbc36202fcb4094e632c;p=packages%2Flibpng.git - raw http://littlesvr.ca/apng/diff/libpng-1.2.25-apng.patch Changed files: libpng-apng.patch -> 1.2 --- diff --git a/libpng-apng.patch b/libpng-apng.patch index 89725c0..ee6fa8d 100644 --- a/libpng-apng.patch +++ b/libpng-apng.patch @@ -1,8 +1,8 @@ Index: pngread.c =================================================================== ---- pngread.c (révision 144) +--- pngread.c (révision 149) +++ pngread.c (copie de travail) -@@ -399,6 +399,11 @@ +@@ -405,6 +405,11 @@ #if defined(PNG_READ_zTXt_SUPPORTED) PNG_CONST PNG_zTXt; #endif @@ -14,7 +14,7 @@ Index: pngread.c #endif /* PNG_USE_LOCAL_ARRAYS */ png_byte chunk_length[4]; png_uint_32 length; -@@ -452,6 +457,9 @@ +@@ -458,6 +463,9 @@ !(png_ptr->mode & PNG_HAVE_PLTE)) png_error(png_ptr, "Missing PLTE before IDAT"); @@ -24,7 +24,7 @@ Index: pngread.c png_ptr->idat_size = length; png_ptr->mode |= PNG_HAVE_IDAT; break; -@@ -524,12 +532,97 @@ +@@ -530,12 +538,97 @@ else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4)) png_handle_iTXt(png_ptr, info_ptr, length); #endif @@ -122,7 +122,7 @@ Index: pngread.c /* optional call to update the users info_ptr structure */ void PNGAPI png_read_update_info(png_structp png_ptr, png_infop info_ptr) -@@ -566,6 +659,10 @@ +@@ -572,6 +665,10 @@ { #ifdef PNG_USE_LOCAL_ARRAYS PNG_CONST PNG_IDAT; @@ -133,7 +133,7 @@ Index: pngread.c PNG_CONST int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; PNG_CONST int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; -@@ -695,19 +792,46 @@ +@@ -701,19 +798,46 @@ { if (!(png_ptr->zstream.avail_in)) { @@ -186,7 +186,7 @@ Index: pngread.c } png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size; png_ptr->zstream.next_in = png_ptr->zbuf; -@@ -725,6 +849,9 @@ +@@ -731,6 +855,9 @@ png_error(png_ptr, "Extra compressed data"); png_ptr->mode |= PNG_AFTER_IDAT; png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; @@ -196,7 +196,7 @@ Index: pngread.c break; } if (ret != Z_OK) -@@ -979,6 +1106,11 @@ +@@ -985,6 +1112,11 @@ #if defined(PNG_READ_zTXt_SUPPORTED) PNG_CONST PNG_zTXt; #endif @@ -208,7 +208,7 @@ Index: pngread.c #endif /* PNG_USE_LOCAL_ARRAYS */ png_read_data(png_ptr, chunk_length, 4); -@@ -1085,6 +1217,14 @@ +@@ -1091,6 +1223,14 @@ else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4)) png_handle_iTXt(png_ptr, info_ptr, length); #endif @@ -223,23 +223,9 @@ Index: pngread.c else png_handle_unknown(png_ptr, info_ptr, length); } while (!(png_ptr->mode & PNG_HAVE_IEND)); -Index: png.c -=================================================================== ---- png.c (révision 144) -+++ png.c (copie de travail) -@@ -51,6 +51,9 @@ - PNG_tIME; - PNG_tRNS; - PNG_zTXt; -+PNG_acTL; -+PNG_fcTL; -+PNG_fdAT; - - #ifdef PNG_READ_SUPPORTED - /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ Index: pngget.c =================================================================== ---- pngget.c (révision 144) +--- pngget.c (révision 149) +++ pngget.c (copie de travail) @@ -797,6 +797,167 @@ } @@ -409,11 +395,25 @@ Index: pngget.c #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) png_uint_32 PNGAPI png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr, +Index: png.c +=================================================================== +--- png.c (révision 149) ++++ png.c (copie de travail) +@@ -51,6 +51,9 @@ + PNG_tIME; + PNG_tRNS; + PNG_zTXt; ++PNG_acTL; ++PNG_fcTL; ++PNG_fdAT; + + #ifdef PNG_READ_SUPPORTED + /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ Index: png.h =================================================================== ---- png.h (révision 144) +--- png.h (révision 149) +++ png.h (copie de travail) -@@ -947,6 +947,19 @@ +@@ -949,6 +949,19 @@ png_fixed_point int_y_blue; #endif @@ -433,7 +433,7 @@ Index: png.h } png_info; typedef png_info FAR * png_infop; -@@ -1048,6 +1061,8 @@ +@@ -1050,6 +1063,8 @@ #define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ #define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ #define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */ @@ -442,7 +442,7 @@ Index: png.h /* This is used for the transformation routines, as some of them * change these values for the row. It also should enable using -@@ -1088,7 +1103,11 @@ +@@ -1090,7 +1105,11 @@ typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop)); typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep, png_uint_32, int)); @@ -454,7 +454,7 @@ Index: png.h #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ -@@ -1419,6 +1438,39 @@ +@@ -1421,6 +1440,39 @@ png_uint_32 user_height_max; #endif @@ -494,7 +494,7 @@ Index: png.h /* New member added in libpng-1.0.25 and 1.2.17 */ #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) /* storage for unknown chunk that the library doesn't recognize. */ -@@ -1745,6 +1797,18 @@ +@@ -1747,6 +1799,18 @@ extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr, png_bytepp image)); @@ -513,7 +513,7 @@ Index: png.h /* writes the end of the PNG file. */ extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr, png_infop info_ptr)); -@@ -1993,6 +2057,11 @@ +@@ -1995,6 +2059,11 @@ png_voidp progressive_ptr, png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn)); @@ -525,7 +525,7 @@ Index: png.h /* returns the user pointer associated with the push read functions */ extern PNG_EXPORT(png_voidp,png_get_progressive_ptr) -@@ -2430,6 +2499,59 @@ +@@ -2432,6 +2501,59 @@ #endif #endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ @@ -585,7 +585,7 @@ Index: png.h #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) /* provide a list of chunks and how they are to be handled, if the built-in handling or default unknown chunk handling is not desired. Any chunks not -@@ -2736,6 +2858,8 @@ +@@ -2738,6 +2860,8 @@ #define PNG_BACKGROUND_IS_GRAY 0x800 #define PNG_HAVE_PNG_SIGNATURE 0x1000 #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ @@ -594,7 +594,7 @@ Index: png.h /* flags for the transformations the PNG library does on the image data */ #define PNG_BGR 0x0001 -@@ -2876,6 +3000,9 @@ +@@ -2878,6 +3002,9 @@ #define PNG_tIME png_byte png_tIME[5] = {116, 73, 77, 69, '\0'} #define PNG_tRNS png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'} #define PNG_zTXt png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'} @@ -604,7 +604,7 @@ Index: png.h #ifdef PNG_USE_GLOBAL_ARRAYS PNG_EXPORT_VAR (png_byte FARDATA) png_IHDR[5]; -@@ -2899,6 +3026,9 @@ +@@ -2901,6 +3028,9 @@ PNG_EXPORT_VAR (png_byte FARDATA) png_tIME[5]; PNG_EXPORT_VAR (png_byte FARDATA) png_tRNS[5]; PNG_EXPORT_VAR (png_byte FARDATA) png_zTXt[5]; @@ -614,7 +614,7 @@ Index: png.h #endif /* PNG_USE_GLOBAL_ARRAYS */ #if defined(PNG_1_0_X) || defined (PNG_1_2_X) -@@ -3173,6 +3303,17 @@ +@@ -3175,6 +3305,17 @@ #endif #endif @@ -632,7 +632,7 @@ Index: png.h /* Called when finished processing a row of data */ PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)); -@@ -3224,6 +3365,20 @@ +@@ -3226,6 +3367,20 @@ PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr, png_infop info_ptr)); @@ -653,7 +653,7 @@ Index: png.h /* these are the functions that do the transformations */ #if defined(PNG_READ_FILLER_SUPPORTED) PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info, -@@ -3439,6 +3594,18 @@ +@@ -3441,6 +3596,18 @@ png_uint_32 length)); #endif @@ -674,7 +674,7 @@ Index: png.h Index: pngtrans.c =================================================================== ---- pngtrans.c (révision 144) +--- pngtrans.c (révision 149) +++ pngtrans.c (copie de travail) @@ -652,11 +652,10 @@ png_voidp PNGAPI @@ -690,37 +690,9 @@ Index: pngtrans.c + return (NULL); } #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ -Index: pngconf.h -=================================================================== ---- pngconf.h (révision 144) -+++ pngconf.h (copie de travail) -@@ -925,6 +925,10 @@ - # define PNG_READ_zTXt_SUPPORTED - # define PNG_zTXt_SUPPORTED - #endif -+#ifndef PNG_NO_READ_APNG -+# define PNG_READ_APNG_SUPPORTED -+# define PNG_APNG_SUPPORTED -+#endif - #ifndef PNG_NO_READ_UNKNOWN_CHUNKS - # define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED - # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -@@ -1067,6 +1071,12 @@ - # define PNG_zTXt_SUPPORTED - # endif - #endif -+#ifndef PNG_NO_WRITE_APNG -+# define PNG_WRITE_APNG_SUPPORTED -+# ifndef PNG_APNG_SUPPORTED -+# define PNG_APNG_SUPPORTED -+# endif -+#endif - #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS - # define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED - # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED Index: pngwrite.c =================================================================== ---- pngwrite.c (révision 144) +--- pngwrite.c (révision 149) +++ pngwrite.c (copie de travail) @@ -261,6 +261,10 @@ } @@ -744,7 +716,7 @@ Index: pngwrite.c /* see if user wants us to write information chunks */ if (info_ptr != NULL) -@@ -1513,4 +1521,39 @@ +@@ -1527,4 +1535,39 @@ params = params; } #endif @@ -784,167 +756,37 @@ Index: pngwrite.c +#endif /* PNG_WRITE_APNG_SUPPORTED */ + #endif /* PNG_WRITE_SUPPORTED */ -Index: pngset.c +Index: pngconf.h =================================================================== ---- pngset.c (révision 144) -+++ pngset.c (copie de travail) -@@ -364,6 +364,11 @@ - info_ptr->rowbytes = (png_size_t)0; - else - info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth,width); -+ -+#if defined(PNG_APNG_SUPPORTED) -+ /* for non-animated png. this may be overritten from an acTL chunk later */ -+ info_ptr->num_frames = 1; +--- pngconf.h (révision 149) ++++ pngconf.h (copie de travail) +@@ -925,6 +925,10 @@ + # define PNG_READ_zTXt_SUPPORTED + # define PNG_zTXt_SUPPORTED + #endif ++#ifndef PNG_NO_READ_APNG ++# define PNG_READ_APNG_SUPPORTED ++# define PNG_APNG_SUPPORTED +#endif - } - - #if defined(PNG_oFFs_SUPPORTED) -@@ -1009,6 +1014,141 @@ - } - #endif /* PNG_sPLT_SUPPORTED */ - -+#if defined(PNG_APNG_SUPPORTED) -+png_uint_32 PNGAPI -+png_set_acTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 num_frames, png_uint_32 num_plays) -+{ -+ png_debug1(1, "in %s storage function\n", "acTL"); -+ -+ if (png_ptr == NULL || info_ptr == NULL) -+ { -+ png_warning(png_ptr, -+ "Call to png_set_acTL() with NULL png_ptr " -+ "or info_ptr ignored"); -+ return (0); -+ } -+ if (num_frames == 0) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_frames zero"); -+ return (0); -+ } -+ if (num_frames > PNG_UINT_31_MAX) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_frames > 2^31-1"); -+ return (0); -+ } -+ if (num_plays > PNG_UINT_31_MAX) -+ { -+ png_warning(png_ptr, -+ "Ignoring attempt to set acTL with num_plays " -+ "> 2^31-1"); -+ return (0); -+ } -+ -+ info_ptr->num_frames = num_frames; -+ info_ptr->num_plays = num_plays; -+ -+ info_ptr->valid |= PNG_INFO_acTL; -+ -+ return (1); -+} -+ -+/* delay_num and delay_den can hold any 16-bit values including zero */ -+png_uint_32 PNGAPI -+png_set_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op) -+{ -+ png_debug1(1, "in %s storage function\n", "fcTL"); -+ -+ if (png_ptr == NULL || info_ptr == NULL) -+ { -+ png_warning(png_ptr, -+ "Call to png_set_fcTL() with NULL png_ptr or info_ptr " -+ "ignored"); -+ return (0); -+ } -+ -+ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, -+ delay_num, delay_den, dispose_op, blend_op); -+ -+ info_ptr->next_frame_width = width; -+ info_ptr->next_frame_height = height; -+ info_ptr->next_frame_x_offset = x_offset; -+ info_ptr->next_frame_y_offset = y_offset; -+ info_ptr->next_frame_delay_num = delay_num; -+ info_ptr->next_frame_delay_den = delay_den; -+ info_ptr->next_frame_dispose_op = dispose_op; -+ info_ptr->next_frame_blend_op = blend_op; -+ -+ info_ptr->valid |= PNG_INFO_fcTL; -+ -+ return (1); -+} -+ -+void /* PRIVATE */ -+png_ensure_fcTL_is_valid(png_structp png_ptr, -+ png_uint_32 width, png_uint_32 height, -+ png_uint_32 x_offset, png_uint_32 y_offset, -+ png_uint_16 delay_num, png_uint_16 delay_den, -+ png_byte dispose_op, png_byte blend_op) -+{ -+ if (width + x_offset > png_ptr->first_frame_width || -+ height + y_offset > png_ptr->first_frame_height) -+ png_error(png_ptr, "dimensions of a frame are greater than" -+ "the ones in IHDR"); -+ if (width > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid width in fcTL (> 2^31-1)"); -+ if (height > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid height in fcTL (> 2^31-1)"); -+ if (x_offset > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid x_offset in fcTL (> 2^31-1)"); -+ if (y_offset > PNG_UINT_31_MAX) -+ png_error(png_ptr, "invalid y_offset in fcTL (> 2^31-1)"); -+ -+ if (dispose_op != PNG_DISPOSE_OP_NONE && -+ dispose_op != PNG_DISPOSE_OP_BACKGROUND && -+ dispose_op != PNG_DISPOSE_OP_PREVIOUS) -+ png_error(png_ptr, "invalid dispose_op in fcTL"); -+ -+ if (blend_op != PNG_BLEND_OP_SOURCE && -+ blend_op != PNG_BLEND_OP_OVER) -+ png_error(png_ptr, "invalid blend_op in fcTL"); -+ -+ if (blend_op == PNG_BLEND_OP_OVER) { -+ if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) -+ png_error(png_ptr, "PNG_BLEND_OP_OVER is not valid for " -+ "color type 'greyscale without alpha'"); -+ else if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) && -+ !(png_ptr->color_type & PNG_COLOR_MASK_ALPHA)) -+ png_error(png_ptr, "PNG_BLEND_OP_OVER is not valid for " -+ "color type 'truecolor without alpha'"); -+ } -+} -+ -+png_uint_32 PNGAPI -+png_set_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr, -+ png_byte is_hidden) -+{ -+ png_debug(1, "in png_first_frame_is_hidden()\n"); -+ -+ if (png_ptr == NULL) -+ return 0; -+ -+ if(is_hidden) -+ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; -+ else -+ png_ptr->apng_flags &= ~PNG_FIRST_FRAME_HIDDEN; -+ -+ return 1; -+} -+#endif /* PNG_APNG_SUPPORTED */ -+ - #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - void PNGAPI - png_set_unknown_chunks(png_structp png_ptr, + #ifndef PNG_NO_READ_UNKNOWN_CHUNKS + # define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED + # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED +@@ -1067,6 +1071,12 @@ + # define PNG_zTXt_SUPPORTED + # endif + #endif ++#ifndef PNG_NO_WRITE_APNG ++# define PNG_WRITE_APNG_SUPPORTED ++# ifndef PNG_APNG_SUPPORTED ++# define PNG_APNG_SUPPORTED ++# endif ++#endif + #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS + # define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED + # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED Index: pngpread.c =================================================================== ---- pngpread.c (révision 144) +--- pngpread.c (révision 149) +++ pngpread.c (copie de travail) @@ -192,6 +192,11 @@ #if defined(PNG_READ_zTXt_SUPPORTED) @@ -1191,7 +1033,7 @@ Index: pngpread.c } if (png_ptr->idat_size && png_ptr->save_buffer_size) { -@@ -1577,6 +1759,17 @@ +@@ -1582,6 +1764,17 @@ png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); } @@ -1209,9 +1051,167 @@ Index: pngpread.c png_voidp PNGAPI png_get_progressive_ptr(png_structp png_ptr) { +Index: pngset.c +=================================================================== +--- pngset.c (révision 149) ++++ pngset.c (copie de travail) +@@ -364,6 +364,11 @@ + info_ptr->rowbytes = (png_size_t)0; + else + info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth,width); ++ ++#if defined(PNG_APNG_SUPPORTED) ++ /* for non-animated png. this may be overritten from an acTL chunk later */ ++ info_ptr->num_frames = 1; ++#endif + } + + #if defined(PNG_oFFs_SUPPORTED) +@@ -1012,6 +1017,141 @@ + } + #endif /* PNG_sPLT_SUPPORTED */ + ++#if defined(PNG_APNG_SUPPORTED) ++png_uint_32 PNGAPI ++png_set_acTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 num_frames, png_uint_32 num_plays) ++{ ++ png_debug1(1, "in %s storage function\n", "acTL"); ++ ++ if (png_ptr == NULL || info_ptr == NULL) ++ { ++ png_warning(png_ptr, ++ "Call to png_set_acTL() with NULL png_ptr " ++ "or info_ptr ignored"); ++ return (0); ++ } ++ if (num_frames == 0) ++ { ++ png_warning(png_ptr, ++ "Ignoring attempt to set acTL with num_frames zero"); ++ return (0); ++ } ++ if (num_frames > PNG_UINT_31_MAX) ++ { ++ png_warning(png_ptr, ++ "Ignoring attempt to set acTL with num_frames > 2^31-1"); ++ return (0); ++ } ++ if (num_plays > PNG_UINT_31_MAX) ++ { ++ png_warning(png_ptr, ++ "Ignoring attempt to set acTL with num_plays " ++ "> 2^31-1"); ++ return (0); ++ } ++ ++ info_ptr->num_frames = num_frames; ++ info_ptr->num_plays = num_plays; ++ ++ info_ptr->valid |= PNG_INFO_acTL; ++ ++ return (1); ++} ++ ++/* delay_num and delay_den can hold any 16-bit values including zero */ ++png_uint_32 PNGAPI ++png_set_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op) ++{ ++ png_debug1(1, "in %s storage function\n", "fcTL"); ++ ++ if (png_ptr == NULL || info_ptr == NULL) ++ { ++ png_warning(png_ptr, ++ "Call to png_set_fcTL() with NULL png_ptr or info_ptr " ++ "ignored"); ++ return (0); ++ } ++ ++ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, ++ delay_num, delay_den, dispose_op, blend_op); ++ ++ info_ptr->next_frame_width = width; ++ info_ptr->next_frame_height = height; ++ info_ptr->next_frame_x_offset = x_offset; ++ info_ptr->next_frame_y_offset = y_offset; ++ info_ptr->next_frame_delay_num = delay_num; ++ info_ptr->next_frame_delay_den = delay_den; ++ info_ptr->next_frame_dispose_op = dispose_op; ++ info_ptr->next_frame_blend_op = blend_op; ++ ++ info_ptr->valid |= PNG_INFO_fcTL; ++ ++ return (1); ++} ++ ++void /* PRIVATE */ ++png_ensure_fcTL_is_valid(png_structp png_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op) ++{ ++ if (width + x_offset > png_ptr->first_frame_width || ++ height + y_offset > png_ptr->first_frame_height) ++ png_error(png_ptr, "dimensions of a frame are greater than" ++ "the ones in IHDR"); ++ if (width > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid width in fcTL (> 2^31-1)"); ++ if (height > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid height in fcTL (> 2^31-1)"); ++ if (x_offset > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid x_offset in fcTL (> 2^31-1)"); ++ if (y_offset > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid y_offset in fcTL (> 2^31-1)"); ++ ++ if (dispose_op != PNG_DISPOSE_OP_NONE && ++ dispose_op != PNG_DISPOSE_OP_BACKGROUND && ++ dispose_op != PNG_DISPOSE_OP_PREVIOUS) ++ png_error(png_ptr, "invalid dispose_op in fcTL"); ++ ++ if (blend_op != PNG_BLEND_OP_SOURCE && ++ blend_op != PNG_BLEND_OP_OVER) ++ png_error(png_ptr, "invalid blend_op in fcTL"); ++ ++ if (blend_op == PNG_BLEND_OP_OVER) { ++ if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) ++ png_error(png_ptr, "PNG_BLEND_OP_OVER is not valid for " ++ "color type 'greyscale without alpha'"); ++ else if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) && ++ !(png_ptr->color_type & PNG_COLOR_MASK_ALPHA)) ++ png_error(png_ptr, "PNG_BLEND_OP_OVER is not valid for " ++ "color type 'truecolor without alpha'"); ++ } ++} ++ ++png_uint_32 PNGAPI ++png_set_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr, ++ png_byte is_hidden) ++{ ++ png_debug(1, "in png_first_frame_is_hidden()\n"); ++ ++ if (png_ptr == NULL) ++ return 0; ++ ++ if(is_hidden) ++ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; ++ else ++ png_ptr->apng_flags &= ~PNG_FIRST_FRAME_HIDDEN; ++ ++ return 1; ++} ++#endif /* PNG_APNG_SUPPORTED */ ++ + #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + void PNGAPI + png_set_unknown_chunks(png_structp png_ptr, Index: pngrutil.c =================================================================== ---- pngrutil.c (révision 144) +--- pngrutil.c (révision 149) +++ pngrutil.c (copie de travail) @@ -374,6 +374,11 @@ filter_type = buf[11]; @@ -1492,7 +1492,7 @@ Index: pngrutil.c #endif /* PNG_READ_SUPPORTED */ Index: pngwutil.c =================================================================== ---- pngwutil.c (révision 144) +--- pngwutil.c (révision 149) +++ pngwutil.c (copie de travail) @@ -496,6 +496,11 @@ /* write the chunk */ @@ -1669,9 +1669,9 @@ Index: pngwutil.c #endif /* PNG_WRITE_SUPPORTED */ Index: pngrtran.c =================================================================== ---- pngrtran.c (révision 144) +--- pngrtran.c (révision 149) +++ pngrtran.c (copie de travail) -@@ -1278,7 +1278,7 @@ +@@ -1293,7 +1293,7 @@ * or png_read_update_info() after setting transforms that expand * pixels. This check added to libpng-1.2.19 */ #if (PNG_WARN_UNINITIALIZED_ROW==1)