From 1743c957e734aeb82aa44a386ccbff7f25817340 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sun, 14 Dec 2014 15:29:28 -0500 Subject: [PATCH] Upgrade to libpng-1.6.15 --- config/packages-list | 2 +- ....3-apng.patch => libpng-1.6.15-apng.patch} | 205 +++++++++--------- 2 files changed, 103 insertions(+), 104 deletions(-) rename stage3/patches/common/{libpng-1.6.3-apng.patch => libpng-1.6.15-apng.patch} (92%) diff --git a/config/packages-list b/config/packages-list index f017549..68246b2 100644 --- a/config/packages-list +++ b/config/packages-list @@ -229,7 +229,7 @@ LIBOIL="liboil-0.3.17" LIBOPENJPEG="openjpeg-1.5.0" LIBPCAP="libpcap-1.3.0" LIBPIPELINE="libpipeline-1.4.0" -LIBPNG="libpng-1.6.3" +LIBPNG="libpng-1.6.15" LIBPTHREAD_STUBS="libpthread-stubs-0.3" LIBRSVG="librsvg-2.36.3" LIBSAMPLERATE="libsamplerate-0.1.8" diff --git a/stage3/patches/common/libpng-1.6.3-apng.patch b/stage3/patches/common/libpng-1.6.15-apng.patch similarity index 92% rename from stage3/patches/common/libpng-1.6.3-apng.patch rename to stage3/patches/common/libpng-1.6.15-apng.patch index ece9249..e783e76 100644 --- a/stage3/patches/common/libpng-1.6.3-apng.patch +++ b/stage3/patches/common/libpng-1.6.15-apng.patch @@ -1,7 +1,7 @@ -diff -Naru libpng-1.6.3.org/png.h libpng-1.6.3/png.h ---- libpng-1.6.3.org/png.h 2013-07-20 04:16:56.000000000 +0900 -+++ libpng-1.6.3/png.h 2013-07-20 04:33:18.000000000 +0900 -@@ -440,6 +440,10 @@ +diff -Naru libpng-1.6.15.org/png.h libpng-1.6.15/png.h +--- libpng-1.6.15.org/png.h 2014-11-21 22:01:00.976984872 +0900 ++++ libpng-1.6.15/png.h 2014-11-21 22:01:01.049987206 +0900 +@@ -473,6 +473,10 @@ # include "pnglibconf.h" #endif @@ -12,7 +12,7 @@ diff -Naru libpng-1.6.3.org/png.h libpng-1.6.3/png.h #ifndef PNG_VERSION_INFO_ONLY /* Machine specific configuration. */ # include "pngconf.h" -@@ -530,6 +534,17 @@ +@@ -563,6 +567,17 @@ * See pngconf.h for base types that vary by machine/system */ @@ -30,7 +30,7 @@ diff -Naru libpng-1.6.3.org/png.h libpng-1.6.3/png.h /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ -@@ -849,6 +864,10 @@ +@@ -883,6 +898,10 @@ #define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ #define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ #define PNG_INFO_IDAT 0x8000 /* ESR, 1.0.6 */ @@ -41,7 +41,7 @@ diff -Naru libpng-1.6.3.org/png.h libpng-1.6.3/png.h /* This is used for the transformation routines, as some of them * change these values for the row. It also should enable using -@@ -886,6 +905,10 @@ +@@ -920,6 +939,10 @@ #ifdef PNG_PROGRESSIVE_READ_SUPPORTED typedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop)); typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop)); @@ -52,9 +52,9 @@ diff -Naru libpng-1.6.3.org/png.h libpng-1.6.3/png.h /* The following callback receives png_uint_32 row_number, int pass for the * png_bytep data of the row. When transforming an interlaced image the -@@ -3288,6 +3311,74 @@ +@@ -3258,6 +3281,74 @@ /******************************************************************************* - * END OF HARDWARE OPTIONS + * END OF HARDWARE AND SOFTWARE OPTIONS ******************************************************************************/ +#ifdef PNG_APNG_SUPPORTED +PNG_EXPORT(245, png_uint_32, png_get_acTL, (png_structp png_ptr, @@ -125,10 +125,10 @@ diff -Naru libpng-1.6.3.org/png.h libpng-1.6.3/png.h +#endif /* PNG_WRITE_APNG_SUPPORTED */ +#endif /* PNG_APNG_SUPPORTED */ - /* Maintainer: Put new public prototypes here ^, in libpng.3, and project - * defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt -@@ -3298,7 +3389,11 @@ - * scripts/symbols.def as well. + /* Maintainer: Put new public prototypes here ^, in libpng.3, in project + * defs, and in scripts/symbols.def. +@@ -3267,7 +3358,11 @@ + * one to use is one more than this.) */ #ifdef PNG_EXPORT_LAST_ORDINAL +#ifdef PNG_APNG_SUPPORTED @@ -139,10 +139,10 @@ diff -Naru libpng-1.6.3.org/png.h libpng-1.6.3/png.h #endif #ifdef __cplusplus -diff -Naru libpng-1.6.3.org/pngget.c libpng-1.6.3/pngget.c ---- libpng-1.6.3.org/pngget.c 2013-07-20 04:14:38.000000000 +0900 -+++ libpng-1.6.3/pngget.c 2013-07-20 04:33:18.000000000 +0900 -@@ -1174,4 +1174,166 @@ +diff -Naru libpng-1.6.15.org/pngget.c libpng-1.6.15/pngget.c +--- libpng-1.6.15.org/pngget.c 2014-11-21 22:01:00.977984904 +0900 ++++ libpng-1.6.15/pngget.c 2014-11-21 22:01:01.050987238 +0900 +@@ -1210,4 +1210,166 @@ # endif #endif @@ -308,10 +308,10 @@ diff -Naru libpng-1.6.3.org/pngget.c libpng-1.6.3/pngget.c + return 0; +} +#endif /* PNG_APNG_SUPPORTED */ - #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ -diff -Naru libpng-1.6.3.org/pnginfo.h libpng-1.6.3/pnginfo.h ---- libpng-1.6.3.org/pnginfo.h 2013-07-20 04:14:38.000000000 +0900 -+++ libpng-1.6.3/pnginfo.h 2013-07-20 04:33:18.000000000 +0900 + #endif /* READ || WRITE */ +diff -Naru libpng-1.6.15.org/pnginfo.h libpng-1.6.15/pnginfo.h +--- libpng-1.6.15.org/pnginfo.h 2014-11-21 22:01:00.977984904 +0900 ++++ libpng-1.6.15/pnginfo.h 2014-11-21 22:01:01.050987238 +0900 @@ -256,5 +256,18 @@ png_bytepp row_pointers; /* the image bits */ #endif @@ -331,10 +331,10 @@ diff -Naru libpng-1.6.3.org/pnginfo.h libpng-1.6.3/pnginfo.h + }; #endif /* PNGINFO_H */ -diff -Naru libpng-1.6.3.org/pngpread.c libpng-1.6.3/pngpread.c ---- libpng-1.6.3.org/pngpread.c 2013-07-20 04:16:56.000000000 +0900 -+++ libpng-1.6.3/pngpread.c 2013-07-20 04:33:18.000000000 +0900 -@@ -217,6 +217,109 @@ +diff -Naru libpng-1.6.15.org/pngpread.c libpng-1.6.15/pngpread.c +--- libpng-1.6.15.org/pngpread.c 2014-11-21 22:01:00.977984904 +0900 ++++ libpng-1.6.15/pngpread.c 2014-11-21 22:01:01.051987269 +0900 +@@ -219,6 +219,109 @@ chunk_name = png_ptr->chunk_name; @@ -443,8 +443,8 @@ diff -Naru libpng-1.6.3.org/pngpread.c libpng-1.6.3/pngpread.c + if (chunk_name == png_IDAT) { - if (png_ptr->mode & PNG_AFTER_IDAT) -@@ -299,6 +402,9 @@ + if ((png_ptr->mode & PNG_AFTER_IDAT) != 0) +@@ -283,6 +386,9 @@ else if (chunk_name == png_IDAT) { @@ -454,9 +454,9 @@ diff -Naru libpng-1.6.3.org/pngpread.c libpng-1.6.3/pngpread.c png_ptr->idat_size = png_ptr->push_length; png_ptr->process_mode = PNG_READ_IDAT_MODE; png_push_have_info(png_ptr, info_ptr); -@@ -530,6 +636,31 @@ +@@ -428,6 +534,30 @@ + png_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length); } - #endif +#ifdef PNG_READ_APNG_SUPPORTED + else if (chunk_name == png_acTL) @@ -482,23 +482,22 @@ diff -Naru libpng-1.6.3.org/pngpread.c libpng-1.6.3/pngpread.c + } + +#endif /* PNG_READ_APNG_SUPPORTED */ -+ + else { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) -@@ -731,7 +862,11 @@ +@@ -623,7 +753,11 @@ png_byte chunk_tag[4]; /* TODO: this code can be commoned up with the same code in push_read */ +#ifdef PNG_READ_APNG_SUPPORTED -+ if (png_ptr->buffer_size < 12) ++ PNG_PUSH_SAVE_BUFFER_IF_LT(12) +#else - if (png_ptr->buffer_size < 8) + PNG_PUSH_SAVE_BUFFER_IF_LT(8) +#endif - { - png_push_save_buffer(png_ptr); - return; -@@ -744,17 +879,64 @@ + png_push_fill_buffer(png_ptr, chunk_length, 4); + png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length); + png_reset_crc(png_ptr); +@@ -631,17 +765,64 @@ png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag); png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; @@ -539,7 +538,7 @@ diff -Naru libpng-1.6.3.org/pngpread.c libpng-1.6.3/pngpread.c { png_ptr->process_mode = PNG_READ_CHUNK_MODE; - if (!(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED)) + if ((png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0) png_error(png_ptr, "Not enough compressed data"); +#ifdef PNG_READ_APNG_SUPPORTED @@ -562,8 +561,8 @@ diff -Naru libpng-1.6.3.org/pngpread.c libpng-1.6.3/pngpread.c +#endif } - if (png_ptr->idat_size && png_ptr->save_buffer_size) -@@ -832,6 +1014,15 @@ + if (png_ptr->idat_size != 0 && png_ptr->save_buffer_size != 0) +@@ -714,6 +895,15 @@ if (!(buffer_length > 0) || buffer == NULL) png_error(png_ptr, "No IDAT data (internal error)"); @@ -579,7 +578,7 @@ diff -Naru libpng-1.6.3.org/pngpread.c libpng-1.6.3/pngpread.c /* This routine must process all the data it has been given * before returning, calling the row callback as required to * handle the uncompressed results. -@@ -1280,6 +1471,18 @@ +@@ -1157,6 +1347,18 @@ png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); } @@ -598,10 +597,10 @@ diff -Naru libpng-1.6.3.org/pngpread.c libpng-1.6.3/pngpread.c png_voidp PNGAPI png_get_progressive_ptr(png_const_structrp png_ptr) { -diff -Naru libpng-1.6.3.org/pngpriv.h libpng-1.6.3/pngpriv.h ---- libpng-1.6.3.org/pngpriv.h 2013-07-20 04:16:56.000000000 +0900 -+++ libpng-1.6.3/pngpriv.h 2013-07-20 04:47:13.000000000 +0900 -@@ -502,6 +502,10 @@ +diff -Naru libpng-1.6.15.org/pngpriv.h libpng-1.6.15/pngpriv.h +--- libpng-1.6.15.org/pngpriv.h 2014-11-21 22:01:00.978984936 +0900 ++++ libpng-1.6.15/pngpriv.h 2014-11-21 22:01:01.051987269 +0900 +@@ -555,6 +555,10 @@ #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ /* 0x4000 (unused) */ #define PNG_IS_READ_STRUCT 0x8000 /* Else is a write struct */ @@ -612,7 +611,7 @@ diff -Naru libpng-1.6.3.org/pngpriv.h libpng-1.6.3/pngpriv.h /* Flags for the transformations the PNG library does on the image data */ #define PNG_BGR 0x0001 -@@ -723,6 +727,16 @@ +@@ -776,6 +780,16 @@ #define png_tRNS PNG_U32(116, 82, 78, 83) #define png_zTXt PNG_U32(122, 84, 88, 116) @@ -629,7 +628,7 @@ diff -Naru libpng-1.6.3.org/pngpriv.h libpng-1.6.3/pngpriv.h /* The following will work on (signed char*) strings, whereas the get_uint_32 * macro will fail on top-bit-set values because of the sign extension. */ -@@ -1538,6 +1552,47 @@ +@@ -1476,6 +1490,47 @@ */ #endif @@ -677,9 +676,9 @@ diff -Naru libpng-1.6.3.org/pngpriv.h libpng-1.6.3/pngpriv.h /* Added at libpng version 1.4.0 */ #ifdef PNG_COLORSPACE_SUPPORTED /* These internal functions are for maintaining the colorspace structure within -diff -Naru libpng-1.6.3.org/pngread.c libpng-1.6.3/pngread.c ---- libpng-1.6.3.org/pngread.c 2013-07-20 04:14:38.000000000 +0900 -+++ libpng-1.6.3/pngread.c 2013-07-20 04:33:18.000000000 +0900 +diff -Naru libpng-1.6.15.org/pngread.c libpng-1.6.15/pngread.c +--- libpng-1.6.15.org/pngread.c 2014-11-21 22:01:00.979984968 +0900 ++++ libpng-1.6.15/pngread.c 2014-11-21 22:01:01.052987301 +0900 @@ -158,6 +158,9 @@ else if (chunk_name == png_IDAT) @@ -710,7 +709,7 @@ diff -Naru libpng-1.6.3.org/pngread.c libpng-1.6.3/pngread.c PNG_HANDLE_CHUNK_AS_DEFAULT); @@ -254,6 +268,72 @@ } - #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */ + #endif /* SEQUENTIAL_READ */ +#ifdef PNG_READ_APNG_SUPPORTED +void PNGAPI @@ -781,10 +780,10 @@ diff -Naru libpng-1.6.3.org/pngread.c libpng-1.6.3/pngread.c /* Optional call to update the users info_ptr structure */ void PNGAPI png_read_update_info(png_structrp png_ptr, png_inforp info_ptr) -diff -Naru libpng-1.6.3.org/pngrutil.c libpng-1.6.3/pngrutil.c ---- libpng-1.6.3.org/pngrutil.c 2013-07-20 04:16:56.000000000 +0900 -+++ libpng-1.6.3/pngrutil.c 2013-07-20 04:33:18.000000000 +0900 -@@ -821,6 +821,11 @@ +diff -Naru libpng-1.6.15.org/pngrutil.c libpng-1.6.15/pngrutil.c +--- libpng-1.6.15.org/pngrutil.c 2014-11-21 22:01:00.980985000 +0900 ++++ libpng-1.6.15/pngrutil.c 2014-11-21 22:01:01.053987333 +0900 +@@ -818,6 +818,11 @@ filter_type = buf[11]; interlace_type = buf[12]; @@ -796,7 +795,7 @@ diff -Naru libpng-1.6.3.org/pngrutil.c libpng-1.6.3/pngrutil.c /* Set internal variables */ png_ptr->width = width; png_ptr->height = height; -@@ -2695,6 +2700,179 @@ +@@ -2700,6 +2705,179 @@ } #endif @@ -976,7 +975,7 @@ diff -Naru libpng-1.6.3.org/pngrutil.c libpng-1.6.3/pngrutil.c #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED /* Utility function for png_handle_unknown; set up png_ptr::unknown_chunk */ static int -@@ -3949,7 +4127,38 @@ +@@ -3958,7 +4136,38 @@ { uInt avail_in; png_bytep buffer; @@ -987,7 +986,7 @@ diff -Naru libpng-1.6.3.org/pngrutil.c libpng-1.6.3/pngrutil.c + { + png_crc_finish(png_ptr, bytes_to_skip); + bytes_to_skip = 0; - ++ + png_ptr->idat_size = png_read_chunk_header(png_ptr); + if (png_ptr->num_frames_read == 0) + { @@ -1005,7 +1004,7 @@ diff -Naru libpng-1.6.3.org/pngrutil.c libpng-1.6.3/pngrutil.c + bytes_to_skip = png_ptr->idat_size; + continue; + } -+ + + png_ensure_sequence_number(png_ptr, png_ptr->idat_size); + + png_ptr->idat_size -= 4; @@ -1015,7 +1014,7 @@ diff -Naru libpng-1.6.3.org/pngrutil.c libpng-1.6.3/pngrutil.c while (png_ptr->idat_size == 0) { png_crc_finish(png_ptr, 0); -@@ -3961,7 +4170,7 @@ +@@ -3970,7 +4179,7 @@ if (png_ptr->chunk_name != png_IDAT) png_error(png_ptr, "Not enough image data"); } @@ -1024,7 +1023,7 @@ diff -Naru libpng-1.6.3.org/pngrutil.c libpng-1.6.3/pngrutil.c avail_in = png_ptr->IDAT_read_size; if (avail_in > png_ptr->idat_size) -@@ -4024,6 +4233,9 @@ +@@ -4033,6 +4242,9 @@ png_ptr->mode |= PNG_AFTER_IDAT; png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; @@ -1034,7 +1033,7 @@ diff -Naru libpng-1.6.3.org/pngrutil.c libpng-1.6.3/pngrutil.c if (png_ptr->zstream.avail_in > 0 || png_ptr->idat_size > 0) png_chunk_benign_error(png_ptr, "Extra compressed data"); -@@ -4469,4 +4681,80 @@ +@@ -4471,4 +4683,80 @@ png_ptr->flags |= PNG_FLAG_ROW_INIT; } @@ -1114,11 +1113,11 @@ diff -Naru libpng-1.6.3.org/pngrutil.c libpng-1.6.3/pngrutil.c +} +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ +#endif /* PNG_READ_APNG_SUPPORTED */ - #endif /* PNG_READ_SUPPORTED */ -diff -Naru libpng-1.6.3.org/pngset.c libpng-1.6.3/pngset.c ---- libpng-1.6.3.org/pngset.c 2013-07-20 04:16:56.000000000 +0900 -+++ libpng-1.6.3/pngset.c 2013-07-20 04:36:15.000000000 +0900 -@@ -239,6 +239,11 @@ + #endif /* READ */ +diff -Naru libpng-1.6.15.org/pngset.c libpng-1.6.15/pngset.c +--- libpng-1.6.15.org/pngset.c 2014-11-21 22:01:00.980985000 +0900 ++++ libpng-1.6.15/pngset.c 2014-11-21 22:01:01.054987365 +0900 +@@ -240,6 +240,11 @@ info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth); info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width); @@ -1130,9 +1129,9 @@ diff -Naru libpng-1.6.3.org/pngset.c libpng-1.6.3/pngset.c } #ifdef PNG_oFFs_SUPPORTED -@@ -1065,6 +1070,147 @@ +@@ -1071,6 +1076,147 @@ } - #endif /* PNG_sPLT_SUPPORTED */ + #endif /* sPLT */ +#ifdef PNG_APNG_SUPPORTED +png_uint_32 PNGAPI @@ -1278,9 +1277,9 @@ diff -Naru libpng-1.6.3.org/pngset.c libpng-1.6.3/pngset.c #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED static png_byte check_location(png_const_structrp png_ptr, int location) -diff -Naru libpng-1.6.3.org/pngstruct.h libpng-1.6.3/pngstruct.h ---- libpng-1.6.3.org/pngstruct.h 2013-07-20 04:14:39.000000000 +0900 -+++ libpng-1.6.3/pngstruct.h 2013-07-20 04:33:18.000000000 +0900 +diff -Naru libpng-1.6.15.org/pngstruct.h libpng-1.6.15/pngstruct.h +--- libpng-1.6.15.org/pngstruct.h 2014-11-21 22:01:00.981985032 +0900 ++++ libpng-1.6.15/pngstruct.h 2014-11-21 22:01:01.054987365 +0900 @@ -409,6 +409,27 @@ png_byte filter_type; #endif @@ -1309,12 +1308,12 @@ diff -Naru libpng-1.6.3.org/pngstruct.h libpng-1.6.3/pngstruct.h /* New members added in libpng-1.2.0 */ /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ -diff -Naru libpng-1.6.3.org/pngtest.c libpng-1.6.3/pngtest.c ---- libpng-1.6.3.org/pngtest.c 2013-07-20 04:16:56.000000000 +0900 -+++ libpng-1.6.3/pngtest.c 2013-07-20 04:33:18.000000000 +0900 -@@ -838,6 +838,10 @@ +diff -Naru libpng-1.6.15.org/pngtest.c libpng-1.6.15/pngtest.c +--- libpng-1.6.15.org/pngtest.c 2014-11-21 22:01:00.981985032 +0900 ++++ libpng-1.6.15/pngtest.c 2014-11-21 22:01:01.054987365 +0900 +@@ -849,6 +849,10 @@ png_uint_32 width, height; - int num_pass, pass; + int num_pass = 1, pass; int bit_depth, color_type; +#ifdef PNG_APNG_SUPPORTED + png_uint_32 num_frames; @@ -1323,7 +1322,7 @@ diff -Naru libpng-1.6.3.org/pngtest.c libpng-1.6.3/pngtest.c row_buf = NULL; error_parameters.file_name = inname; -@@ -1288,6 +1292,20 @@ +@@ -1316,6 +1320,20 @@ } } #endif @@ -1344,7 +1343,7 @@ diff -Naru libpng-1.6.3.org/pngtest.c libpng-1.6.3/pngtest.c #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED { png_unknown_chunkp unknowns; -@@ -1353,6 +1371,89 @@ +@@ -1377,6 +1395,89 @@ t_misc += (t_stop - t_start); t_start = t_stop; #endif @@ -1434,9 +1433,9 @@ diff -Naru libpng-1.6.3.org/pngtest.c libpng-1.6.3/pngtest.c for (pass = 0; pass < num_pass; pass++) { pngtest_debug1("Writing row data for pass %d", pass); -diff -Naru libpng-1.6.3.org/pngwrite.c libpng-1.6.3/pngwrite.c ---- libpng-1.6.3.org/pngwrite.c 2013-07-20 04:14:51.000000000 +0900 -+++ libpng-1.6.3/pngwrite.c 2013-07-20 04:33:18.000000000 +0900 +diff -Naru libpng-1.6.15.org/pngwrite.c libpng-1.6.15/pngwrite.c +--- libpng-1.6.15.org/pngwrite.c 2014-11-21 22:01:00.982985064 +0900 ++++ libpng-1.6.15/pngwrite.c 2014-11-21 22:01:01.055987397 +0900 @@ -127,6 +127,10 @@ * application continues writing the PNG. So check the 'invalid' flag here * too. @@ -1447,8 +1446,8 @@ diff -Naru libpng-1.6.3.org/pngwrite.c libpng-1.6.3/pngwrite.c +#endif #ifdef PNG_GAMMA_SUPPORTED # ifdef PNG_WRITE_gAMA_SUPPORTED - if (!(info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) && -@@ -357,6 +361,11 @@ + if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && +@@ -359,6 +363,11 @@ png_benign_error(png_ptr, "Wrote palette index exceeding num_palette"); #endif @@ -1460,7 +1459,7 @@ diff -Naru libpng-1.6.3.org/pngwrite.c libpng-1.6.3/pngwrite.c /* See if user wants us to write information chunks */ if (info_ptr != NULL) { -@@ -1560,6 +1569,43 @@ +@@ -1678,6 +1687,43 @@ } #endif @@ -1504,10 +1503,10 @@ diff -Naru libpng-1.6.3.org/pngwrite.c libpng-1.6.3/pngwrite.c #ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED #ifdef PNG_STDIO_SUPPORTED /* currently required for png_image_write_* */ -diff -Naru libpng-1.6.3.org/pngwutil.c libpng-1.6.3/pngwutil.c ---- libpng-1.6.3.org/pngwutil.c 2013-07-20 04:14:39.000000000 +0900 -+++ libpng-1.6.3/pngwutil.c 2013-07-20 04:33:18.000000000 +0900 -@@ -898,6 +898,11 @@ +diff -Naru libpng-1.6.15.org/pngwutil.c libpng-1.6.15/pngwutil.c +--- libpng-1.6.15.org/pngwutil.c 2014-11-21 22:01:00.982985064 +0900 ++++ libpng-1.6.15/pngwutil.c 2014-11-21 22:01:01.056987429 +0900 +@@ -901,6 +901,11 @@ /* Write the chunk */ png_write_complete_chunk(png_ptr, png_IHDR, buf, (png_size_t)13); @@ -1516,12 +1515,12 @@ diff -Naru libpng-1.6.3.org/pngwutil.c libpng-1.6.3/pngwutil.c + png_ptr->first_frame_height = height; +#endif + - if (!(png_ptr->do_filter)) + if ((png_ptr->do_filter) == PNG_NO_FILTERS) { if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE || -@@ -1076,7 +1081,14 @@ +@@ -1079,7 +1084,14 @@ optimize_cmf(data, png_image_size(png_ptr)); - # endif + #endif +# ifdef PNG_WRITE_APNG_SUPPORTED + if (png_ptr->num_frames_written == 0) @@ -1534,9 +1533,9 @@ diff -Naru libpng-1.6.3.org/pngwutil.c libpng-1.6.3/pngwutil.c png_ptr->mode |= PNG_HAVE_IDAT; png_ptr->zstream.next_out = data; -@@ -1122,7 +1134,15 @@ - optimize_cmf(data, png_image_size(png_ptr)); - # endif +@@ -1125,7 +1137,15 @@ + optimize_cmf(data, png_image_size(png_ptr)); + #endif +# ifdef PNG_WRITE_APNG_SUPPORTED + if (png_ptr->num_frames_written == 0) @@ -1550,7 +1549,7 @@ diff -Naru libpng-1.6.3.org/pngwutil.c libpng-1.6.3/pngwutil.c png_ptr->zstream.avail_out = 0; png_ptr->zstream.next_out = NULL; png_ptr->mode |= PNG_HAVE_IDAT | PNG_AFTER_IDAT; -@@ -1934,6 +1954,82 @@ +@@ -1938,6 +1958,82 @@ } #endif @@ -1633,9 +1632,9 @@ diff -Naru libpng-1.6.3.org/pngwutil.c libpng-1.6.3/pngwutil.c /* Initializes the row writing capability of libpng */ void /* PRIVATE */ png_write_start_row(png_structrp png_ptr) -@@ -3020,4 +3116,39 @@ +@@ -3026,4 +3122,39 @@ } - #endif + #endif /* WRITE_FLUSH */ } + +#ifdef PNG_WRITE_APNG_SUPPORTED @@ -1672,10 +1671,10 @@ diff -Naru libpng-1.6.3.org/pngwutil.c libpng-1.6.3/pngwutil.c + png_ptr->usr_width = png_ptr->width; +} +#endif /* PNG_WRITE_APNG_SUPPORTED */ - #endif /* PNG_WRITE_SUPPORTED */ -diff -Naru libpng-1.6.3.org/scripts/symbols.def libpng-1.6.3/scripts/symbols.def ---- libpng-1.6.3.org/scripts/symbols.def 2013-07-20 04:16:56.000000000 +0900 -+++ libpng-1.6.3/scripts/symbols.def 2013-07-20 04:33:18.000000000 +0900 + #endif /* WRITE */ +diff -Naru libpng-1.6.15.org/scripts/symbols.def libpng-1.6.15/scripts/symbols.def +--- libpng-1.6.15.org/scripts/symbols.def 2014-11-21 22:01:00.988985256 +0900 ++++ libpng-1.6.15/scripts/symbols.def 2014-11-21 22:01:01.062987621 +0900 @@ -249,3 +249,23 @@ png_set_check_for_invalid_index @242 png_get_palette_max @243 -- 2.20.1