diff -ru4NwbB libpng-1.5.13/Makefile.am libpng-1.5.14beta04/Makefile.am --- libpng-1.5.13/Makefile.am 2012-09-27 06:21:26.708388115 -0500 +++ libpng-1.5.14beta04/Makefile.am 2012-12-19 16:22:51.799528004 -0600 @@ -40,9 +40,10 @@ pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c\ png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa if PNG_ARM_NEON -libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/filter_neon.S +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\ + arm/filter_neon.S endif nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h @@ -196,33 +197,35 @@ cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES) # install the .../include headers as links to the new ones install-data-hook: - cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h pnglibconf.h - cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/png.h png.h - cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngconf.h \ + cd '$(DESTDIR)$(includedir)'; rm -f png.h pngconf.h pnglibconf.h + cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/png.h png.h + cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/pngconf.h \ pngconf.h - cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pnglibconf.h \ + cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/pnglibconf.h \ pnglibconf.h - cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc - cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc + cd '$(DESTDIR)$(pkgconfigdir)'; rm -f libpng.pc + cd '$(DESTDIR)$(pkgconfigdir)'; $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc # do evil things to libpng to cause libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ to be used install-exec-hook: - cd $(DESTDIR)$(bindir); rm -f libpng-config - cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config + cd '$(DESTDIR)$(bindir)'; rm -f libpng-config + cd '$(DESTDIR)$(bindir)';\ + $(LN_S) $(PNGLIB_BASENAME)-config libpng-config @set -x;\ - cd $(DESTDIR)$(libdir);\ - for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ sl dylib dll.a; do\ + cd '$(DESTDIR)$(libdir)';\ + for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@\ + sl dylib dll.a; do\ rm -f libpng.$$ext;\ if test -f $(PNGLIB_BASENAME).$$ext; then\ $(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\ fi;\ done uninstall-hook: - cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h pnglibconf.h - rm -f $(DESTDIR)$(pkgconfigdir)/libpng.pc - rm -f $(DESTDIR)$(bindir)/libpng-config - rm -f $(DESTDIR)$(libdir)/libpng.a - rm -f $(DESTDIR)$(libdir)/libpng.la - rm -f $(DESTDIR)$(libdir)/libpng.dll.a + cd '$(DESTDIR)$(includedir)'; rm -f png.h pngconf.h pnglibconf.h + rm -f '$(DESTDIR)$(pkgconfigdir)/libpng.pc' + rm -f '$(DESTDIR)$(bindir)/libpng-config' + rm -f '$(DESTDIR)$(libdir)/libpng.a' + rm -f '$(DESTDIR)$(libdir)/libpng.la' + rm -f '$(DESTDIR)$(libdir)/libpng.dll.a' diff -ru4NwbB libpng-1.5.13/arm/arm_init.c libpng-1.5.14beta04/arm/arm_init.c --- libpng-1.5.13/arm/arm_init.c 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.14beta04/arm/arm_init.c 2012-12-14 23:41:59.784275000 -0600 @@ -0,0 +1,86 @@ + +/* arm_init.c - NEON optimised filter functions + * + * Copyright (c) 2012 Glenn Randers-Pehrson + * Written by Mans Rullgard, 2011. + * Last changed in libpng 1.5.14 [(PENDING RELEASE)] + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ +#include "../pngpriv.h" + +/* __arm__ is defined by GCC, MSVC defines _M_ARM to the ARM version number */ +#if defined __linux__ && defined __arm__ +#include +#include +#include + +static int png_have_hwcap(unsigned cap) +{ + FILE *f = fopen("/proc/self/auxv", "r"); + Elf32_auxv_t aux; + int have_cap = 0; + + if (!f) + return 0; + + while (fread(&aux, sizeof(aux), 1, f) > 0) + { + if (aux.a_type == AT_HWCAP && + aux.a_un.a_val & cap) + { + have_cap = 1; + break; + } + } + + fclose(f); + + return have_cap; +} +#endif /* __linux__ && __arm__ */ + +void +png_init_filter_functions_neon(png_structp pp, unsigned int bpp) +{ +#ifdef __arm__ +#ifdef __linux__ + if (!png_have_hwcap(HWCAP_NEON)) + return; +#endif + + /* IMPORTANT: any new external functions used here must be declared using + * PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the + * 'prefix' option to configure works: + * + * ./configure --with-libpng-prefix=foobar_ + * + * Verify you have got this right by running the above command, doing a build + * and examining pngprefix.h; it must contain a #define for every external + * function you add. (Notice that this happens automatically for the + * initialization function.) + */ + pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_neon; + + if (bpp == 3) + { + pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_neon; + pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_neon; + pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = + png_read_filter_row_paeth3_neon; + } + + else if (bpp == 4) + { + pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_neon; + pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_neon; + pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = + png_read_filter_row_paeth4_neon; + } +#else + PNG_UNUSED(pp) + PNG_UNUSED(bpp) +#endif +} diff -ru4NwbB libpng-1.5.13/arm/filter_neon.S libpng-1.5.14beta04/arm/filter_neon.S --- libpng-1.5.13/arm/filter_neon.S 2011-11-16 23:02:48.612067000 -0600 +++ libpng-1.5.14beta04/arm/filter_neon.S 2012-12-14 23:23:36.304038000 -0600 @@ -2,14 +2,16 @@ /* filter_neon.S - NEON optimised filter functions * * Copyright (c) 2011 Glenn Randers-Pehrson * Written by Mans Rullgard, 2011. + * Last changed in libpng 1.5.7 [December 15, 2011] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ +#ifdef __arm__ #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack,"",%progbits /* mark stack as non-executable */ #endif @@ -222,4 +224,5 @@ bgt 1b pop {r4,pc} endfunc +#endif diff -ru4NwbB libpng-1.5.13/configure.ac libpng-1.5.14beta04/configure.ac --- libpng-1.5.13/configure.ac 2012-09-27 06:21:26.715073985 -0500 +++ libpng-1.5.14beta04/configure.ac 2012-12-19 16:22:51.805852402 -0600 @@ -190,10 +190,13 @@ AC_ARG_ENABLE([arm-neon], AC_HELP_STRING([--enable-arm-neon], [Enable ARM NEON optimizations]), [if test "${enableval}" = yes; then - AC_DEFINE([PNG_ARM_NEON], [1], [Enable ARM NEON optimizations]) - AC_DEFINE([PNG_ALIGNED_MEMORY_SUPPORTED], [1], [Align row buffers]) + AC_DEFINE([PNG_FILTER_OPTIMIZATIONS], + [png_init_filter_functions_neon], + [ARM NEON filter initialization function]) + AC_DEFINE([PNG_ALIGNED_MEMORY_SUPPORTED], [1], + [Align row buffers]) fi]) AM_CONDITIONAL([PNG_ARM_NEON], [test "${enable_arm_neon:-no}" = yes]) # Config files, substituting as above diff -ru4NwbB libpng-1.5.13/contrib/pngminim/decoder/makefile libpng-1.5.14beta04/contrib/pngminim/decoder/makefile --- libpng-1.5.13/contrib/pngminim/decoder/makefile 2012-09-27 06:21:20.528143732 -0500 +++ libpng-1.5.14beta04/contrib/pngminim/decoder/makefile 2012-12-19 16:22:45.017647902 -0600 @@ -13,9 +13,9 @@ RM=rm -f COPY=cp -CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP -I. -O1 +CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DZ_SOLO -DNO_GZIP -I. -O1 C=.c O=.o L=.a diff -ru4NwbB libpng-1.5.13/contrib/pngminim/encoder/README libpng-1.5.14beta04/contrib/pngminim/encoder/README --- libpng-1.5.13/contrib/pngminim/encoder/README 2012-09-27 06:21:20.555254888 -0500 +++ libpng-1.5.14beta04/contrib/pngminim/encoder/README 2012-12-19 16:22:45.043606554 -0600 @@ -1,7 +1,7 @@ This demonstrates the use of PNG_USER_CONFIG and pngusr.h -The makefile builds a minimal write-only decoder with embedded libpng +The makefile builds a minimal write-only encoder with embedded libpng and zlib. Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC on the make command line. diff -ru4NwbB libpng-1.5.13/contrib/pngminim/encoder/makefile libpng-1.5.14beta04/contrib/pngminim/encoder/makefile --- libpng-1.5.13/contrib/pngminim/encoder/makefile 2012-09-27 06:21:20.564500862 -0500 +++ libpng-1.5.14beta04/contrib/pngminim/encoder/makefile 2012-12-19 16:22:45.052728275 -0600 @@ -13,9 +13,9 @@ RM=rm -f COPY=cp -CFLAGS=-DPNG_USER_CONFIG -DNO_GZIP -I. -O1 +CFLAGS=-DPNG_USER_CONFIG -DZ_SOLO -DNO_GZIP -I. -O1 C=.c O=.o L=.a diff -ru4NwbB libpng-1.5.13/contrib/pngminim/preader/makefile libpng-1.5.14beta04/contrib/pngminim/preader/makefile --- libpng-1.5.13/contrib/pngminim/preader/makefile 2012-09-27 06:21:20.600694009 -0500 +++ libpng-1.5.14beta04/contrib/pngminim/preader/makefile 2012-12-19 16:22:45.088419487 -0600 @@ -29,9 +29,9 @@ #LIBS = $(XLIB) LIBS = $(XLIB) -lm #platforms that need libm -CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP -I. $(XINC) -O1 +CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DZ_SOLO -DNO_GZIP -I. $(XINC) -O1 C=.c O=.o L=.a diff -ru4NwbB libpng-1.5.13/png.c libpng-1.5.14beta04/png.c --- libpng-1.5.13/png.c 2012-09-27 06:21:19.666088149 -0500 +++ libpng-1.5.14beta04/png.c 2012-12-19 16:22:44.199330385 -0600 @@ -1,8 +1,8 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.5.11 [June 14, 2012] + * Last changed in libpng 1.5.14 [(PENDING RELEASE)] * Copyright (c) 1998-2012 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.) * @@ -72,15 +72,18 @@ PNG_FUNCTION(voidpf /* PRIVATE */, png_zalloc,(voidpf png_ptr, uInt items, uInt size),PNG_ALLOCATED) { png_voidp ptr; - png_structp p=(png_structp)png_ptr; - png_uint_32 save_flags=p->flags; + png_structp p; + png_uint_32 save_flags; png_alloc_size_t num_bytes; if (png_ptr == NULL) return (NULL); + p=(png_structp)png_ptr; + save_flags=p->flags; + if (items > PNG_UINT_32_MAX/size) { png_warning (p, "Potential overflow in png_zalloc()"); return (NULL); diff -ru4NwbB libpng-1.5.13/png.h libpng-1.5.14beta04/png.h --- libpng-1.5.13/png.h 2012-09-27 06:21:19.609548838 -0500 +++ libpng-1.5.14beta04/png.h 2012-12-19 16:22:44.142252553 -0600 @@ -180,8 +180,9 @@ * 1.5.12 15 10512 15.so.15.12[.0] * 1.5.13beta01-02 15 10513 15.so.15.13[.0] * 1.5.13rc01 15 10513 15.so.15.13[.0] * 1.5.13 15 10513 15.so.15.13[.0] + * 1.5.14beta01-04 15 10514 15.so.15.14[.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.5.13/pngerror.c libpng-1.5.14beta04/pngerror.c --- libpng-1.5.13/pngerror.c 2012-09-27 06:21:19.673144509 -0500 +++ libpng-1.5.14beta04/pngerror.c 2012-12-19 16:22:44.206640088 -0600 @@ -1,9 +1,9 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * Last changed in libpng 1.5.8 [February 1, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.5.14 [(PENDING RELEASE)] + * Copyright (c) 1998-2012 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 code is released under the libpng license. @@ -160,9 +160,9 @@ case PNG_NUMBER_FORMAT_02u: /* Expects at least 2 digits. */ mincount = 2; - /* fall through */ + /* FALL THROUGH */ case PNG_NUMBER_FORMAT_u: *--end = digits[number % 10]; number /= 10; @@ -170,9 +170,9 @@ case PNG_NUMBER_FORMAT_02x: /* This format expects at least two digits */ mincount = 2; - /* fall through */ + /* FALL THROUGH */ case PNG_NUMBER_FORMAT_x: *--end = digits[number & 0xf]; number >>= 4; diff -ru4NwbB libpng-1.5.13/pngpriv.h libpng-1.5.14beta04/pngpriv.h --- libpng-1.5.13/pngpriv.h 2012-09-27 06:21:19.627288951 -0500 +++ libpng-1.5.14beta04/pngpriv.h 2012-12-19 16:22:44.160077610 -0600 @@ -1582,16 +1582,16 @@ #define PNG_FP_IS_ZERO(state) (((state) & PNG_FP_Z_MASK) == PNG_FP_SAW_DIGIT) #define PNG_FP_IS_POSITIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_Z_MASK) #define PNG_FP_IS_NEGATIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_NZ_MASK) -/* The actual parser. This can be called repeatedly, it updates +/* The actual parser. This can be called repeatedly. It updates * the index into the string and the state variable (which must - * be initialzed to 0). It returns a result code, as above. There + * be initialized to 0). It returns a result code, as above. There * is no point calling the parser any more if it fails to advance to * the end of the string - it is stuck on an invalid character (or * terminated by '\0'). * - * Note that the pointer will consume an E or even an E+ then leave + * Note that the pointer will consume an E or even an E+ and then leave * a 'maybe' state even though a preceding integer.fraction is valid. * The PNG_FP_WAS_VALID flag indicates that a preceding substring was * a valid number. It's possible to recover from this by calling * the parser again (from the start, with state 0) but with a string @@ -1663,9 +1663,18 @@ PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr, int bit_depth)); #endif -/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ +#ifdef PNG_FILTER_OPTIMIZATIONS +PNG_EXTERN void PNG_FILTER_OPTIMIZATIONS(png_structp png_ptr, unsigned int bpp); + /* This is the initialization function for hardware specific optimizations, + * one implementation (for ARM NEON machines) is contained in + * arm/filter_neon.c. It need not be defined - the generic code will be used + * if not. + */ +#endif + +/* Maintainer: Put new private prototypes here ^ */ #include "pngdebug.h" #ifdef __cplusplus diff -ru4NwbB libpng-1.5.13/pngrtran.c libpng-1.5.14beta04/pngrtran.c --- libpng-1.5.13/pngrtran.c 2012-09-27 06:21:19.738982768 -0500 +++ libpng-1.5.14beta04/pngrtran.c 2012-12-19 16:22:44.263849119 -0600 @@ -1,8 +1,8 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.5.11 [June 14, 2012] + * Last changed in libpng 1.5.14 [(PENDING RELEASE)] * Copyright (c) 1998-2012 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.) * @@ -1220,9 +1220,9 @@ default: case 8: - /* Already 8 bits, fall through */ + /* FALL THROUGH (already 8 bits) */ case 16: /* Already a full 16 bits */ break; @@ -3919,9 +3919,9 @@ if (a == 0) *sp = (png_byte)png_ptr->background.gray; else if (a < 0xff) - png_composite(*sp, *sp, a, png_ptr->background_1.gray); + png_composite(*sp, *sp, a, png_ptr->background.gray); } } } else /* if (png_ptr->bit_depth == 16) */ @@ -3988,9 +3988,9 @@ { png_uint_16 g, v; g = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - png_composite_16(v, g, a, png_ptr->background_1.gray); + png_composite_16(v, g, a, png_ptr->background.gray); *sp = (png_byte)((v >> 8) & 0xff); *(sp + 1) = (png_byte)(v & 0xff); } } diff -ru4NwbB libpng-1.5.13/pngrutil.c libpng-1.5.14beta04/pngrutil.c --- libpng-1.5.13/pngrutil.c 2012-09-27 06:21:19.755234171 -0500 +++ libpng-1.5.14beta04/pngrutil.c 2012-12-19 16:22:44.280078372 -0600 @@ -1,8 +1,8 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.5.10 [March 8, 2012] + * Last changed in libpng 1.5.14 [(PENDING RELEASE)] * Copyright (c) 1998-2012 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.) * @@ -2451,9 +2451,9 @@ { png_textp text_ptr; png_charp key, lang, text, lang_key; int comp_flag; - int comp_type = 0; + int comp_type; int ret; png_size_t slength, prefix_len, data_len; png_debug(1, "in png_handle_iTXt"); @@ -2532,17 +2532,26 @@ png_ptr->chunkdata = NULL; return; } - else - { comp_flag = *lang++; comp_type = *lang++; + + /* 1.5.14: The spec says "for uncompressed text decoders shall ignore [the + * compression type]". The compression flag shall be 0 (no compression) or + * 1 (compressed with method 0 - deflate.) + */ + if (comp_flag != 0 && comp_flag != 1) + { + png_warning(png_ptr, "invalid iTXt compression flag"); + png_free(png_ptr, png_ptr->chunkdata); + png_ptr->chunkdata = NULL; + return; } - if (comp_type || (comp_flag && comp_flag != PNG_TEXT_COMPRESSION_zTXt)) + if (comp_flag/*compressed*/ && comp_type != 0) { - png_warning(png_ptr, "Unknown iTXt compression type or method"); + png_warning(png_ptr, "unknown iTXt compression type"); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; return; } @@ -2576,9 +2585,9 @@ prefix_len = text - png_ptr->chunkdata; key=png_ptr->chunkdata; - if (comp_flag) + if (comp_flag/*compressed*/) png_decompress_chunk(png_ptr, comp_type, (size_t)length, prefix_len, &data_len); else @@ -2594,9 +2603,10 @@ png_ptr->chunkdata = NULL; return; } - text_ptr->compression = (int)comp_flag + 1; + text_ptr->compression = + (comp_flag ? PNG_ITXT_COMPRESSION_zTXt : PNG_ITXT_COMPRESSION_NONE); text_ptr->lang_key = png_ptr->chunkdata + (lang_key - key); text_ptr->lang = png_ptr->chunkdata + (lang - key); text_ptr->itxt_length = data_len; text_ptr->text_length = 0; @@ -3659,68 +3669,8 @@ *row++ = (png_byte)a; } } -#ifdef PNG_ARM_NEON - -#ifdef __linux__ -#include -#include -#include - -static int png_have_hwcap(unsigned cap) -{ - FILE *f = fopen("/proc/self/auxv", "r"); - Elf32_auxv_t aux; - int have_cap = 0; - - if (!f) - return 0; - - while (fread(&aux, sizeof(aux), 1, f) > 0) - { - if (aux.a_type == AT_HWCAP && - aux.a_un.a_val & cap) - { - have_cap = 1; - break; - } - } - - fclose(f); - - return have_cap; -} -#endif /* __linux__ */ - -static void -png_init_filter_functions_neon(png_structp pp, unsigned int bpp) -{ -#ifdef __linux__ - if (!png_have_hwcap(HWCAP_NEON)) - return; -#endif - - pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_neon; - - if (bpp == 3) - { - pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_neon; - pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_neon; - pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = - png_read_filter_row_paeth3_neon; - } - - else if (bpp == 4) - { - pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_neon; - pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_neon; - pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = - png_read_filter_row_paeth4_neon; - } -} -#endif /* PNG_ARM_NEON */ - static void png_init_filter_functions(png_structp pp) { unsigned int bpp = (pp->pixel_depth + 7) >> 3; @@ -3734,10 +3684,18 @@ else pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth_multibyte_pixel; -#ifdef PNG_ARM_NEON - png_init_filter_functions_neon(pp, bpp); +#ifdef PNG_FILTER_OPTIMIZATIONS + /* To use this define PNG_FILTER_OPTIMIZATIONS as the name of a function to + * call to install hardware optimizations for the above functions; simply + * replace whatever elements of the pp->read_filter[] array with a hardware + * specific (or, for that matter, generic) optimization. + * + * To see an example of this examine what configure.ac does when + * --enable-arm-neon is specified on the command line. + */ + PNG_FILTER_OPTIMIZATIONS(pp, bpp); #endif } void /* PRIVATE */ diff -ru4NwbB libpng-1.5.13/pngset.c libpng-1.5.14beta04/pngset.c --- libpng-1.5.13/pngset.c 2012-09-27 06:21:19.763776038 -0500 +++ libpng-1.5.14beta04/pngset.c 2012-12-19 16:22:44.288818452 -0600 @@ -1,8 +1,8 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.5.11 [June 14, 2012] + * Last changed in libpng 1.5.14 [(PENDING RELEASE)] * Copyright (c) 1998-2012 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.) * @@ -896,8 +896,14 @@ if (png_ptr == NULL || info_ptr == NULL) return; + if (num_trans < 0 || num_trans > PNG_MAX_PALETTE_LENGTH) + { + png_warning(png_ptr, "Ignoring invalid num_trans value"); + return; + } + if (trans_alpha != NULL) { /* It may not actually be necessary to set png_ptr->trans_alpha here; * we do it for backward compatibility with the way the png_handle_tRNS diff -ru4NwbB libpng-1.5.13/pngwrite.c libpng-1.5.14beta04/pngwrite.c --- libpng-1.5.13/pngwrite.c 2012-09-27 06:21:19.796256591 -0500 +++ libpng-1.5.14beta04/pngwrite.c 2012-12-19 16:22:44.321809209 -0600 @@ -1,8 +1,8 @@ /* pngwrite.c - general routines to write a PNG file * - * Last changed in libpng 1.5.11 [June 14, 2012] + * Last changed in libpng 1.5.14 [(PENDING RELEASE)] * Copyright (c) 1998-2012 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.) * @@ -1041,8 +1041,9 @@ #ifdef PNG_WRITE_FILTER_SUPPORTED case 5: case 6: case 7: png_warning(png_ptr, "Unknown row filter for method 0"); + /* FALL THROUGH */ #endif /* PNG_WRITE_FILTER_SUPPORTED */ case PNG_FILTER_VALUE_NONE: png_ptr->do_filter = PNG_FILTER_NONE; break; diff -ru4NwbB libpng-1.5.13/pngwtran.c libpng-1.5.14beta04/pngwtran.c --- libpng-1.5.13/pngwtran.c 2012-09-27 06:21:19.803085510 -0500 +++ libpng-1.5.14beta04/pngwtran.c 2012-12-19 16:22:44.328952137 -0600 @@ -1,8 +1,8 @@ /* pngwtran.c - transforms the data in a row for PNG writers * - * Last changed in libpng 1.5.13 [September 27, 2012] + * Last changed in libpng 1.5.14 [(PENDING RELEASE)] * Copyright (c) 1998-2012 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.5.13/pngwutil.c libpng-1.5.14beta04/pngwutil.c --- libpng-1.5.13/pngwutil.c 2012-09-27 06:21:19.816315135 -0500 +++ libpng-1.5.14beta04/pngwutil.c 2012-12-19 16:22:44.342334827 -0600 @@ -1,8 +1,8 @@ /* pngwutil.c - utilities to write a PNG file * - * Last changed in libpng 1.5.10 [March 8, 2012] + * Last changed in libpng 1.5.14 [(PENDING RELEASE)] * Copyright (c) 1998-2012 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.) * @@ -459,26 +459,23 @@ old_ptr = comp->output_ptr; comp->output_ptr = (png_bytepp)png_malloc(png_ptr, - (png_alloc_size_t) - (comp->max_output_ptr * png_sizeof(png_charpp))); + (comp->max_output_ptr * png_sizeof(png_bytep))); png_memcpy(comp->output_ptr, old_ptr, old_max - * png_sizeof(png_charp)); + * png_sizeof(png_bytep)); png_free(png_ptr, old_ptr); } else comp->output_ptr = (png_bytepp)png_malloc(png_ptr, - (png_alloc_size_t) - (comp->max_output_ptr * png_sizeof(png_charp))); + (comp->max_output_ptr * png_sizeof(png_bytep))); } /* Save the data */ comp->output_ptr[comp->num_output_ptr] = - (png_bytep)png_malloc(png_ptr, - (png_alloc_size_t)png_ptr->zbuf_size); + (png_bytep)png_malloc(png_ptr, png_ptr->zbuf_size); png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf, png_ptr->zbuf_size); diff -ru4NwbB libpng-1.5.13/projects/vstudio/WARNING libpng-1.5.14beta04/projects/vstudio/WARNING --- libpng-1.5.13/projects/vstudio/WARNING 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.14beta04/projects/vstudio/WARNING 2012-09-29 16:42:20.869685000 -0500 @@ -0,0 +1,23 @@ +WARNING +======= +Libpng 1.5 erroneously uses /MD when building debug DLL versions of libpng. +It should use /MDd - you can change this under properties\C/C++\Code +Generation\Runtime Library if you need to use the debug runtime for debug +builds. This will be changed in libpng 1.6 but is currently retained for +compatibility with older libpng 1.5 releases. + +The runtime library settings for each build are as follows: + + Release Debug +DLL /MD /MD +Library /MT /MTd + +The Visual Studio 2010 defaults for a Win32 DLL or Static Library project are +as follows: + + Release Debug +DLL /MD /MDd +Static Library /MD /MDd + +Notice that by default static library builds use the DLL runtime, not the +static library runtime. diff -ru4NwbB libpng-1.5.13/projects/vstudio/readme.txt libpng-1.5.14beta04/projects/vstudio/readme.txt --- libpng-1.5.13/projects/vstudio/readme.txt 2012-09-27 06:21:21.829484553 -0500 +++ libpng-1.5.14beta04/projects/vstudio/readme.txt 2012-12-19 16:22:46.295339862 -0600 @@ -12,8 +12,16 @@ This directory contains support for building libpng under MicroSoft VisualStudio 2010. It may also work under later versions of VisualStudio. You should be familiar with VisualStudio before using this directory. +WARNING +======= +Libpng 1.5 erroneously uses /MD when building debug DLL versions of libpng. +It should use /MDd - you can change this under properties\C/C++\Code +Generation\Runtime Library if you need to use the debug runtime for debug +builds. This will be changed in libpng 1.6 but is currently retained for +compatibility with older libpng 1.5 releases. + Initial preparations ==================== You must enter some information in zlib.props before attempting to build with this 'solution'. Please read and edit zlib.props first. You will diff -ru4NwbB libpng-1.5.13/scripts/options.awk libpng-1.5.14beta04/scripts/options.awk --- libpng-1.5.13/scripts/options.awk 2012-02-24 19:17:05.386605000 -0600 +++ libpng-1.5.14beta04/scripts/options.awk 2012-12-18 08:53:21.985404000 -0600 @@ -101,8 +101,9 @@ } pre && version == "search" && $0 ~ /^ \* libpng version/{ version = substr($0, 4) + gsub(/\./, " PNG_JOIN . PNG_JOIN", version) print "version =", version >out next }