diff -ru4NwbB libpng-1.4.5/contrib/pngminim/decoder/makefile libpng-1.4.6/contrib/pngminim/decoder/makefile
--- libpng-1.4.5/contrib/pngminim/decoder/makefile 2010-12-09 07:48:12.102770519 -0600
+++ libpng-1.4.6/contrib/pngminim/decoder/makefile 2011-04-08 11:58:24.914038630 -0500
@@ -33,9 +33,8 @@
all: pngm2pnm$(E)
pngm2pnm$(E): $(OBJS)
$(LD) -o pngm2pnm$(E) $(OBJS)
- strip pngm2pnm$(E)
clean:
$(RM) pngm2pnm$(O)
$(RM) pngm2pnm$(E)
diff -ru4NwbB libpng-1.4.5/contrib/pngminim/encoder/makefile libpng-1.4.6/contrib/pngminim/encoder/makefile
--- libpng-1.4.5/contrib/pngminim/encoder/makefile 2010-12-09 07:48:12.137494074 -0600
+++ libpng-1.4.6/contrib/pngminim/encoder/makefile 2011-04-08 11:58:24.946777631 -0500
@@ -31,9 +31,8 @@
all: pnm2pngm$(E)
pnm2pngm$(E): $(OBJS)
$(LD) -o pnm2pngm$(E) $(OBJS)
- strip pnm2pngm$(E)
clean:
$(RM) pnm2pngm$(O)
$(RM) pnm2pngm$(E)
diff -ru4NwbB libpng-1.4.5/contrib/pngminim/encoder/pngusr.h libpng-1.4.6/contrib/pngminim/encoder/pngusr.h
--- libpng-1.4.5/contrib/pngminim/encoder/pngusr.h 2010-12-09 07:48:12.146321599 -0600
+++ libpng-1.4.6/contrib/pngminim/encoder/pngusr.h 2011-04-08 11:58:24.955111666 -0500
@@ -69,7 +69,7 @@
#define PNG_NO_ERROR_NUMBERS
#define PNG_NO_EASY_ACCESS
#define PNG_NO_USER_LIMITS
#define PNG_NO_SET_USER_LIMITS
-#define PNG_NO_TIME_RFC1143
+#define PNG_NO_TIME_RFC1123
#endif /* MINWRPNGCONF_H */
diff -ru4NwbB libpng-1.4.5/contrib/pngminim/preader/makefile libpng-1.4.6/contrib/pngminim/preader/makefile
--- libpng-1.4.5/contrib/pngminim/preader/makefile 2010-12-09 07:48:12.172810441 -0600
+++ libpng-1.4.6/contrib/pngminim/preader/makefile 2011-04-08 11:58:24.979851565 -0500
@@ -49,9 +49,8 @@
all: rpng2-x$(E)
rpng2-x$(E): $(OBJS)
$(LD) -o rpng2-x$(E) $(OBJS) $(LIBS)
- strip rpng2-x$(E)
clean:
$(RM) rpng2-x$(O)
$(RM) rpng2-x$(E)
diff -ru4NwbB libpng-1.4.5/contrib/pngminim/preader/pngusr.h libpng-1.4.6/contrib/pngminim/preader/pngusr.h
--- libpng-1.4.5/contrib/pngminim/preader/pngusr.h 2010-12-09 07:48:12.181767101 -0600
+++ libpng-1.4.6/contrib/pngminim/preader/pngusr.h 2011-04-08 11:58:24.988295144 -0500
@@ -62,7 +62,7 @@
#define PNG_NO_ERROR_NUMBERS
#define PNG_NO_EASY_ACCESS
#define PNG_NO_USER_LIMITS
#define PNG_NO_SET_USER_LIMITS
-#define PNG_NO_TIME_RFC1143
+#define PNG_NO_TIME_RFC1123
#endif /* MINPRDPNGCONF_H */
diff -ru4NwbB libpng-1.4.5/png.c libpng-1.4.6/png.c
--- libpng-1.4.5/png.c 2010-12-09 07:48:11.298701155 -0600
+++ libpng-1.4.6/png.c 2011-04-08 11:58:23.971609226 -0500
@@ -1,9 +1,9 @@
/* png.c - location for general purpose libpng functions
*
- * Last changed in libpng 1.4.2 [May 6, 2010]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.6 [March 8, 2011]
+ * Copyright (c) 1998-2011 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.
@@ -538,11 +538,11 @@
#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
png_charp PNGAPI
-png_get_copyright(png_structp png_ptr)
+png_get_copyright(png_const_structp png_ptr)
{
- png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
+ PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
#ifdef PNG_STRING_COPYRIGHT
return PNG_STRING_COPYRIGHT
#else
#ifdef __STDC__
@@ -569,25 +569,25 @@
* png_get_header_ver(). Due to the version_nn_nn_nn typedef guard,
* it is guaranteed that png.c uses the correct version of png.h.
*/
png_charp PNGAPI
-png_get_libpng_ver(png_structp png_ptr)
+png_get_libpng_ver(png_const_structp png_ptr)
{
/* Version of *.c files used when building libpng */
- png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
+ PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
return ((png_charp) PNG_LIBPNG_VER_STRING);
}
png_charp PNGAPI
-png_get_header_ver(png_structp png_ptr)
+png_get_header_ver(png_const_structp png_ptr)
{
/* Version of *.h files used when building libpng */
- png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
+ PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
return ((png_charp) PNG_LIBPNG_VER_STRING);
}
png_charp PNGAPI
-png_get_header_version(png_structp png_ptr)
+png_get_header_version(png_const_structp png_ptr)
{
/* Returns longer string containing both version and date */
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
#ifdef __STDC__
diff -ru4NwbB libpng-1.4.5/png.h libpng-1.4.6/png.h
--- libpng-1.4.5/png.h 2010-12-09 07:48:11.265430061 -0600
+++ libpng-1.4.6/png.h 2011-04-08 11:58:23.937816625 -0500
@@ -1,9 +1,9 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.4.6 - April 8, 2011
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Copyright (c) 1998-2011 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 (See LICENSE, below)
@@ -152,8 +152,11 @@
* 1.4.5rc01 14 10405 14.so.14.5[.0]
* 1.4.5beta05-07 14 10405 14.so.14.5[.0]
* 1.4.5rc02-03 14 10405 14.so.14.5[.0]
* 1.4.5 14 10405 14.so.14.5[.0]
+ * 1.4.6beta01-07 14 10406 14.so.14.6[.0]
+ * 1.4.6rc01 14 10406 14.so.14.6[.0]
+ * 1.4.6 14 10406 14.so.14.6[.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
@@ -904,8 +907,9 @@
} png_info;
typedef png_info FAR * png_infop;
+typedef PNG_CONST png_info FAR * png_const_infop;
typedef png_info FAR * FAR * png_infopp;
/* Maximum positive integer used in PNG is (2^31)-1 */
#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)
@@ -1024,8 +1028,9 @@
* user read/write data functions.
*/
typedef struct png_struct_def png_struct;
typedef png_struct FAR * png_structp;
+typedef PNG_CONST png_struct FAR * png_const_structp;
typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp));
typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t));
typedef void (PNGAPI *png_flush_ptr) PNGARG((png_structp));
@@ -1524,9 +1529,9 @@
PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
png_error_ptr error_fn, png_error_ptr warn_fn)) PNG_ALLOCATED;
PNG_EXPORT(png_size_t,png_get_compression_buffer_size)
- PNGARG((png_structp png_ptr));
+ PNGARG((png_const_structp png_ptr));
PNG_EXPORT(void,png_set_compression_buffer_size)
PNGARG((png_structp png_ptr, png_size_t size));
@@ -1646,9 +1651,9 @@
int error_action, double red, double green ));
#endif
PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr,
int error_action, png_fixed_point red, png_fixed_point green ));
-PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp
+PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_const_structp
png_ptr));
#endif
PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth,
@@ -1968,9 +1973,9 @@
PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr,
png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn));
/* Return the user pointer associated with the error functions */
-PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr));
+PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_const_structp png_ptr));
/* Replace the default data output functions with a user supplied one(s).
* If buffered output is not used, then output_flush_fn can be set to NULL.
* If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time
@@ -2001,9 +2006,9 @@
/* Replace the default memory allocation functions with user supplied one(s). */
PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr,
png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn));
/* Return the user pointer associated with the memory functions */
-PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr));
+PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_const_structp png_ptr));
#endif
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp
@@ -2021,15 +2026,15 @@
png_ptr, png_voidp user_transform_ptr, int user_transform_depth,
int user_transform_channels));
/* Return the user pointer associated with the user transform functions */
PNG_EXPORT(png_voidp,png_get_user_transform_ptr)
- PNGARG((png_structp png_ptr));
+ PNGARG((png_const_structp png_ptr));
#endif
#ifdef PNG_USER_CHUNKS_SUPPORTED
PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr,
png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn));
-PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp
+PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_const_structp
png_ptr));
#endif
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
@@ -2042,9 +2047,9 @@
png_progressive_end_ptr end_fn));
/* Returns the user pointer associated with the push read functions */
PNG_EXPORT(png_voidp,png_get_progressive_ptr)
- PNGARG((png_structp png_ptr));
+ PNGARG((png_const_structp png_ptr));
/* Function to be called when data becomes available */
PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr,
png_infop info_ptr, png_bytep buffer, png_size_t buffer_size));
@@ -2150,93 +2155,93 @@
* to avoid problems with future changes in the size and internal layout of
* png_info_struct.
*/
/* Returns "flag" if chunk data is valid in info_ptr. */
-PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr,
-png_infop info_ptr, png_uint_32 flag));
+PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, png_uint_32 flag));
/* Returns number of bytes needed to hold a transformed row. */
-PNG_EXPORT(png_size_t,png_get_rowbytes) PNGARG((png_structp png_ptr,
-png_infop info_ptr));
+PNG_EXPORT(png_size_t,png_get_rowbytes) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr));
#ifdef PNG_INFO_IMAGE_SUPPORTED
/* Returns row_pointers, which is an array of pointers to scanlines that was
* returned from png_read_png().
*/
-PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr,
-png_infop info_ptr));
+PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr));
/* Set row_pointers, which is an array of pointers to scanlines for use
* by png_write_png().
*/
PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr,
png_infop info_ptr, png_bytepp row_pointers));
#endif
/* Returns number of color channels in image. */
-PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr,
-png_infop info_ptr));
+PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr));
#ifdef PNG_EASY_ACCESS_SUPPORTED
/* Returns image width in pixels. */
-PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
+PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
/* Returns image height in pixels. */
-PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
+PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
/* Returns image bit_depth. */
-PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
+PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
/* Returns image color_type. */
-PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
+PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
/* Returns image filter_type. */
-PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
+PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
/* Returns image interlace_type. */
-PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
+PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
/* Returns image compression_type. */
-PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
+PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
/* Returns image resolution in pixels per meter, from pHYs chunk data. */
-PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
-PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
-PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
+PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
/* Returns pixel aspect ratio, computed from pHYs chunk data. */
#ifdef PNG_FLOATING_POINT_SUPPORTED
-PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
+PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
#endif
/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */
-PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
-PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
-PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
-PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp
-png_ptr, png_infop info_ptr));
+PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr));
#endif /* PNG_EASY_ACCESS_SUPPORTED */
/* Returns pointer to signature string read from PNG header */
-PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr,
+PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_const_structp png_ptr,
png_infop info_ptr));
#ifdef PNG_bKGD_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr,
+PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_const_structp png_ptr,
png_infop info_ptr, png_color_16p *background));
#endif
#ifdef PNG_bKGD_SUPPORTED
@@ -2245,16 +2250,16 @@
#endif
#ifdef PNG_cHRM_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr,
- png_infop info_ptr, double *white_x, double *white_y, double *red_x,
+PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((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));
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr,
- png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point
+PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((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));
#endif
@@ -2276,13 +2281,13 @@
#endif
#ifdef PNG_gAMA_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr,
- png_infop info_ptr, double *file_gamma));
+PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, double *file_gamma));
#endif
-PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr,
- png_infop info_ptr, png_fixed_point *int_file_gamma));
+PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, png_fixed_point *int_file_gamma));
#endif
#ifdef PNG_gAMA_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
@@ -2293,10 +2298,10 @@
png_infop info_ptr, png_fixed_point int_file_gamma));
#endif
#ifdef PNG_hIST_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr,
- png_infop info_ptr, png_uint_16p *hist));
+PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, png_uint_16p *hist));
#endif
#ifdef PNG_hIST_SUPPORTED
PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr,
@@ -2313,10 +2318,10 @@
int color_type, int interlace_method, int compression_method,
int filter_method));
#ifdef PNG_oFFs_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr,
- png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,
+PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,
int *unit_type));
#endif
#ifdef PNG_oFFs_SUPPORTED
@@ -2325,10 +2330,10 @@
int unit_type));
#endif
#ifdef PNG_pCAL_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr,
- png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1,
+PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1,
int *type, int *nparams, png_charp *units, png_charpp *params));
#endif
#ifdef PNG_pCAL_SUPPORTED
@@ -2337,25 +2342,25 @@
int type, int nparams, png_charp units, png_charpp params));
#endif
#ifdef PNG_pHYs_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr,
- png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
+PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
#endif
#ifdef PNG_pHYs_SUPPORTED
PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr,
png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type));
#endif
-PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr,
- png_infop info_ptr, png_colorp *palette, int *num_palette));
+PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, png_colorp *palette, int *num_palette));
PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr,
png_infop info_ptr, png_colorp palette, int num_palette));
#ifdef PNG_sBIT_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr,
+PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_const_structp png_ptr,
png_infop info_ptr, png_color_8p *sig_bit));
#endif
#ifdef PNG_sBIT_SUPPORTED
@@ -2363,10 +2368,10 @@
png_infop info_ptr, png_color_8p sig_bit));
#endif
#ifdef PNG_sRGB_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr,
- png_infop info_ptr, int *intent));
+PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, int *intent));
#endif
#ifdef PNG_sRGB_SUPPORTED
PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr,
@@ -2375,10 +2380,10 @@
png_infop info_ptr, int intent));
#endif
#ifdef PNG_iCCP_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr,
- png_infop info_ptr, png_charpp name, int *compression_type,
+PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, png_charpp name, int *compression_type,
png_charpp profile, png_uint_32 *proflen));
/* Note to maintainer: profile should be png_bytepp */
#endif
@@ -2389,10 +2394,10 @@
/* Note to maintainer: profile should be png_bytep */
#endif
#ifdef PNG_sPLT_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr,
- png_infop info_ptr, png_sPLT_tpp entries));
+PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, png_sPLT_tpp entries));
#endif
#ifdef PNG_sPLT_SUPPORTED
PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr,
@@ -2400,10 +2405,10 @@
#endif
#ifdef PNG_TEXT_SUPPORTED
/* png_get_text also returns the number of text chunks in *num_text */
-PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr,
- png_infop info_ptr, png_textp *text_ptr, int *num_text));
+PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, png_textp *text_ptr, int *num_text));
#endif
/* Note while png_set_text() will accept a structure whose text,
* language, and translated keywords are NULL pointers, the structure
@@ -2417,9 +2422,9 @@
png_infop info_ptr, png_textp text_ptr, int num_text));
#endif
#ifdef PNG_tIME_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr,
+PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_const_structp png_ptr,
png_infop info_ptr, png_timep *mod_time));
#endif
#ifdef PNG_tIME_SUPPORTED
@@ -2427,9 +2432,9 @@
png_infop info_ptr, png_timep mod_time));
#endif
#ifdef PNG_tRNS_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr,
+PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_const_structp png_ptr,
png_infop info_ptr, png_bytep *trans_alpha, int *num_trans,
png_color_16p *trans_color));
#endif
@@ -2443,14 +2448,14 @@
#endif
#ifdef PNG_sCAL_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr,
- png_infop info_ptr, int *unit, double *width, double *height));
+PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, int *unit, double *width, double *height));
#else
#ifdef PNG_FIXED_POINT_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr,
- png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight));
+PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight));
#endif
#endif
#endif /* PNG_sCAL_SUPPORTED */
@@ -2485,10 +2490,10 @@
PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr,
png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns));
PNG_EXPORT(void, png_set_unknown_chunk_location)
PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location));
-PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp
- png_ptr, png_infop info_ptr, png_unknown_chunkpp entries));
+PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_const_structp
+ png_ptr, png_const_infop info_ptr, png_unknown_chunkpp entries));
#endif
/* Png_free_data() will turn off the "valid" flag for anything it frees.
* If you need to turn it off for a chunk that your application has freed,
@@ -2508,13 +2513,13 @@
int transforms,
png_voidp params));
#endif
-PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr));
-PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr));
-PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp
+PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_const_structp png_ptr));
+PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_const_structp png_ptr));
+PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_const_structp
png_ptr));
-PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr));
+PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_const_structp png_ptr));
#ifdef PNG_MNG_FEATURES_SUPPORTED
PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp
png_ptr, png_uint_32 mng_features_permitted));
@@ -2537,49 +2542,50 @@
/* Added in libpng-1.2.6 */
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp
png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max));
-PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_structp
+PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_const_structp
png_ptr));
-PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp
+PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_const_structp
png_ptr));
/* Added in libpng-1.4.0 */
PNG_EXPORT(void,png_set_chunk_cache_max) PNGARG((png_structp
png_ptr, png_uint_32 user_chunk_cache_max));
PNG_EXPORT(png_uint_32,png_get_chunk_cache_max)
- PNGARG((png_structp png_ptr));
+ PNGARG((png_const_structp png_ptr));
/* Added in libpng-1.4.1 */
PNG_EXPORT(void,png_set_chunk_malloc_max) PNGARG((png_structp
png_ptr, png_alloc_size_t user_chunk_cache_max));
PNG_EXPORT(png_alloc_size_t,png_get_chunk_malloc_max)
- PNGARG((png_structp png_ptr));
+ PNGARG((png_const_structp png_ptr));
#endif
#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED)
-PNG_EXPORT(png_uint_32,png_get_pixels_per_inch) PNGARG((png_structp png_ptr,
-png_infop info_ptr));
+PNG_EXPORT(png_uint_32,png_get_pixels_per_inch)
+ PNGARG((png_const_structp png_ptr, png_const_infop info_ptr));
-PNG_EXPORT(png_uint_32,png_get_x_pixels_per_inch) PNGARG((png_structp png_ptr,
-png_infop info_ptr));
+PNG_EXPORT(png_uint_32,png_get_x_pixels_per_inch)
+ PNGARG((png_const_structp png_ptr, png_const_infop info_ptr));
-PNG_EXPORT(png_uint_32,png_get_y_pixels_per_inch) PNGARG((png_structp png_ptr,
-png_infop info_ptr));
+PNG_EXPORT(png_uint_32,png_get_y_pixels_per_inch)
+ PNGARG((png_const_structp png_ptr, png_const_infop info_ptr));
-PNG_EXPORT(float,png_get_x_offset_inches) PNGARG((png_structp png_ptr,
-png_infop info_ptr));
+PNG_EXPORT(float,png_get_x_offset_inches) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr));
-PNG_EXPORT(float,png_get_y_offset_inches) PNGARG((png_structp png_ptr,
-png_infop info_ptr));
+PNG_EXPORT(float,png_get_y_offset_inches) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr));
#ifdef PNG_pHYs_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_pHYs_dpi) PNGARG((png_structp png_ptr,
-png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
+PNG_EXPORT(png_uint_32,png_get_pHYs_dpi) PNGARG((png_const_structp png_ptr,
+ png_const_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,
+ int *unit_type));
#endif /* PNG_pHYs_SUPPORTED */
#endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */
/* Added in libpng-1.4.0 */
#ifdef PNG_IO_STATE_SUPPORTED
-PNG_EXPORT(png_uint_32,png_get_io_state) PNGARG((png_structp png_ptr));
+PNG_EXPORT(png_uint_32,png_get_io_state) PNGARG((png_const_structp png_ptr));
PNG_EXPORT(png_bytep,png_get_io_chunk_name)
PNGARG((png_structp png_ptr));
diff -ru4NwbB libpng-1.4.5/pngconf.h libpng-1.4.6/pngconf.h
--- libpng-1.4.5/pngconf.h 2010-12-09 07:48:11.275093443 -0600
+++ libpng-1.4.6/pngconf.h 2011-04-08 11:58:23.947467007 -0500
@@ -2,9 +2,9 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.4.6 - April 8, 2011
* For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Copyright (c) 1998-2011 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.
@@ -83,8 +83,20 @@
#endif /* __STDC__ */
/* End of material added to libpng-1.2.8 */
+/* Added at libpng-1.4.6 */
+#ifndef PNG_UNUSED
+/* Unused formal parameter warnings are silenced using the following macro
+ * which is expected to have no bad effects on performance (optimizing
+ * compilers will probably remove it entirely). Note that if you replace
+ * it with something other than whitespace, you must include the terminating
+ * semicolon.
+ */
+# define PNG_UNUSED(param) (void)param;
+#endif
+/* End of material added to libpng-1.4.6 */
+
#ifndef PNG_VERSION_INFO_ONLY
/* This is the size of the compression buffer, and thus the size of
* an IDAT chunk. Make this whatever size you feel is best for your
@@ -1379,16 +1391,16 @@
# endif
# ifndef PNG_ALLOCATED
# define PNG_ALLOCATED __attribute__((__malloc__))
# endif
+# ifndef PNG_DEPRECATED
+# define PNG_DEPRECATED __attribute__((__deprecated__))
+# endif
/* This specifically protects structure members that should only be
* accessed from within the library, therefore should be empty during
* a library build.
*/
-# ifndef PNG_DEPRECATED
-# define PNG_DEPRECATED __attribute__((__deprecated__))
-# endif
# ifndef PNG_DEPSTRUCT
# define PNG_DEPSTRUCT __attribute__((__deprecated__))
# endif
# ifndef PNG_PRIVATE
@@ -1400,8 +1412,39 @@
__attribute__((__deprecated__))
# endif
# endif /* PNG_PRIVATE */
# endif /* __GNUC__ */
+
+# if defined(_MSC_VER) && (_MSC_VER >= 1300)
+# ifndef PNG_USE_RESULT
+# define PNG_USE_RESULT /* not supported */
+# endif
+# ifndef PNG_NORETURN
+# define PNG_NORETURN __declspec(noreturn)
+# endif
+# ifndef PNG_PTR_NORETURN
+# define PNG_PTR_NORETURN /* not supported */
+# endif
+# ifndef PNG_ALLOCATED
+# define PNG_ALLOCATED __declspec(restrict)
+# endif
+
+ /* This specifically protects structure members that should only be
+ * accessed from within the library, therefore should be empty during
+ * a library build.
+ */
+# ifndef PNGLIB_BUILD
+# ifndef PNG_DEPRECATED
+# define PNG_DEPRECATED __declspec(deprecated)
+# endif
+# ifndef PNG_DEPSTRUCT
+# define PNG_DEPSTRUCT __declspec(deprecated)
+# endif
+# ifndef PNG_PRIVATE
+# define PNG_PRIVATE __declspec(deprecated)
+# endif
+# endif /* PNGLIB_BUILD */
+# endif /* _MSC_VER */
#endif /* PNG_PEDANTIC_WARNINGS */
#ifndef PNG_DEPRECATED
# define PNG_DEPRECATED /* Use of this function is deprecated */
diff -ru4NwbB libpng-1.4.5/pngerror.c libpng-1.4.6/pngerror.c
--- libpng-1.4.5/pngerror.c 2010-12-09 07:48:11.304507371 -0600
+++ libpng-1.4.6/pngerror.c 2011-04-08 11:58:23.977643726 -0500
@@ -1,9 +1,9 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
- * Last changed in libpng 1.4.0 [January 3, 2010]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.6 [March 8, 2011]
+ * Copyright (c) 1998-2011 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.
@@ -305,9 +305,9 @@
#endif
/* Here if not setjmp support or if png_ptr is null. */
PNG_ABORT();
#ifndef PNG_CONSOLE_IO_SUPPORTED
- error_message = error_message; /* Make compiler happy */
+ PNG_UNUSED(error_message) /* Make compiler happy */
#endif
}
#ifdef PNG_WARNINGS_SUPPORTED
@@ -351,11 +351,11 @@
fprintf(stderr, "libpng warning: %s", warning_message);
fprintf(stderr, PNG_STRING_NEWLINE);
}
#else
- warning_message = warning_message; /* Make compiler happy */
+ PNG_UNUSED(warning_message) /* Make compiler happy */
#endif
- png_ptr = png_ptr; /* Make compiler happy */
+ PNG_UNUSED(png_ptr) /* Make compiler happy */
}
#endif /* PNG_WARNINGS_SUPPORTED */
/* This function is called when the application wants to use another method
@@ -379,9 +379,9 @@
* functions. The application should free any memory associated with this
* pointer before png_write_destroy and png_read_destroy are called.
*/
png_voidp PNGAPI
-png_get_error_ptr(png_structp png_ptr)
+png_get_error_ptr(png_const_structp png_ptr)
{
if (png_ptr == NULL)
return NULL;
return ((png_voidp)png_ptr->error_ptr);
diff -ru4NwbB libpng-1.4.5/pngget.c libpng-1.4.6/pngget.c
--- libpng-1.4.5/pngget.c 2010-12-09 07:48:11.312062866 -0600
+++ libpng-1.4.6/pngget.c 2011-04-08 11:58:23.985166914 -0500
@@ -1,9 +1,9 @@
/* pngget.c - retrieval of values from info struct
*
- * Last changed in libpng 1.4.2 [May 6, 2010]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.6 [April 8, 2011]
+ * Copyright (c) 1998-2011 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.
@@ -17,9 +17,10 @@
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
#include "pngpriv.h"
png_uint_32 PNGAPI
-png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag)
+png_get_valid(png_const_structp png_ptr, png_const_infop info_ptr,
+ png_uint_32 flag)
{
if (png_ptr != NULL && info_ptr != NULL)
return(info_ptr->valid & flag);
@@ -27,9 +28,9 @@
return(0);
}
png_size_t PNGAPI
-png_get_rowbytes(png_structp png_ptr, png_infop info_ptr)
+png_get_rowbytes(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
return(info_ptr->rowbytes);
@@ -38,9 +39,9 @@
}
#ifdef PNG_INFO_IMAGE_SUPPORTED
png_bytepp PNGAPI
-png_get_rows(png_structp png_ptr, png_infop info_ptr)
+png_get_rows(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
return(info_ptr->row_pointers);
@@ -51,72 +52,72 @@
#ifdef PNG_EASY_ACCESS_SUPPORTED
/* Easy access to info, added in libpng-0.99 */
png_uint_32 PNGAPI
-png_get_image_width(png_structp png_ptr, png_infop info_ptr)
+png_get_image_width(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->width;
return (0);
}
png_uint_32 PNGAPI
-png_get_image_height(png_structp png_ptr, png_infop info_ptr)
+png_get_image_height(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->height;
return (0);
}
png_byte PNGAPI
-png_get_bit_depth(png_structp png_ptr, png_infop info_ptr)
+png_get_bit_depth(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->bit_depth;
return (0);
}
png_byte PNGAPI
-png_get_color_type(png_structp png_ptr, png_infop info_ptr)
+png_get_color_type(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->color_type;
return (0);
}
png_byte PNGAPI
-png_get_filter_type(png_structp png_ptr, png_infop info_ptr)
+png_get_filter_type(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->filter_type;
return (0);
}
png_byte PNGAPI
-png_get_interlace_type(png_structp png_ptr, png_infop info_ptr)
+png_get_interlace_type(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->interlace_type;
return (0);
}
png_byte PNGAPI
-png_get_compression_type(png_structp png_ptr, png_infop info_ptr)
+png_get_compression_type(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->compression_type;
return (0);
}
png_uint_32 PNGAPI
-png_get_x_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
+png_get_x_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#ifdef PNG_pHYs_SUPPORTED
if (info_ptr->valid & PNG_INFO_pHYs)
@@ -135,9 +136,9 @@
return (0);
}
png_uint_32 PNGAPI
-png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
+png_get_y_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#ifdef PNG_pHYs_SUPPORTED
if (info_ptr->valid & PNG_INFO_pHYs)
@@ -156,9 +157,9 @@
return (0);
}
png_uint_32 PNGAPI
-png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
+png_get_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#ifdef PNG_pHYs_SUPPORTED
if (info_ptr->valid & PNG_INFO_pHYs)
@@ -179,9 +180,9 @@
}
#ifdef PNG_FLOATING_POINT_SUPPORTED
float PNGAPI
-png_get_pixel_aspect_ratio(png_structp png_ptr, png_infop info_ptr)
+png_get_pixel_aspect_ratio(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#ifdef PNG_pHYs_SUPPORTED
@@ -203,9 +204,9 @@
}
#endif
png_int_32 PNGAPI
-png_get_x_offset_microns(png_structp png_ptr, png_infop info_ptr)
+png_get_x_offset_microns(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#ifdef PNG_oFFs_SUPPORTED
@@ -225,9 +226,9 @@
return (0);
}
png_int_32 PNGAPI
-png_get_y_offset_microns(png_structp png_ptr, png_infop info_ptr)
+png_get_y_offset_microns(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#ifdef PNG_oFFs_SUPPORTED
@@ -247,9 +248,9 @@
return (0);
}
png_int_32 PNGAPI
-png_get_x_offset_pixels(png_structp png_ptr, png_infop info_ptr)
+png_get_x_offset_pixels(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#ifdef PNG_oFFs_SUPPORTED
@@ -269,9 +270,9 @@
return (0);
}
png_int_32 PNGAPI
-png_get_y_offset_pixels(png_structp png_ptr, png_infop info_ptr)
+png_get_y_offset_pixels(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#ifdef PNG_oFFs_SUPPORTED
@@ -292,45 +293,45 @@
}
#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED)
png_uint_32 PNGAPI
-png_get_pixels_per_inch(png_structp png_ptr, png_infop info_ptr)
+png_get_pixels_per_inch(png_const_structp png_ptr, png_const_infop info_ptr)
{
return ((png_uint_32)((float)png_get_pixels_per_meter(png_ptr, info_ptr)
*.0254 +.5));
}
png_uint_32 PNGAPI
-png_get_x_pixels_per_inch(png_structp png_ptr, png_infop info_ptr)
+png_get_x_pixels_per_inch(png_const_structp png_ptr, png_const_infop info_ptr)
{
return ((png_uint_32)((float)png_get_x_pixels_per_meter(png_ptr, info_ptr)
*.0254 +.5));
}
png_uint_32 PNGAPI
-png_get_y_pixels_per_inch(png_structp png_ptr, png_infop info_ptr)
+png_get_y_pixels_per_inch(png_const_structp png_ptr, png_const_infop info_ptr)
{
return ((png_uint_32)((float)png_get_y_pixels_per_meter(png_ptr, info_ptr)
*.0254 +.5));
}
float PNGAPI
-png_get_x_offset_inches(png_structp png_ptr, png_infop info_ptr)
+png_get_x_offset_inches(png_const_structp png_ptr, png_const_infop info_ptr)
{
return ((float)png_get_x_offset_microns(png_ptr, info_ptr)
*.00003937);
}
float PNGAPI
-png_get_y_offset_inches(png_structp png_ptr, png_infop info_ptr)
+png_get_y_offset_inches(png_const_structp png_ptr, png_const_infop info_ptr)
{
return ((float)png_get_y_offset_microns(png_ptr, info_ptr)
*.00003937);
}
#ifdef PNG_pHYs_SUPPORTED
png_uint_32 PNGAPI
-png_get_pHYs_dpi(png_structp png_ptr, png_infop info_ptr,
+png_get_pHYs_dpi(png_const_structp png_ptr, png_const_infop info_ptr,
png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)
{
png_uint_32 retval = 0;
@@ -368,18 +369,18 @@
#endif /* PNG_EASY_ACCESS_SUPPORTED */
png_byte PNGAPI
-png_get_channels(png_structp png_ptr, png_infop info_ptr)
+png_get_channels(png_const_structp png_ptr, png_const_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
return(info_ptr->channels);
else
return (0);
}
png_bytep PNGAPI
-png_get_signature(png_structp png_ptr, png_infop info_ptr)
+png_get_signature(png_const_structp png_ptr, png_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
return(info_ptr->signature);
else
@@ -387,9 +388,9 @@
}
#ifdef PNG_bKGD_SUPPORTED
png_uint_32 PNGAPI
-png_get_bKGD(png_structp png_ptr, png_infop info_ptr,
+png_get_bKGD(png_const_structp png_ptr, png_infop info_ptr,
png_color_16p *background)
{
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD)
&& background != NULL)
@@ -405,9 +406,9 @@
#ifdef PNG_cHRM_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
png_uint_32 PNGAPI
-png_get_cHRM(png_structp png_ptr, png_infop info_ptr,
+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)
{
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM))
@@ -436,9 +437,9 @@
}
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
png_uint_32 PNGAPI
-png_get_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
+png_get_cHRM_fixed(png_const_structp png_ptr, png_const_infop info_ptr,
png_fixed_point *white_x, png_fixed_point *white_y, png_fixed_point *red_x,
png_fixed_point *red_y, png_fixed_point *green_x, png_fixed_point *green_y,
png_fixed_point *blue_x, png_fixed_point *blue_y)
{
@@ -471,9 +472,9 @@
#ifdef PNG_gAMA_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
png_uint_32 PNGAPI
-png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma)
+png_get_gAMA(png_const_structp png_ptr, png_const_infop info_ptr, double *file_gamma)
{
png_debug1(1, "in %s retrieval function", "gAMA");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
@@ -486,9 +487,9 @@
}
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
png_uint_32 PNGAPI
-png_get_gAMA_fixed(png_structp png_ptr, png_infop info_ptr,
+png_get_gAMA_fixed(png_const_structp png_ptr, png_const_infop info_ptr,
png_fixed_point *int_file_gamma)
{
png_debug1(1, "in %s retrieval function", "gAMA");
@@ -504,9 +505,10 @@
#endif
#ifdef PNG_sRGB_SUPPORTED
png_uint_32 PNGAPI
-png_get_sRGB(png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent)
+png_get_sRGB(png_const_structp png_ptr, png_const_infop info_ptr,
+ int *file_srgb_intent)
{
png_debug1(1, "in %s retrieval function", "sRGB");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB)
@@ -520,9 +522,9 @@
#endif
#ifdef PNG_iCCP_SUPPORTED
png_uint_32 PNGAPI
-png_get_iCCP(png_structp png_ptr, png_infop info_ptr,
+png_get_iCCP(png_const_structp png_ptr, png_const_infop info_ptr,
png_charpp name, int *compression_type,
png_charpp profile, png_uint_32 *proflen)
{
png_debug1(1, "in %s retrieval function", "iCCP");
@@ -544,9 +546,9 @@
#endif
#ifdef PNG_sPLT_SUPPORTED
png_uint_32 PNGAPI
-png_get_sPLT(png_structp png_ptr, png_infop info_ptr,
+png_get_sPLT(png_const_structp png_ptr, png_const_infop info_ptr,
png_sPLT_tpp spalettes)
{
if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL)
{
@@ -558,9 +560,10 @@
#endif
#ifdef PNG_hIST_SUPPORTED
png_uint_32 PNGAPI
-png_get_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p *hist)
+png_get_hIST(png_const_structp png_ptr, png_const_infop info_ptr,
+ png_uint_16p *hist)
{
png_debug1(1, "in %s retrieval function", "hIST");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST)
@@ -613,9 +616,9 @@
}
#ifdef PNG_oFFs_SUPPORTED
png_uint_32 PNGAPI
-png_get_oFFs(png_structp png_ptr, png_infop info_ptr,
+png_get_oFFs(png_const_structp png_ptr, png_const_infop info_ptr,
png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)
{
png_debug1(1, "in %s retrieval function", "oFFs");
@@ -632,9 +635,9 @@
#endif
#ifdef PNG_pCAL_SUPPORTED
png_uint_32 PNGAPI
-png_get_pCAL(png_structp png_ptr, png_infop info_ptr,
+png_get_pCAL(png_const_structp png_ptr, png_const_infop info_ptr,
png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams,
png_charp *units, png_charpp *params)
{
png_debug1(1, "in %s retrieval function", "pCAL");
@@ -658,9 +661,9 @@
#ifdef PNG_sCAL_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
png_uint_32 PNGAPI
-png_get_sCAL(png_structp png_ptr, png_infop info_ptr,
+png_get_sCAL(png_const_structp png_ptr, png_const_infop info_ptr,
int *unit, double *width, double *height)
{
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_sCAL))
@@ -674,9 +677,9 @@
}
#else
#ifdef PNG_FIXED_POINT_SUPPORTED
png_uint_32 PNGAPI
-png_get_sCAL_s(png_structp png_ptr, png_infop info_ptr,
+png_get_sCAL_s(png_const_structp png_ptr, png_const_infop info_ptr,
int *unit, png_charpp width, png_charpp height)
{
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_sCAL))
@@ -693,9 +696,9 @@
#endif
#ifdef PNG_pHYs_SUPPORTED
png_uint_32 PNGAPI
-png_get_pHYs(png_structp png_ptr, png_infop info_ptr,
+png_get_pHYs(png_const_structp png_ptr, png_const_infop info_ptr,
png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)
{
png_uint_32 retval = 0;
@@ -726,9 +729,10 @@
}
#endif
png_uint_32 PNGAPI
-png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette,
+png_get_PLTE(png_const_structp png_ptr, png_const_infop info_ptr,
+ png_colorp *palette,
int *num_palette)
{
png_debug1(1, "in %s retrieval function", "PLTE");
@@ -744,9 +748,10 @@
}
#ifdef PNG_sBIT_SUPPORTED
png_uint_32 PNGAPI
-png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit)
+png_get_sBIT(png_const_structp png_ptr, png_infop info_ptr,
+ png_color_8p *sig_bit)
{
png_debug1(1, "in %s retrieval function", "sBIT");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT)
@@ -760,10 +765,10 @@
#endif
#ifdef PNG_TEXT_SUPPORTED
png_uint_32 PNGAPI
-png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr,
- int *num_text)
+png_get_text(png_const_structp png_ptr, png_const_infop info_ptr,
+ png_textp *text_ptr, int *num_text)
{
if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0)
{
png_debug1(1, "in %s retrieval function",
@@ -785,9 +790,10 @@
#endif
#ifdef PNG_tIME_SUPPORTED
png_uint_32 PNGAPI
-png_get_tIME(png_structp png_ptr, png_infop info_ptr, png_timep *mod_time)
+png_get_tIME(png_const_structp png_ptr, png_infop info_ptr,
+ png_timep *mod_time)
{
png_debug1(1, "in %s retrieval function", "tIME");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME)
@@ -801,9 +807,9 @@
#endif
#ifdef PNG_tRNS_SUPPORTED
png_uint_32 PNGAPI
-png_get_tRNS(png_structp png_ptr, png_infop info_ptr,
+png_get_tRNS(png_const_structp png_ptr, png_infop info_ptr,
png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)
{
png_uint_32 retval = 0;
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS))
@@ -843,9 +849,9 @@
#endif
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
png_uint_32 PNGAPI
-png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr,
+png_get_unknown_chunks(png_const_structp png_ptr, png_const_infop info_ptr,
png_unknown_chunkpp unknowns)
{
if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL)
{
@@ -857,24 +863,24 @@
#endif
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
png_byte PNGAPI
-png_get_rgb_to_gray_status(png_structp png_ptr)
+png_get_rgb_to_gray_status(png_const_structp png_ptr)
{
return (png_byte)(png_ptr? png_ptr->rgb_to_gray_status : 0);
}
#endif
#ifdef PNG_USER_CHUNKS_SUPPORTED
png_voidp PNGAPI
-png_get_user_chunk_ptr(png_structp png_ptr)
+png_get_user_chunk_ptr(png_const_structp png_ptr)
{
return (png_ptr? png_ptr->user_chunk_ptr : NULL);
}
#endif
png_size_t PNGAPI
-png_get_compression_buffer_size(png_structp png_ptr)
+png_get_compression_buffer_size(png_const_structp png_ptr)
{
return (png_ptr ? png_ptr->zbuf_size : 0L);
}
@@ -882,26 +888,26 @@
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
/* These functions were added to libpng 1.2.6 and were enabled
* by default in libpng-1.4.0 */
png_uint_32 PNGAPI
-png_get_user_width_max(png_structp png_ptr)
+png_get_user_width_max(png_const_structp png_ptr)
{
return (png_ptr? png_ptr->user_width_max : 0);
}
png_uint_32 PNGAPI
-png_get_user_height_max(png_structp png_ptr)
+png_get_user_height_max(png_const_structp png_ptr)
{
return (png_ptr? png_ptr->user_height_max : 0);
}
/* This function was added to libpng 1.4.0 */
png_uint_32 PNGAPI
-png_get_chunk_cache_max(png_structp png_ptr)
+png_get_chunk_cache_max(png_const_structp png_ptr)
{
return (png_ptr? png_ptr->user_chunk_cache_max : 0);
}
/* This function was added to libpng 1.4.1 */
png_alloc_size_t PNGAPI
-png_get_chunk_malloc_max(png_structp png_ptr)
+png_get_chunk_malloc_max(png_const_structp png_ptr)
{
return (png_ptr?
png_ptr->user_chunk_malloc_max : 0);
}
@@ -909,9 +915,9 @@
/* These functions were added to libpng 1.4.0 */
#ifdef PNG_IO_STATE_SUPPORTED
png_uint_32 PNGAPI
-png_get_io_state(png_structp png_ptr)
+png_get_io_state(png_const_structp png_ptr)
{
return png_ptr->io_state;
}
diff -ru4NwbB libpng-1.4.5/pngmem.c libpng-1.4.6/pngmem.c
--- libpng-1.4.5/pngmem.c 2010-12-09 07:48:11.318609540 -0600
+++ libpng-1.4.6/pngmem.c 2011-04-08 11:58:23.991962694 -0500
@@ -1,9 +1,9 @@
/* pngmem.c - stub functions for memory allocation
*
- * Last changed in libpng 1.4.2 [May 6, 2010]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.6 [April 8, 2011]
+ * Copyright (c) 1998-2011 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.
@@ -600,9 +600,9 @@
* functions. The application should free any memory associated with this
* pointer before png_write_destroy and png_read_destroy are called.
*/
png_voidp PNGAPI
-png_get_mem_ptr(png_structp png_ptr)
+png_get_mem_ptr(png_const_structp png_ptr)
{
if (png_ptr == NULL)
return (NULL);
return ((png_voidp)png_ptr->mem_ptr);
diff -ru4NwbB libpng-1.4.5/pngpread.c libpng-1.4.6/pngpread.c
--- libpng-1.4.5/pngpread.c 2010-12-09 07:48:11.328249223 -0600
+++ libpng-1.4.6/pngpread.c 2011-04-08 11:58:24.001763859 -0500
@@ -1,9 +1,9 @@
/* pngpread.c - read a png file in push mode
*
- * Last changed in libpng 1.4.3 [June 26, 2010]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.6 [March 8, 2011]
+ * Copyright (c) 1998-2011 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.
@@ -1203,9 +1203,9 @@
{
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
{
png_error(png_ptr, "Out of place tEXt");
- info_ptr = info_ptr; /* To quiet some compiler warnings */
+ PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
}
#ifdef PNG_MAX_MALLOC_64K
png_ptr->skip_length = 0; /* This may not be necessary */
@@ -1301,9 +1301,9 @@
{
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
{
png_error(png_ptr, "Out of place zTXt");
- info_ptr = info_ptr; /* To quiet some compiler warnings */
+ PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
}
#ifdef PNG_MAX_MALLOC_64K
/* We can't handle zTXt chunks > 64K, since we don't have enough space
@@ -1502,9 +1502,9 @@
{
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
{
png_error(png_ptr, "Out of place iTXt");
- info_ptr = info_ptr; /* To quiet some compiler warnings */
+ PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
}
#ifdef PNG_MAX_MALLOC_64K
png_ptr->skip_length = 0; /* This may not be necessary */
@@ -1636,10 +1636,9 @@
#endif
)
#endif
png_chunk_error(png_ptr, "unknown critical chunk");
-
- info_ptr = info_ptr; /* To quiet some compiler warnings */
+ PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
}
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
if (png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS)
@@ -1756,9 +1755,9 @@
png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer);
}
png_voidp PNGAPI
-png_get_progressive_ptr(png_structp png_ptr)
+png_get_progressive_ptr(png_const_structp png_ptr)
{
if (png_ptr == NULL)
return (NULL);
diff -ru4NwbB libpng-1.4.5/pngpriv.h libpng-1.4.6/pngpriv.h
--- libpng-1.4.5/pngpriv.h 2010-12-09 07:48:11.283143510 -0600
+++ libpng-1.4.6/pngpriv.h 2011-04-08 11:58:23.955549933 -0500
@@ -2,9 +2,9 @@
/* pngpriv.h - private declarations for use inside libpng
*
* libpng version 1.4.6 - April 8, 2011
* For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Copyright (c) 1998-2011 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.
diff -ru4NwbB libpng-1.4.5/pngread.c libpng-1.4.6/pngread.c
--- libpng-1.4.5/pngread.c 2010-12-09 07:48:11.337481929 -0600
+++ libpng-1.4.6/pngread.c 2011-04-08 11:58:24.010792662 -0500
@@ -1,9 +1,9 @@
/* pngread.c - read a PNG file
*
- * Last changed in libpng 1.4.5 [April 8, 2011]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.6 [March 8, 2011]
+ * Copyright (c) 1998-2011 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.
@@ -438,12 +438,14 @@
void PNGAPI
png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
{
PNG_IDAT;
+#ifdef PNG_READ_INTERLACING_SUPPORTED
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};
int ret;
+#endif
if (png_ptr == NULL)
return;
@@ -1336,10 +1338,10 @@
/* Read rest of file, and get additional chunks in info_ptr - REQUIRED */
png_read_end(png_ptr, info_ptr);
- transforms = transforms; /* Quiet compiler warnings */
- params = params;
+ PNG_UNUSED(transforms) /* Quiet compiler warnings */
+ PNG_UNUSED(params)
}
#endif /* PNG_INFO_IMAGE_SUPPORTED */
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
diff -ru4NwbB libpng-1.4.5/pngrio.c libpng-1.4.6/pngrio.c
--- libpng-1.4.5/pngrio.c 2010-12-09 07:48:11.342533773 -0600
+++ libpng-1.4.6/pngrio.c 2011-04-08 11:58:24.016189340 -0500
@@ -1,9 +1,9 @@
/* pngrio.c - functions for data input
*
- * Last changed in libpng 1.4.5 [April 8, 2011]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.6 [January 14, 2011]
+ * Copyright (c) 1998-2011 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.
diff -ru4NwbB libpng-1.4.5/pngrtran.c libpng-1.4.6/pngrtran.c
--- libpng-1.4.5/pngrtran.c 2010-12-09 07:48:11.359864654 -0600
+++ libpng-1.4.6/pngrtran.c 2011-04-08 11:58:24.033543755 -0500
@@ -1,9 +1,9 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
- * Last changed in libpng 1.4.5 [April 8, 2011]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.6 [%RDATE%]
+ * Copyright (c) 1998-2011 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.
@@ -1007,9 +1007,9 @@
* to a simple alpha channel strip.
*/
png_ptr->transformations &= ~PNG_BACKGROUND;
png_ptr->transformations &= ~PNG_GAMMA;
- png_ptr->transformations |= PNG_STRIP_ALPHA;
+ png_ptr->flags |= PNG_FLAG_STRIP_ALPHA;
}
/* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN) */
else
/* color_type != PNG_COLOR_TYPE_PALETTE */
@@ -1130,9 +1130,9 @@
}
/* Handled alpha, still need to strip the channel. */
png_ptr->transformations &= ~PNG_BACKGROUND;
- png_ptr->transformations |= PNG_STRIP_ALPHA;
+ png_ptr->flags |= PNG_FLAG_STRIP_ALPHA;
}
#endif /* PNG_READ_BACKGROUND_SUPPORTED */
#ifdef PNG_READ_SHIFT_SUPPORTED
@@ -2289,9 +2289,9 @@
int rgb_error = 0;
png_debug(1, "in png_do_rgb_to_gray");
- if (
+ if (!(row_info->color_type & PNG_COLOR_MASK_PALETTE) &&
(row_info->color_type & PNG_COLOR_MASK_COLOR))
{
png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff;
png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff;
diff -ru4NwbB libpng-1.4.5/pngrutil.c libpng-1.4.6/pngrutil.c
--- libpng-1.4.5/pngrutil.c 2010-12-09 07:48:11.374981056 -0600
+++ libpng-1.4.6/pngrutil.c 2011-04-08 11:58:24.049012242 -0500
@@ -1,9 +1,9 @@
/* pngrutil.c - utilities to read a PNG file
*
- * Last changed in libpng 1.4.5 [April 8, 2011]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.6 [March 8, 2011]
+ * Copyright (c) 1998-2011 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.
@@ -137,9 +137,9 @@
/* Put the chunk name into png_ptr->chunk_name. */
png_memcpy(png_ptr->chunk_name, buf + 4, 4);
png_debug2(0, "Reading %s chunk, length = %lu",
- png_ptr->chunk_name, length);
+ png_ptr->chunk_name, (unsigned long)length);
/* Reset the crc and run it over the chunk name. */
png_reset_crc(png_ptr);
png_calculate_crc(png_ptr, png_ptr->chunk_name, 4);
@@ -702,9 +702,9 @@
png_warning(png_ptr, "Incorrect IEND chunk length");
}
png_crc_finish(png_ptr, length);
- info_ptr = info_ptr; /* Quiet compiler warnings about unused info_ptr */
+ PNG_UNUSED(info_ptr) /* Quiet compiler warnings about unused info_ptr */
}
#ifdef PNG_READ_gAMA_SUPPORTED
void /* PRIVATE */
@@ -1215,11 +1215,9 @@
/* Note: this does not properly handle chunks that are > 64K under DOS */
{
png_bytep entry_start;
png_sPLT_t new_palette;
-#ifdef PNG_POINTER_INDEXING_SUPPORTED
png_sPLT_entryp pp;
-#endif
int data_length, entry_size, i;
png_uint_32 skip = 0;
png_size_t slength;
@@ -1356,9 +1354,9 @@
pp[i].green = png_get_uint_16(entry_start); entry_start += 2;
pp[i].blue = png_get_uint_16(entry_start); entry_start += 2;
pp[i].alpha = png_get_uint_16(entry_start); entry_start += 2;
}
- pp->frequency = png_get_uint_16(entry_start); entry_start += 2;
+ pp[i].frequency = png_get_uint_16(entry_start); entry_start += 2;
}
#endif
/* Discard all chunk data except the name and stash that */
@@ -1725,9 +1723,9 @@
return;
}
png_debug1(2, "Allocating and reading pCAL chunk data (%lu bytes)",
- length + 1);
+ (unsigned long)(length + 1));
png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
if (png_ptr->chunkdata == NULL)
{
@@ -1863,9 +1861,9 @@
return;
}
png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)",
- length + 1);
+ (unsigned long)(length + 1));
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
if (png_ptr->chunkdata == NULL)
{
png_warning(png_ptr, "Out of memory while processing sCAL chunk");
@@ -2504,9 +2502,9 @@
png_crc_finish(png_ptr, skip);
#ifndef PNG_READ_USER_CHUNKS_SUPPORTED
- info_ptr = info_ptr; /* Quiet compiler warnings about unused info_ptr */
+ PNG_UNUSED(info_ptr) /* Quiet compiler warnings about unused info_ptr */
#endif
}
/* This function is called to verify that a chunk name is valid.
@@ -2960,9 +2958,9 @@
row_info->width = final_width;
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, final_width);
}
#ifndef PNG_READ_PACKSWAP_SUPPORTED
- transformations = transformations; /* Silence compiler warning */
+ PNG_UNUSED(transformations) /* Silence compiler warning */
#endif
}
#endif /* PNG_READ_INTERLACING_SUPPORTED */
@@ -2970,9 +2968,10 @@
png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row,
png_bytep prev_row, int filter)
{
png_debug(1, "in png_read_filter_row");
- png_debug2(2, "row = %lu, filter = %d", png_ptr->row_number, filter);
+ png_debug2(2, "row = %lu, filter = %d",
+ (unsigned long)png_ptr->row_number, filter);
switch (filter)
{
case PNG_FILTER_VALUE_NONE:
break;
@@ -3411,15 +3410,15 @@
}
png_memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
- png_debug1(3, "width = %lu,", png_ptr->width);
- png_debug1(3, "height = %lu,", png_ptr->height);
- png_debug1(3, "iwidth = %lu,", png_ptr->iwidth);
- png_debug1(3, "num_rows = %lu,", png_ptr->num_rows);
- png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes);
+ png_debug1(3, "width = %lu,", (unsigned long)png_ptr->width);
+ png_debug1(3, "height = %lu,", (unsigned long)png_ptr->height);
+ png_debug1(3, "iwidth = %lu,", (unsigned long)png_ptr->iwidth);
+ png_debug1(3, "num_rows = %lu,", (unsigned long)png_ptr->num_rows);
+ png_debug1(3, "rowbytes = %lu,", (unsigned long)png_ptr->rowbytes);
png_debug1(3, "irowbytes = %lu",
- PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1);
+ (unsigned long)PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1);
png_ptr->flags |= PNG_FLAG_ROW_INIT;
}
#endif /* PNG_READ_SUPPORTED */
diff -ru4NwbB libpng-1.4.5/pngset.c libpng-1.4.6/pngset.c
--- libpng-1.4.5/pngset.c 2010-12-09 07:48:11.383950690 -0600
+++ libpng-1.4.6/pngset.c 2011-04-08 11:58:24.057998652 -0500
@@ -1,9 +1,9 @@
/* pngset.c - storage of image information into info struct
*
- * Last changed in libpng 1.4.5 [April 8, 2011]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.6 [January 14, 2011]
+ * Copyright (c) 1998-2011 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.
diff -ru4NwbB libpng-1.4.5/pngtest.c libpng-1.4.6/pngtest.c
--- libpng-1.4.5/pngtest.c 2010-12-09 07:48:11.393765714 -0600
+++ libpng-1.4.6/pngtest.c 2011-04-08 11:58:24.068297888 -0500
@@ -1,9 +1,9 @@
/* pngtest.c - a simple test program to test libpng
*
- * Last changed in libpng 1.4.5 [April 8, 2011]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.6 [March 8, 2011]
+ * Copyright (c) 1998-2011 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.
@@ -386,9 +386,9 @@
static void
pngtest_flush(png_structp png_ptr)
{
/* Do nothing; fflush() is said to be just a waste of energy. */
- png_ptr = png_ptr; /* Stifle compiler warning */
+ PNG_UNUSED(png_ptr) /* Stifle compiler warning */
}
#endif
/* This is the function that does the actual writing of data. If you are
diff -ru4NwbB libpng-1.4.5/pngtrans.c libpng-1.4.6/pngtrans.c
--- libpng-1.4.5/pngtrans.c 2010-12-09 07:48:11.400556202 -0600
+++ libpng-1.4.6/pngtrans.c 2011-04-08 11:58:24.075551243 -0500
@@ -1,9 +1,9 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
*
- * Last changed in libpng 1.4.2 [April 29, 2010]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.6 [April 8, 2011]
+ * Copyright (c) 1998-2011 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.
@@ -661,9 +661,9 @@
* associated with this pointer before png_write_destroy and png_read_destroy
* are called.
*/
png_voidp PNGAPI
-png_get_user_transform_ptr(png_structp png_ptr)
+png_get_user_transform_ptr(png_const_structp png_ptr)
{
if (png_ptr == NULL)
return (NULL);
#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
diff -ru4NwbB libpng-1.4.5/pngwrite.c libpng-1.4.6/pngwrite.c
--- libpng-1.4.5/pngwrite.c 2010-12-09 07:48:11.415259742 -0600
+++ libpng-1.4.6/pngwrite.c 2011-04-08 11:58:24.090345956 -0500
@@ -1,9 +1,9 @@
/* pngwrite.c - general routines to write a PNG file
*
- * Last changed in libpng 1.4.0 [January 3, 2010]
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Last changed in libpng 1.4.6 [March 8, 2011]
+ * Copyright (c) 1998-2011 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.
@@ -660,10 +660,10 @@
{
if (png_ptr == NULL)
return;
- png_debug2(1, "in png_write_row (row %ld, pass %d)",
- png_ptr->row_number, png_ptr->pass);
+ png_debug2(1, "in png_write_row (row %lu, pass %d)",
+ (unsigned long)png_ptr->row_number, png_ptr->pass);
/* Initialize transformations and other stuff if first time */
if (png_ptr->row_number == 0 && png_ptr->pass == 0)
{
@@ -777,9 +777,10 @@
png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
png_ptr->row_info.width);
png_debug1(3, "row_info->color_type = %d", png_ptr->row_info.color_type);
- png_debug1(3, "row_info->width = %lu", png_ptr->row_info.width);
+ png_debug1(3, "row_info->width = %lu",
+ (unsigned long)png_ptr->row_info.width);
png_debug1(3, "row_info->channels = %d", png_ptr->row_info.channels);
png_debug1(3, "row_info->bit_depth = %d", png_ptr->row_info.bit_depth);
png_debug1(3, "row_info->pixel_depth = %d", png_ptr->row_info.pixel_depth);
png_debug1(3, "row_info->rowbytes = %lu", png_ptr->row_info.rowbytes);
@@ -1449,9 +1450,9 @@
/* It is REQUIRED to call this to finish writing the rest of the file */
png_write_end(png_ptr, info_ptr);
- transforms = transforms; /* Quiet compiler warnings */
- params = params;
+ PNG_UNUSED(transforms) /* Quiet compiler warnings */
+ PNG_UNUSED(params)
}
#endif
#endif /* PNG_WRITE_SUPPORTED */
diff -ru4NwbB libpng-1.4.5/pngwutil.c libpng-1.4.6/pngwutil.c
--- libpng-1.4.5/pngwutil.c 2010-12-09 07:48:11.434659828 -0600
+++ libpng-1.4.6/pngwutil.c 2011-04-08 11:58:24.109706123 -0500
@@ -681,11 +681,26 @@
*/
if (length >= 2 &&
png_ptr->height < 16384 && png_ptr->width < 16384)
{
+ /* Compute the maximum possible length of the datastream */
+
+ /* Number of pixels, plus for each row a filter byte and possible
+ * and possibly a padding byte, so increase the maximum
+ * size to account for these.
+ */
png_uint_32 uncompressed_idat_size = png_ptr->height *
((png_ptr->width *
png_ptr->channels * png_ptr->bit_depth + 15) >> 3);
+
+ /* If it's interlaced, each block of 8 rows is sent as up to
+ * 14 rows, i.e., 6 additional rows, each with a filter byte
+ * and possibly a padding byte
+ */
+ if (png_ptr->interlaced)
+ uncompressed_idat_size += ((png_ptr->height + 7)/8) *
+ (png_ptr->bit_depth < 8 ? 12 : 6);
+
unsigned int z_cinfo = z_cmf >> 4;
unsigned int half_z_window_size = 1 << (z_cinfo + 7);
while (uncompressed_idat_size <= half_z_window_size &&
half_z_window_size >= 256)
diff -ru4NwbB libpng-1.4.5/projects/vstudio/zlib.props libpng-1.4.6/projects/vstudio/zlib.props
--- libpng-1.4.5/projects/vstudio/zlib.props 2010-12-09 07:48:13.610259858 -0600
+++ libpng-1.4.6/projects/vstudio/zlib.props 2011-04-08 11:58:26.748882113 -0500
@@ -3,9 +3,9 @@
* zlib.props - location of zlib source and build
*
* libpng version 1.4.6 - April 8, 2011
*
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
+ * Copyright (c) 1998-2011 Glenn Randers-Pehrson
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@@ -28,16 +28,16 @@
zlib.lib # The static library
zlib.h # The header file
zconf.h # Another header file included by zlib.h
-->
- ..\..\..\..\zlib124-dll\zlib-1.2.4
+ ..\..\..\..\zlib125-dll\zlib-1.2.5
- ..\..\..\..\zlib-1.2.4
+ ..\..\..\..\zlib-1.2.5
diff -ru4NwbB libpng-1.4.5/scripts/makefile.vcwin32 libpng-1.4.6/scripts/makefile.vcwin32
--- libpng-1.4.5/scripts/makefile.vcwin32 2010-12-09 07:48:13.527415873 -0600
+++ libpng-1.4.6/scripts/makefile.vcwin32 2011-04-08 11:58:26.664370498 -0500
@@ -14,9 +14,9 @@
# Compiler, linker, librarian, and other tools
CC = cl
LD = link
AR = lib
-CFLAGS = -nologo -MD -O2 -W3 -I..\zlib
+CFLAGS = -nologo -D_CRT_SECURE_NO_DEPRECATE -MD -O2 -W3 -I..\zlib
LDFLAGS = -nologo
ARFLAGS = -nologo
RM = del
diff -ru4NwbB libpng-1.4.5/scripts/png32ce.def libpng-1.4.6/scripts/png32ce.def
--- libpng-1.4.5/scripts/png32ce.def 2010-12-09 07:48:13.558203444 -0600
+++ libpng-1.4.6/scripts/png32ce.def 2011-04-08 11:58:26.695305479 -0500
@@ -197,11 +197,13 @@
png_info_init @174
; png_read_init_3 @175
; png_write_init_3 @176
png_info_init_3 @177
- png_destroy_struct @178
+; Moved to pngpriv.h
+; png_destroy_struct @178
; Added at version 1.2.0
; For use with PNG_USER_MEM_SUPPORTED
+; Moved to pngpriv.h
; png_destroy_struct_2 @179
; png_create_read_struct_2 @180
; png_create_write_struct_2 @181
; png_malloc_default @182
@@ -244,15 +246,16 @@
png_set_expand_gray_1_2_4_to_8 @207
; Added at version 1.2.41
png_write_sig @208
png_benign_error @209
- png_benign_chunk_error @210
+ png_chunk_benign_error @210
png_set_benign_error @211
png_get_io_chunk_name @212
png_get_io_state @213
png_get_chunk_cache_max @215
png_set_chunk_cache_max @216
- png_check_cHRM_fixed @217
+; Moved to pngpriv.h
+; png_check_cHRM_fixed @217
png_calloc @218
png_set_longjmp_fn @219
; Added at version 1.4.1
png_get_chunk_malloc_max @220
diff -ru4NwbB libpng-1.4.5/scripts/pngos2.def libpng-1.4.6/scripts/pngos2.def
--- libpng-1.4.5/scripts/pngos2.def 2010-12-09 07:48:13.569060728 -0600
+++ libpng-1.4.6/scripts/pngos2.def 2011-04-08 11:58:26.706185340 -0500
@@ -204,15 +204,16 @@
; Added at version 1.2.41
png_write_sig
; png_benign_error
-; png_benign_chunk_error
+; png_chunk_benign_error
; png_set_benign_error
png_get_io_chunk_name
png_get_io_state
png_get_chunk_cache_max
png_set_chunk_cache_max
- png_check_cHRM_fixed
+; Moved to pngpriv.h
+; png_check_cHRM_fixed @217
png_calloc
png_set_longjmp_fn
; Added at version 1.4.1
png_get_chunk_malloc_max
diff -ru4NwbB libpng-1.4.5/scripts/pngwin.def libpng-1.4.6/scripts/pngwin.def
--- libpng-1.4.5/scripts/pngwin.def 2010-12-09 07:48:13.579917586 -0600
+++ libpng-1.4.6/scripts/pngwin.def 2011-04-08 11:58:26.717037219 -0500
@@ -168,12 +168,14 @@
png_convert_to_rfc1123
png_set_invalid
; Added at version 1.0.12
png_info_init_3
- png_destroy_struct
+; Moved to pngpriv.h
+; png_destroy_struct
; Added at version 1.2.0
; For use with PNG_USER_MEM_SUPPORTED
- png_destroy_struct_2
+; Moved to pngpriv.h
+; png_destroy_struct_2
png_create_read_struct_2
png_create_write_struct_2
png_malloc_default
png_free_default
@@ -199,15 +201,16 @@
png_set_expand_gray_1_2_4_to_8
; Added at version 1.2.41
png_write_sig
; png_benign_error
-; png_benign_chunk_error
+; png_chunk_benign_error
; png_set_benign_error
png_get_io_chunk_name
png_get_io_state
png_get_chunk_cache_max
png_set_chunk_cache_max
- png_check_cHRM_fixed
+; Moved to pngpriv.h
+; png_check_cHRM_fixed @217
png_calloc
png_set_longjmp_fn
; Added at version 1.4.1
png_get_chunk_malloc_max