diff -ru4NwbB libpng-1.5.12/contrib/pngminim/decoder/makefile libpng-1.5.14beta01/contrib/pngminim/decoder/makefile --- libpng-1.5.12/contrib/pngminim/decoder/makefile 2012-07-10 21:48:05.411582781 -0500 +++ libpng-1.5.14beta01/contrib/pngminim/decoder/makefile 2012-10-24 11:03:03.755219264 -0500 @@ -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.12/contrib/pngminim/encoder/makefile libpng-1.5.14beta01/contrib/pngminim/encoder/makefile --- libpng-1.5.12/contrib/pngminim/encoder/makefile 2012-07-10 21:48:05.476806574 -0500 +++ libpng-1.5.14beta01/contrib/pngminim/encoder/makefile 2012-10-24 11:03:03.791695823 -0500 @@ -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.12/contrib/pngminim/preader/makefile libpng-1.5.14beta01/contrib/pngminim/preader/makefile --- libpng-1.5.12/contrib/pngminim/preader/makefile 2012-07-10 21:48:05.542338958 -0500 +++ libpng-1.5.14beta01/contrib/pngminim/preader/makefile 2012-10-24 11:03:03.828130862 -0500 @@ -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.12/example.c libpng-1.5.14beta01/example.c --- libpng-1.5.12/example.c 2012-07-10 21:48:03.292275957 -0500 +++ libpng-1.5.14beta01/example.c 2012-10-24 11:03:02.922992679 -0500 @@ -798,14 +798,18 @@ * layout, however, so choose what fits your needs best). You need to * use the first method if you aren't handling interlacing yourself. */ png_uint_32 k, height, width; - png_byte image[height][width*bytes_per_pixel]; + + /* In this example, "image" is a one-dimensional array of bytes */ + png_byte image[height*width*bytes_per_pixel]; + png_bytep row_pointers[height]; if (height > PNG_UINT_32_MAX/png_sizeof(png_bytep)) png_error (png_ptr, "Image is too tall to process in memory"); + /* Set up pointers into your "image" byte array */ for (k = 0; k < height; k++) row_pointers[k] = image + k*width*bytes_per_pixel; /* One of the following output methods is REQUIRED */ diff -ru4NwbB libpng-1.5.12/png.h libpng-1.5.14beta01/png.h --- libpng-1.5.12/png.h 2012-07-10 21:48:03.195507100 -0500 +++ libpng-1.5.14beta01/png.h 2012-10-24 11:03:02.878743777 -0500 @@ -177,8 +177,12 @@ * 1.5.11beta01 15 10511 15.so.15.11[.0] * 1.5.11rc01-05 15 10511 15.so.15.11[.0] * 1.5.11 15 10511 15.so.15.11[.0] * 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 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 @@ -1157,11 +1161,11 @@ #define PNG_ERROR_ACTION_ERROR 3 #define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/ PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structp png_ptr, - int error_action, double red, double green)); + int error_action, double red, double green)) PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structp png_ptr, - int error_action, png_fixed_point red, png_fixed_point green)); + int error_action, png_fixed_point red, png_fixed_point green)) PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structp png_ptr)); #endif @@ -1227,11 +1231,11 @@ #define PNG_ALPHA_OPTIMIZED 2 /* 'PNG' for opaque pixels, else 'STANDARD' */ #define PNG_ALPHA_BROKEN 3 /* the alpha channel is gamma encoded */ PNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structp png_ptr, int mode, - double output_gamma)); + double output_gamma)) PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structp png_ptr, - int mode, png_fixed_point output_gamma)); + int mode, png_fixed_point output_gamma)) #endif #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED) /* The output_gamma value is a screen gamma in libpng terminology: it expresses @@ -1452,12 +1456,12 @@ * errors if the PNG file contains a bKGD chunk. */ PNG_FP_EXPORT(47, void, png_set_background, (png_structp png_ptr, png_const_color_16p background_color, int background_gamma_code, - int need_expand, double background_gamma)); + int need_expand, double background_gamma)) PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structp png_ptr, png_const_color_16p background_color, int background_gamma_code, - int need_expand, png_fixed_point background_gamma)); + int need_expand, png_fixed_point background_gamma)) #endif #ifdef PNG_READ_BACKGROUND_SUPPORTED # define PNG_BACKGROUND_GAMMA_UNKNOWN 0 # define PNG_BACKGROUND_GAMMA_SCREEN 1 @@ -1504,11 +1508,11 @@ * is the inverse of a 'screen gamma' value. */ PNG_FP_EXPORT(50, void, png_set_gamma, (png_structp png_ptr, double screen_gamma, - double override_file_gamma)); + double override_file_gamma)) PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structp png_ptr, - png_fixed_point screen_gamma, png_fixed_point override_file_gamma)); + png_fixed_point screen_gamma, png_fixed_point override_file_gamma)) #endif #ifdef PNG_WRITE_FLUSH_SUPPORTED /* Set how many lines between output flushes - 0 for no flushing */ @@ -1666,13 +1670,13 @@ * to the UNWEIGHTED method, but with added encoding time/computation. */ PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structp png_ptr, int heuristic_method, int num_weights, png_const_doublep filter_weights, - png_const_doublep filter_costs)); + png_const_doublep filter_costs)) PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed, (png_structp png_ptr, int heuristic_method, int num_weights, png_const_fixed_point_p - filter_weights, png_const_fixed_point_p filter_costs)); + filter_weights, png_const_fixed_point_p filter_costs)) #endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ /* Heuristic used for row filter selection. These defines should NOT be * changed. @@ -2052,11 +2056,11 @@ (png_const_structp png_ptr, png_const_infop info_ptr)); /* Returns pixel aspect ratio, computed from pHYs chunk data. */ PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio, - (png_const_structp png_ptr, png_const_infop info_ptr)); + (png_const_structp png_ptr, png_const_infop info_ptr)) PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed, - (png_const_structp png_ptr, png_const_infop info_ptr)); + (png_const_structp png_ptr, png_const_infop info_ptr)) /* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels, (png_const_structp png_ptr, png_const_infop info_ptr)); @@ -2087,68 +2091,68 @@ #ifdef PNG_cHRM_SUPPORTED PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structp png_ptr, png_const_infop info_ptr, double *white_x, double *white_y, double *red_x, double *red_y, double *green_x, double *green_y, double *blue_x, - double *blue_y)); + double *blue_y)) PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_structp png_ptr, png_const_infop info_ptr, double *red_X, double *red_Y, double *red_Z, double *green_X, double *green_Y, double *green_Z, double *blue_X, - double *blue_Y, double *blue_Z)); + double *blue_Y, double *blue_Z)) #ifdef PNG_FIXED_POINT_SUPPORTED /* Otherwise not implemented */ PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed, (png_const_structp png_ptr, png_const_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point *int_blue_x, - png_fixed_point *int_blue_y)); + png_fixed_point *int_blue_y)) #endif PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed, (png_structp png_ptr, png_const_infop info_ptr, png_fixed_point *int_red_X, png_fixed_point *int_red_Y, png_fixed_point *int_red_Z, png_fixed_point *int_green_X, png_fixed_point *int_green_Y, png_fixed_point *int_green_Z, png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y, - png_fixed_point *int_blue_Z)); + png_fixed_point *int_blue_Z)) #endif #ifdef PNG_cHRM_SUPPORTED PNG_FP_EXPORT(135, void, png_set_cHRM, (png_structp png_ptr, png_infop info_ptr, double white_x, double white_y, double red_x, double red_y, double green_x, - double green_y, double blue_x, double blue_y)); + double green_y, double blue_x, double blue_y)) PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_structp png_ptr, png_infop info_ptr, double red_X, double red_Y, double red_Z, double green_X, double green_Y, double green_Z, double blue_X, - double blue_Y, double blue_Z)); + double blue_Y, double blue_Z)) PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_structp png_ptr, png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, - png_fixed_point int_blue_y)); + png_fixed_point int_blue_y)) PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_structp png_ptr, png_infop info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y, png_fixed_point int_red_Z, png_fixed_point int_green_X, png_fixed_point int_green_Y, png_fixed_point int_green_Z, png_fixed_point int_blue_X, png_fixed_point int_blue_Y, - png_fixed_point int_blue_Z)); + png_fixed_point int_blue_Z)) #endif #ifdef PNG_gAMA_SUPPORTED PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structp png_ptr, png_const_infop info_ptr, - double *file_gamma)); + double *file_gamma)) PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed, (png_const_structp png_ptr, png_const_infop info_ptr, - png_fixed_point *int_file_gamma)); + png_fixed_point *int_file_gamma)) #endif #ifdef PNG_gAMA_SUPPORTED PNG_FP_EXPORT(139, void, png_set_gAMA, (png_structp png_ptr, - png_infop info_ptr, double file_gamma)); + png_infop info_ptr, double file_gamma)) PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_structp png_ptr, - png_infop info_ptr, png_fixed_point int_file_gamma)); + png_infop info_ptr, png_fixed_point int_file_gamma)) #endif #ifdef PNG_hIST_SUPPORTED PNG_EXPORT(141, png_uint_32, png_get_hIST, @@ -2312,9 +2316,9 @@ #ifdef PNG_sCAL_SUPPORTED PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structp png_ptr, png_const_infop info_ptr, - int *unit, double *width, double *height)); + int *unit, double *width, double *height)) #ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED /* NOTE: this API is currently implemented using floating point arithmetic, * consequently it can only be used on systems with floating point support. * In any case the range of values supported by png_fixed_point is small and it @@ -2322,20 +2326,20 @@ */ PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed, (png_structp png_ptr, png_const_infop info_ptr, int *unit, png_fixed_point *width, - png_fixed_point *height)); + png_fixed_point *height)) #endif PNG_EXPORT(169, png_uint_32, png_get_sCAL_s, (png_const_structp png_ptr, png_const_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); PNG_FP_EXPORT(170, void, png_set_sCAL, (png_structp png_ptr, png_infop info_ptr, - int unit, double width, double height)); + int unit, double width, double height)) PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_structp png_ptr, png_infop info_ptr, int unit, png_fixed_point width, - png_fixed_point height)); + png_fixed_point height)) PNG_EXPORT(171, void, png_set_sCAL_s, (png_structp png_ptr, png_infop info_ptr, int unit, png_const_charp swidth, png_const_charp sheight)); #endif /* PNG_sCAL_SUPPORTED */ @@ -2446,19 +2450,19 @@ PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch, (png_const_structp png_ptr, png_const_infop info_ptr)); PNG_FP_EXPORT(196, float, png_get_x_offset_inches, - (png_const_structp png_ptr, png_const_infop info_ptr)); + (png_const_structp png_ptr, png_const_infop info_ptr)) #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed, - (png_structp png_ptr, png_const_infop info_ptr)); + (png_structp png_ptr, png_const_infop info_ptr)) #endif PNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structp png_ptr, - png_const_infop info_ptr)); + png_const_infop info_ptr)) #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed, - (png_structp png_ptr, png_const_infop info_ptr)); + (png_structp png_ptr, png_const_infop info_ptr)) #endif # ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structp png_ptr, diff -ru4NwbB libpng-1.5.12/pngconf.h libpng-1.5.14beta01/pngconf.h --- libpng-1.5.12/pngconf.h 2012-07-10 21:48:03.211355202 -0500 +++ libpng-1.5.14beta01/pngconf.h 2012-10-24 11:03:02.886224878 -0500 @@ -343,8 +343,9 @@ # endif # ifndef PNG_NORETURN # define PNG_NORETURN __attribute__((__noreturn__)) # endif +# if __GNUC__ >= 3 # ifndef PNG_ALLOCATED # define PNG_ALLOCATED __attribute__((__malloc__)) # endif # ifndef PNG_DEPRECATED @@ -358,8 +359,9 @@ # define PNG_PRIVATE \ __attribute__((__deprecated__)) # endif # endif +# endif /* __GNUC__ >= 3 */ # endif /* __GNUC__ */ # if defined(_MSC_VER) && (_MSC_VER >= 1300) # ifndef PNG_USE_RESULT @@ -399,17 +401,17 @@ #endif #ifndef PNG_FP_EXPORT /* A floating point API. */ # ifdef PNG_FLOATING_POINT_SUPPORTED # define PNG_FP_EXPORT(ordinal, type, name, args)\ - PNG_EXPORT(ordinal, type, name, args) + PNG_EXPORT(ordinal, type, name, args); # else /* No floating point APIs */ # define PNG_FP_EXPORT(ordinal, type, name, args) # endif #endif #ifndef PNG_FIXED_EXPORT /* A fixed point API. */ # ifdef PNG_FIXED_POINT_SUPPORTED # define PNG_FIXED_EXPORT(ordinal, type, name, args)\ - PNG_EXPORT(ordinal, type, name, args) + PNG_EXPORT(ordinal, type, name, args); # else /* No fixed point APIs */ # define PNG_FIXED_EXPORT(ordinal, type, name, args) # endif #endif diff -ru4NwbB libpng-1.5.12/pngmem.c libpng-1.5.14beta01/pngmem.c --- libpng-1.5.12/pngmem.c 2012-07-10 21:48:03.363867624 -0500 +++ libpng-1.5.14beta01/pngmem.c 2012-10-24 11:03:02.958905407 -0500 @@ -1,9 +1,9 @@ /* pngmem.c - stub functions for memory allocation * - * Last changed in libpng 1.5.7 [December 15, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.5.13 [September 27, 2012] + * 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. @@ -55,9 +55,9 @@ # ifdef PNG_USER_MEM_SUPPORTED if (malloc_fn != NULL) { png_struct dummy_struct; - memset(&dummy_struct, 0, sizeof dummy_struct); + png_memset(&dummy_struct, 0, sizeof dummy_struct); dummy_struct.mem_ptr=mem_ptr; struct_ptr = (*(malloc_fn))(&dummy_struct, (png_alloc_size_t)size); } @@ -89,9 +89,9 @@ # ifdef PNG_USER_MEM_SUPPORTED if (free_fn != NULL) { png_struct dummy_struct; - memset(&dummy_struct, 0, sizeof dummy_struct); + png_memset(&dummy_struct, 0, sizeof dummy_struct); dummy_struct.mem_ptr=mem_ptr; (*(free_fn))(&dummy_struct, struct_ptr); return; } diff -ru4NwbB libpng-1.5.12/pngpriv.h libpng-1.5.14beta01/pngpriv.h --- libpng-1.5.12/pngpriv.h 2012-07-10 21:48:03.231247169 -0500 +++ libpng-1.5.14beta01/pngpriv.h 2012-10-24 11:03:02.896710164 -0500 @@ -992,10 +992,10 @@ /* Unfilter a row: check the filter value before calling this, there is no point * calling it for PNG_FILTER_VALUE_NONE. */ -PNG_EXTERN void png_read_filter_row PNGARG((png_structp pp, png_row_infop row_info, - png_bytep row, png_const_bytep prev_row, int filter)); +PNG_EXTERN void png_read_filter_row PNGARG((png_structp pp, png_row_infop + row_info, png_bytep row, png_const_bytep prev_row, int filter)); PNG_EXTERN void png_read_filter_row_up_neon PNGARG((png_row_infop row_info, png_bytep row, png_const_bytep prev_row)); PNG_EXTERN void png_read_filter_row_sub3_neon PNGARG((png_row_infop row_info, @@ -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,9 @@ 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 */ +/* Maintainer: Put new private prototypes here ^ */ #include "pngdebug.h" #ifdef __cplusplus diff -ru4NwbB libpng-1.5.12/pngrtran.c libpng-1.5.14beta01/pngrtran.c --- libpng-1.5.12/pngrtran.c 2012-07-10 21:48:03.433553473 -0500 +++ libpng-1.5.14beta01/pngrtran.c 2012-10-24 11:03:03.000631021 -0500 @@ -3704,10 +3704,12 @@ if (v == png_ptr->trans_color.gray) { /* Background is already in screen gamma */ - *sp = (png_byte)((png_ptr->background.gray >> 8) & 0xff); - *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff); + *sp = (png_byte)((png_ptr->background.gray >> 8) + & 0xff); + *(sp + 1) = (png_byte)(png_ptr->background.gray + & 0xff); } else { @@ -3728,10 +3730,12 @@ v = (png_uint_16)(((*sp) << 8) + *(sp + 1)); if (v == png_ptr->trans_color.gray) { - *sp = (png_byte)((png_ptr->background.gray >> 8) & 0xff); - *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff); + *sp = (png_byte)((png_ptr->background.gray >> 8) + & 0xff); + *(sp + 1) = (png_byte)(png_ptr->background.gray + & 0xff); } } } break; @@ -3809,11 +3813,14 @@ { /* Background is already in screen gamma */ *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff); *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff); - *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) & 0xff); - *(sp + 3) = (png_byte)(png_ptr->background.green & 0xff); - *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) & 0xff); + *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) + & 0xff); + *(sp + 3) = (png_byte)(png_ptr->background.green + & 0xff); + *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) + & 0xff); *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff); } else @@ -3852,11 +3859,14 @@ b == png_ptr->trans_color.blue) { *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff); *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff); - *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) & 0xff); - *(sp + 3) = (png_byte)(png_ptr->background.green & 0xff); - *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) & 0xff); + *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) + & 0xff); + *(sp + 3) = (png_byte)(png_ptr->background.green + & 0xff); + *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) + & 0xff); *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff); } } } @@ -3909,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) */ @@ -3937,9 +3947,10 @@ else if (a == 0) { /* Background is already in screen gamma */ - *sp = (png_byte)((png_ptr->background.gray >> 8) & 0xff); + *sp = (png_byte)((png_ptr->background.gray >> 8) + & 0xff); *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff); } else @@ -3967,18 +3978,19 @@ + *(sp + 3)); if (a == 0) { - *sp = (png_byte)((png_ptr->background.gray >> 8) & 0xff); + *sp = (png_byte)((png_ptr->background.gray >> 8) + & 0xff); *(sp + 1) = (png_byte)(png_ptr->background.gray & 0xff); } else if (a < 0xffff) { 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); } } @@ -4097,11 +4109,14 @@ { /* Background is already in screen gamma */ *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff); *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff); - *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) & 0xff); - *(sp + 3) = (png_byte)(png_ptr->background.green & 0xff); - *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) & 0xff); + *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) + & 0xff); + *(sp + 3) = (png_byte)(png_ptr->background.green + & 0xff); + *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) + & 0xff); *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff); } else @@ -4110,24 +4125,27 @@ v = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp]; png_composite_16(w, v, a, png_ptr->background_1.red); if (!optimize) - w = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8]; + w = gamma_16_from_1[((w&0xff) >> gamma_shift)] + [w >> 8]; *sp = (png_byte)((w >> 8) & 0xff); *(sp + 1) = (png_byte)(w & 0xff); v = gamma_16_to_1[*(sp + 3) >> gamma_shift][*(sp + 2)]; png_composite_16(w, v, a, png_ptr->background_1.green); if (!optimize) - w = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8]; + w = gamma_16_from_1[((w&0xff) >> gamma_shift)] + [w >> 8]; *(sp + 2) = (png_byte)((w >> 8) & 0xff); *(sp + 3) = (png_byte)(w & 0xff); v = gamma_16_to_1[*(sp + 5) >> gamma_shift][*(sp + 4)]; png_composite_16(w, v, a, png_ptr->background_1.blue); if (!optimize) - w = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8]; + w = gamma_16_from_1[((w&0xff) >> gamma_shift)] + [w >> 8]; *(sp + 4) = (png_byte)((w >> 8) & 0xff); *(sp + 5) = (png_byte)(w & 0xff); } @@ -4146,11 +4164,14 @@ if (a == 0) { *sp = (png_byte)((png_ptr->background.red >> 8) & 0xff); *(sp + 1) = (png_byte)(png_ptr->background.red & 0xff); - *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) & 0xff); - *(sp + 3) = (png_byte)(png_ptr->background.green & 0xff); - *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) & 0xff); + *(sp + 2) = (png_byte)((png_ptr->background.green >> 8) + & 0xff); + *(sp + 3) = (png_byte)(png_ptr->background.green + & 0xff); + *(sp + 4) = (png_byte)((png_ptr->background.blue >> 8) + & 0xff); *(sp + 5) = (png_byte)(png_ptr->background.blue & 0xff); } else if (a < 0xffff) diff -ru4NwbB libpng-1.5.12/pngwtran.c libpng-1.5.14beta01/pngwtran.c --- libpng-1.5.12/pngwtran.c 2012-07-10 21:48:03.559053652 -0500 +++ libpng-1.5.14beta01/pngwtran.c 2012-10-24 11:03:03.065815392 -0500 @@ -1,9 +1,9 @@ /* pngwtran.c - transforms the data in a row for PNG writers * - * Last changed in libpng 1.5.6 [November 3, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.5.13 [September 27, 2012] + * 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. @@ -44,10 +44,22 @@ #endif #ifdef PNG_WRITE_FILLER_SUPPORTED if (png_ptr->transformations & PNG_FILLER) + { + if (png_ptr->color_type & (PNG_COLOR_MASK_ALPHA|PNG_COLOR_MASK_PALETTE)) + { + /* GA, RGBA or palette; in any of these cases libpng will not do the + * the correct thing (whatever that might be). + */ + png_warning(png_ptr, "incorrect png_set_filler call ignored"); + png_ptr->transformations &= ~PNG_FILLER; + } + + else png_do_strip_channel(row_info, png_ptr->row_buf + 1, !(png_ptr->flags & PNG_FLAG_FILLER_AFTER)); + } #endif #ifdef PNG_WRITE_PACKSWAP_SUPPORTED if (png_ptr->transformations & PNG_PACKSWAP) diff -ru4NwbB libpng-1.5.12/pngwutil.c libpng-1.5.14beta01/pngwutil.c --- libpng-1.5.12/pngwutil.c 2012-07-10 21:48:03.581024385 -0500 +++ libpng-1.5.14beta01/pngwutil.c 2012-10-24 11:03:03.079215759 -0500 @@ -1369,9 +1369,10 @@ return; } /* Write the chunk out as it is */ - png_write_complete_chunk(png_ptr, png_tRNS, trans_alpha, (png_size_t)num_trans); + png_write_complete_chunk(png_ptr, png_tRNS, trans_alpha, + (png_size_t)num_trans); } else if (color_type == PNG_COLOR_TYPE_GRAY) { diff -ru4NwbB libpng-1.5.12/projects/vstudio/WARNING libpng-1.5.14beta01/projects/vstudio/WARNING --- libpng-1.5.12/projects/vstudio/WARNING 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.14beta01/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.12/projects/vstudio/readme.txt libpng-1.5.14beta01/projects/vstudio/readme.txt --- libpng-1.5.12/projects/vstudio/readme.txt 2012-07-10 21:48:09.272405773 -0500 +++ libpng-1.5.14beta01/projects/vstudio/readme.txt 2012-10-24 11:03:05.019317295 -0500 @@ -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