diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c index fc671724c..6701c19a0 100644 --- a/contrib/libtests/pngvalid.c +++ b/contrib/libtests/pngvalid.c @@ -396,9 +396,9 @@ next_format(png_bytep colour_type, png_bytep bit_depth, /* Palette images are restricted to 8 bit depth */ if (*bit_depth <= 8 -# ifdef DO_16BIT +#ifdef DO_16BIT || (*colour_type != 3 && *bit_depth <= 16) -# endif +#endif ) return 1; @@ -3165,10 +3165,10 @@ init_standard_palette(png_store *ps, png_structp pp, png_infop pi, int npalette, for (; i<256; ++i) tRNS[i] = 24; -# ifdef PNG_WRITE_tRNS_SUPPORTED +#ifdef PNG_WRITE_tRNS_SUPPORTED if (j > 0) png_set_tRNS(pp, pi, tRNS, j, 0/*color*/); -# endif +#endif } } diff --git a/contrib/tools/pngfix.c b/contrib/tools/pngfix.c index 3b64627c2..73f6800ed 100644 --- a/contrib/tools/pngfix.c +++ b/contrib/tools/pngfix.c @@ -2,7 +2,7 @@ * * Copyright (c) 2014 John Cunningham Bowler * - * Last changed in libpng 1.6.10 [March 6, 2014] + * Last changed in libpng 1.6.14 [(PENDING RELEASE)] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -49,6 +49,9 @@ # error "pngfix will not work with libpng prior to 1.6.3" #endif +#ifdef PNG_SETJMP_SUPPORTED +#include + #if defined(PNG_READ_SUPPORTED) && defined(PNG_EASY_ACCESS_SUPPORTED) /* zlib.h defines the structure z_stream, an instance of which is included * in this structure and is required for decompressing the LZ compressed @@ -79,7 +82,7 @@ # error "pngfix not supported in this libpng version" #endif -#if PNG_ZLIB_VERNUM >= 0x1240 +#if ZLIB_VERNUM >= 0x1240 /* Copied from pngpriv.h */ #ifdef __cplusplus @@ -4014,16 +4017,16 @@ main(int argc, const char **argv) return global_end(&global); } -#else /* PNG_ZLIB_VERNUM < 0x1240 */ +#else /* ZLIB_VERNUM < 0x1240 */ int main(void) { fprintf(stderr, "pngfix needs libpng with a zlib >=1.2.4 (not 0x%x)\n", - PNG_ZLIB_VERNUM); + ZLIB_VERNUM); return 77; } -#endif /* PNG_ZLIB_VERNUM */ +#endif /* ZLIB_VERNUM */ #else /* No read support */ @@ -4034,3 +4037,12 @@ main(void) return 77; } #endif /* PNG_READ_SUPPORTED && PNG_EASY_ACCESS_SUPPORTED */ +#else /* No setjmp support */ +int +main(void) +{ + fprintf(stderr, "pngfix does not work without setjmp support\n"); + return 77; +} +#endif /* PNG_SETJMP_SUPPORTED */ +