diff --git a/ANNOUNCE b/ANNOUNCE index 47181be42..c14a3d196 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,4 @@ - -Libpng 1.6.12 - June 12, 2014 +Libpng 1.6.13 - August 21, 2014 This is a public release of libpng, intended for use in production codes. @@ -8,28 +7,48 @@ Files available for download: Source files with LF line endings (for Unix/Linux) and with a "configure" script - libpng-1.6.12.tar.xz (LZMA-compressed, recommended) - libpng-1.6.12.tar.gz + libpng-1.6.13.tar.xz (LZMA-compressed, recommended) + libpng-1.6.13.tar.gz Source files with CRLF line endings (for Windows), without the "configure" script - lpng1612.7z (LZMA-compressed, recommended) - lpng1612.zip + lpng1613.7z (LZMA-compressed, recommended) + lpng1613.zip Other information: - libpng-1.6.12-README.txt - libpng-1.6.12-LICENSE.txt - libpng-1.6.12-*.asc (armored detached GPG signatures) + libpng-1.6.13-README.txt + libpng-1.6.13-LICENSE.txt + libpng-1.6.13-*.asc (armored detached GPG signatures) -Changes since the last public release (1.6.11): - Relocated new code from 1.6.11 in png.c to a point after the - declarations (Max Stepin). - Changed file permissions of contrib/tools/intgamma.sh, - test-driver, and compile from 0644 to 0755 (Cosmin). - Ensure "__has_attribute()" macro exists before trying to use it with - old clang compilers (MacPorts Ticket #43939). +Changes since the last public release (1.6.12): + + Quieted -Wsign-compare and -Wclobber compiler warnings in + contrib/pngminus/*.c + Added "(void) png_ptr;" where needed in contrib/gregbook to quiet + compiler complaints about unused pointers. + Split a long output string in contrib/gregbook/rpng2-x.c. + Added "PNG_SET_OPTION" requirement for sRGB chunk support to pnglibconf.dfa, + Needed for write-only support (John Bowler). + Changed "if defined(__ARM_NEON__)" to + "if (defined(__ARM_NEON__) || defined(__ARM_NEON))" (James Wu). + Fixed clang no-warning builds: png_digit was defined but never used. + Fixed an incorrect separator ("/" should be "\") in scripts/makefile.vcwin32 + (bug report from Wolfgang S. Kechel). Bug was introduced in libpng-1.6.11. + Also fixed makefile.bc32, makefile.bor, makefile.msc, makefile.intel, and + makefile.tc3 similarly. + Removed scripts/makefile.elf. It has not worked since libpng-1.5.0beta14 + due to elimination of the PNG_FUNCTION_EXPORT and PNG_DATA_EXPORT + definitions from pngconf.h. + Ensure that CMakeLists.txt makes the target "lib" directory before making + symbolic link into it (SourceForge bug report #226 by Rolf Timmermans). + Added opinion that the ECCN (Export Control Classification Number) for + libpng is EAR99 to the README file. + Eliminated use of "$<" in makefile explicit rules, when copying + $PNGLIBCONF_H_PREBUILT. This does not work on some versions of make; + bug introduced in libpng version 1.6.11. + Made "ccopts" agree with "CFLAGS" in scripts/makefile.hp* and makefile.*sunu Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit @@ -38,4 +57,3 @@ to subscribe) or to glennrp at users.sourceforge.net Glenn R-P -#endif diff --git a/CHANGES b/CHANGES index c1951a783..880eca978 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -#if 0 + CHANGES - changes for libpng Version 0.2 @@ -4940,6 +4940,44 @@ Version 1.6.12rc03 [June 8, 2014] Version 1.6.12 [June 12, 2014] No changes. +Version 1.6.13beta01 [July 4, 2014] + Quieted -Wsign-compare and -Wclobber compiler warnings in + contrib/pngminus/*.c + Added "(void) png_ptr;" where needed in contrib/gregbook to quiet + compiler complaints about unused pointers. + Split a long output string in contrib/gregbook/rpng2-x.c. + Added "PNG_SET_OPTION" requirement for sRGB chunk support to pnglibconf.dfa, + Needed for write-only support (John Bowler). + Changed "if defined(__ARM_NEON__)" to + "if (defined(__ARM_NEON__) || defined(__ARM_NEON))" (James Wu). + Fixed clang no-warning builds: png_digit was defined but never used. + +Version 1.6.13beta02 [July 21, 2014] + Fixed an incorrect separator ("/" should be "\") in scripts/makefile.vcwin32 + (bug report from Wolfgang S. Kechel). Bug was introduced in libpng-1.6.11. + Also fixed makefile.bc32, makefile.bor, makefile.msc, makefile.intel, and + makefile.tc3 similarly. + +Version 1.6.13beta03 [August 3, 2014] + Removed scripts/makefile.elf. It has not worked since libpng-1.5.0beta14 + due to elimination of the PNG_FUNCTION_EXPORT and PNG_DATA_EXPORT + definitions from pngconf.h. + Ensure that CMakeLists.txt makes the target "lib" directory before making + symbolic link into it (SourceForge bug report #226 by Rolf Timmermans). + +Version 1.6.13beta04 [August 8, 2014] + Added opinion that the ECCN (Export Control Classification Number) for + libpng is EAR99 to the README file. + Eliminated use of "$<" in makefile explicit rules, when copying + $PNGLIBCONF_H_PREBUILT. This does not work on some versions of make; + bug introduced in libpng version 1.6.11. + +Version 1.6.13rc01 [August 14, 2014] + Made "ccopts" agree with "CFLAGS" in scripts/makefile.hp* and makefile.*sunu + +Version 1.6.13 [August 21, 2014] + No changes. + Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement @@ -4947,4 +4985,3 @@ to subscribe) or to glennrp at users.sourceforge.net Glenn R-P -#endif diff --git a/CMakeLists.txt b/CMakeLists.txt index f74147b2d..e0353a057 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # CMakeLists.txt -# Copyright (C) 2007-2013 Glenn Randers-Pehrson +# Copyright (C) 2007-2014 Glenn Randers-Pehrson # This code is released under the libpng license. # For conditions of distribution and use, see the disclaimer @@ -16,7 +16,7 @@ enable_testing() set(PNGLIB_MAJOR 1) set(PNGLIB_MINOR 6) -set(PNGLIB_RELEASE 12) +set(PNGLIB_RELEASE 13) set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR}) set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) @@ -220,6 +220,7 @@ macro(CREATE_SYMLINK SRC_FILE DEST_FILE) ADD_CUSTOM_TARGET(${DEST_FILE}_COPY ALL DEPENDS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE}) else(WIN32 AND NOT CYGWIN AND NOT MSYS) get_filename_component(LINK_TARGET "${SRC_FILE}" NAME) + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${LINK_TARGET}" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${LINK_TARGET}" ${DEST_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) endif(WIN32 AND NOT CYGWIN AND NOT MSYS) @@ -252,7 +253,7 @@ endif(NOT WIN32 OR CYGWIN OR MINGW) # SET UP LINKS if(PNG_SHARED) set_target_properties(${PNG_LIB_NAME} PROPERTIES -# VERSION 16.${PNGLIB_RELEASE}.1.6.12 +# VERSION 16.${PNGLIB_RELEASE}.1.6.13 VERSION 16.${PNGLIB_RELEASE}.0 SOVERSION 16 CLEAN_DIRECT_OUTPUT 1) @@ -350,7 +351,7 @@ if(PNG_EXPORT_RULE AND NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL ) install(EXPORT libpng DESTINATION lib/libpng FILE lib${PNG_LIB_NAME}.cmake) endif() -# what's with libpng-$VER%.txt and all the extra files? +# what's with libpng-manual.txt and all the extra files? # UNINSTALL # do we need this? diff --git a/INSTALL b/INSTALL index 49e932919..f4df80a8b 100644 --- a/INSTALL +++ b/INSTALL @@ -28,7 +28,9 @@ On Unix/Linux and similar systems, you can simply type make check make install -and ignore the rest of this document. +and ignore the rest of this document. "/path" is the path to the directory +where you want to install the libpng "lib", "include", and "bin" +subdirectories. II. Rebuilding the configure scripts @@ -64,8 +66,8 @@ Or you can use one of the "projects" in the "projects" directory. Before installing libpng, you must first install zlib, if it is not already on your system. zlib can usually be found -wherever you got libpng. zlib can be placed in another directory, -at the same level as libpng. +wherever you got libpng; otherwise go to http://zlib.net. You can place +zlib in in the same directory as libpng or in another directory. If your system already has a preinstalled zlib you will still need to have access to the zlib.h and zconf.h include files that @@ -93,6 +95,10 @@ If you want to use "cmake" (see www.cmake.org), type make make install +As when using the simple configure method described above, "/path" points to +the installation directory where you want to put the libpng "lib", "include", +and "bin" subdirectories. + V. Directory structure You can rename the directories that you downloaded (they @@ -322,9 +328,10 @@ unmodified, default, libpng API and thus would probably fail to link. These mechanisms still work in the configure build and in any makefile build that builds pnglibconf.h, although the feature selection macros have changed somewhat as described above. In 1.5.0, however, pngusr.h is -processed only once, when the exported header file pnglibconf.h is built. -pngconf.h no longer includes pngusr.h, therefore pngusr.h is ignored after the -build of pnglibconf.h and it is never included in an application build. +processed only once, at the time the exported header file pnglibconf.h is +built. pngconf.h no longer includes pngusr.h; therefore, pngusr.h is ignored +after the build of pnglibconf.h and it is never included in an application +build. The rarely used alternative of adding a list of feature macros to the CPPFLAGS setting in the build also still works; however, the macros will be @@ -347,7 +354,7 @@ also removed. As a recommended alternative to using feature macros in pngusr.h a system builder may also define equivalent options in pngusr.dfa (or, indeed, any file) and add that to the configuration by setting DFA_XTRA to the file name. The makefiles in contrib/pngminim illustrate -how to do this, and a case where pngusr.h is still required. +how to do this, and illustrate a case where pngusr.h is still required. XV. Configuring libpng for multiprocessing diff --git a/LICENSE b/LICENSE index b77abddf1..a38339e31 100644 --- a/LICENSE +++ b/LICENSE @@ -10,7 +10,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.6.12, June 12, 2014, are +libpng versions 1.2.6, August 15, 2004, through 1.6.13, August 21, 2014, are Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.2.5 with the following individual added to the list of Contributing Authors @@ -108,4 +108,4 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -June 12, 2014 +August 21, 2014 diff --git a/README b/README index dc6c00b18..69bda874f 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -README for libpng version 1.6.12 - June 12, 2014 (shared library 16.0) +README for libpng version 1.6.13 - August 21, 2014 (shared library 16.0) See the note about version numbers near the top of png.h See INSTALL for instructions on how to install libpng. @@ -87,6 +87,12 @@ This code is currently being archived at libpng.sf.net in the [DOWNLOAD] area, and at ftp://ftp.simplesystems.org. If you can't find it in any of those places, e-mail me, and I'll help you find it. +I am not a lawyer, but I believe that the Export Control Classification +Number (ECCN) for libpng is EAR99, which means not subject to export +controls or International Traffic in Arms Regulations (ITAR) because it +is open source, publicly available software, that does not contain any +encryption software. See the EAR, paragraphs 734.3(b)(3) and 734.7(b). + If you have any code changes, requests, problems, etc., please e-mail them to me. Also, I'd appreciate any make files or project files, and any modifications you needed to make to get libpng to compile, diff --git a/arm/arm_init.c b/arm/arm_init.c index cff47ff60..b0e929bc1 100644 --- a/arm/arm_init.c +++ b/arm/arm_init.c @@ -3,7 +3,7 @@ * * Copyright (c) 2014 Glenn Randers-Pehrson * Written by Mans Rullgard, 2011. - * Last changed in libpng 1.6.10 [June 12, 2014] + * Last changed in libpng 1.6.10 [March 6, 2014] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer diff --git a/configure.ac b/configure.ac index 0ea4dd29d..6fafa0210 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,7 @@ AC_PREREQ([2.68]) dnl Version number stuff here: -AC_INIT([libpng],[1.6.12],[png-mng-implement@lists.sourceforge.net]) +AC_INIT([libpng],[1.6.13],[png-mng-implement@lists.sourceforge.net]) AC_CONFIG_MACRO_DIR([scripts]) # libpng does not follow GNU file name conventions (hence 'foreign') @@ -39,10 +39,10 @@ dnl automake, so the following is not necessary (and is not defined anyway): dnl AM_PREREQ([1.11.2]) dnl stop configure from automagically running automake -PNGLIB_VERSION=1.6.12 +PNGLIB_VERSION=1.6.13 PNGLIB_MAJOR=1 PNGLIB_MINOR=6 -PNGLIB_RELEASE=12 +PNGLIB_RELEASE=13 dnl End of version number stuff diff --git a/contrib/gregbook/Makefile.unx b/contrib/gregbook/Makefile.unx index c8cadf87b..1a73e03bf 100644 --- a/contrib/gregbook/Makefile.unx +++ b/contrib/gregbook/Makefile.unx @@ -59,15 +59,16 @@ INCS = $(PNGINC) $(ZINC) $(XINC) RLIBSd = $(PNGLIBd) $(ZLIBd) $(XLIB) -lm RLIBSs = $(PNGLIBs) $(ZLIBs) $(XLIB) -lm WLIBSd = $(PNGLIBd) $(ZLIBd) -lm -WLIBSs = $(PNGLIBs) $(ZLIBs) +WLIBSs = $(PNGLIBs) $(ZLIBs) -lm CC = gcc LD = gcc RM = rm -f CPPFLAGS = $(INCS) -DFEATURE_LOOP CFLAGS = -O -Wall +#CFLAGS = -O -W -Wall -Wextra -pedantic -ansi # [note that -Wall is a gcc-specific compilation flag ("most warnings on")] -# [-ansi, -pedantic and -W can also be used] +# [-ansi, -pedantic, -Wextra, and -W can also be used] LDFLAGS = O = .o E = diff --git a/contrib/gregbook/readpng2.c b/contrib/gregbook/readpng2.c index e6a132eca..2e4c53627 100644 --- a/contrib/gregbook/readpng2.c +++ b/contrib/gregbook/readpng2.c @@ -448,6 +448,8 @@ static void readpng2_end_callback(png_structp png_ptr, png_infop info_ptr) /* all done */ + (void)info_ptr; /* Unused */ + return; } @@ -472,6 +474,7 @@ static void readpng2_warning_handler(png_structp png_ptr, png_const_charp msg) { fprintf(stderr, "readpng2 libpng warning: %s\n", msg); fflush(stderr); + (void)png_ptr; /* Unused */ } diff --git a/contrib/gregbook/readppm.c b/contrib/gregbook/readppm.c index be9a56d95..7fefc3943 100644 --- a/contrib/gregbook/readppm.c +++ b/contrib/gregbook/readppm.c @@ -163,8 +163,12 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes) /* now we can go ahead and just read the whole image */ - fread(image_data, 1L, rowbytes*height, saved_infile); - + if (fread(image_data, 1L, rowbytes*height, saved_infile) < + rowbytes*height) { + free (image_data); + image_data = NULL; + return NULL; + } return image_data; } diff --git a/contrib/gregbook/rpng-x.c b/contrib/gregbook/rpng-x.c index 6d10e1b84..ddd7c58d6 100644 --- a/contrib/gregbook/rpng-x.c +++ b/contrib/gregbook/rpng-x.c @@ -26,6 +26,8 @@ - 1.14: added support for X resources (thanks to Gerhard Niklasch) - 2.00: dual-licensed (added GNU GPL) - 2.01: fixed improper display of usage screen on PNG error(s) + - 2.02: Added "void(argc);" statement to quiet pedantic compiler warnings + about unused variable (GR-P) --------------------------------------------------------------------------- @@ -80,7 +82,7 @@ #define PROGNAME "rpng-x" #define LONGNAME "Simple PNG Viewer for X" -#define VERSION "2.01 of 16 March 2008" +#define VERSION "2.02 of 15 June 2014" #define RESNAME "rpng" /* our X resource application name */ #define RESCLASS "Rpng" /* our X resource class name */ @@ -279,15 +281,17 @@ int main(int argc, char **argv) "Usage: %s [-display xdpy] [-gamma exp] [-bgcolor bg] file.png\n" " xdpy\tname of the target X display (e.g., ``hostname:0'')\n" " exp \ttransfer-function exponent (``gamma'') of the display\n" - "\t\t system in floating-point format (e.g., ``%.1f''); equal\n" + "\t\t system in floating-point format (e.g., ``%.1f''); equal\n", + PROGNAME, default_display_exponent); + + fprintf(stderr, "\n" "\t\t to the product of the lookup-table exponent (varies)\n" "\t\t and the CRT exponent (usually 2.2); must be positive\n" " bg \tdesired background color in 7-character hex RGB format\n" "\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n" "\t\t used with transparent images\n" "\nPress Q, Esc or mouse button 1 (within image window, after image\n" - "is displayed) to quit.\n" - "\n", PROGNAME, default_display_exponent); + "is displayed) to quit.\n"); exit(1); } @@ -419,6 +423,8 @@ int main(int argc, char **argv) rpng_x_cleanup(); + (void)argc; /* Unused */ + return 0; } diff --git a/contrib/gregbook/rpng2-win.c b/contrib/gregbook/rpng2-win.c index 223e73740..eda176eee 100644 --- a/contrib/gregbook/rpng2-win.c +++ b/contrib/gregbook/rpng2-win.c @@ -33,6 +33,8 @@ - 2.02: fixed improper display of usage screen on PNG error(s); fixed unexpected-EOF and file-read-error cases - 2.03: removed runtime MMX-enabling/disabling and obsolete -mmx* options + - 2.04: + (GR-P) --------------------------------------------------------------------------- diff --git a/contrib/gregbook/rpng2-x.c b/contrib/gregbook/rpng2-x.c index 7f24b632b..a146ef417 100644 --- a/contrib/gregbook/rpng2-x.c +++ b/contrib/gregbook/rpng2-x.c @@ -41,7 +41,11 @@ unexpected-EOF and file-read-error cases; fixed Trace() cut-and- paste bugs - 2.03: deleted runtime MMX-enabling/disabling and obsolete -mmx* options + - 2.04: Added "void(foo);" statements to quiet pedantic compiler warnings + about unused variables (GR-P) + TO DO: + use nanosleep() instead of usleep(), which is obsolete/deprecated. --------------------------------------------------------------------------- Copyright (c) 1998-2008 Greg Roelofs. All rights reserved. @@ -95,10 +99,13 @@ #define PROGNAME "rpng2-x" #define LONGNAME "Progressive PNG Viewer for X" -#define VERSION "2.03 of 25 February 2010" +#define VERSION "2.04 of 15 June 2014" #define RESNAME "rpng2" /* our X resource application name */ #define RESCLASS "Rpng" /* our X resource class name */ +/* This is temporary until the code is rewritten to use nanosleep(). */ +#define usleep(x) sleep(((x)+499999)/1000000) + #include #include #include @@ -456,40 +463,47 @@ int main(int argc, char **argv) fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname); readpng2_version_info(); fprintf(stderr, "\n" - "Usage: %s [-display xdpy] [-gamma exp] [-bgcolor bg | -bgpat pat]\n" + "Usage: "); + fprintf(stderr, + "%s [-display xdpy] [-gamma exp] [-bgcolor bg | -bgpat pat]\n" + " %*s [-usleep dur | -timing] [-pause]\n", + PROGNAME, (int)strlen(PROGNAME), " "); + fprintf(stderr, #ifdef FEATURE_LOOP - " %*s [-usleep dur | -timing] [-pause] [-loop [sec]] file.png\n\n" -#else - " %*s [-usleep dur | -timing] [-pause] file.png\n\n" + " [-loop [sec]]" #endif + " file.png\n\n"); + fprintf(stderr, " xdpy\tname of the target X display (e.g., ``hostname:0'')\n" " exp \ttransfer-function exponent (``gamma'') of the display\n" "\t\t system in floating-point format (e.g., ``%.1f''); equal\n" - "\t\t to the product of the lookup-table exponent (varies)\n" + "\t\t to the product of the lookup-table exponent (varies)\n", + default_display_exponent); + fprintf(stderr, "\t\t and the CRT exponent (usually 2.2); must be positive\n" " bg \tdesired background color in 7-character hex RGB format\n" "\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n" "\t\t used with transparent images; overrides -bgpat\n" " pat \tdesired background pattern number (0-%d); used with\n" - "\t\t transparent images; overrides -bgcolor\n" + "\t\t transparent images; overrides -bgcolor\n", + num_bgpat-1); #ifdef FEATURE_LOOP + fprintf(stderr, " -loop\tloops through background images after initial display\n" "\t\t is complete (depends on -bgpat)\n" - " sec \tseconds to display each background image (default = 2)\n" + " sec \tseconds to display each background image (default = 2)\n"); #endif + fprintf(stderr, " dur \tduration in microseconds to wait after displaying each\n" "\t\t row (for demo purposes)\n" " -timing\tenables delay for every block read, to simulate modem\n" "\t\t download of image (~36 Kbps)\n" " -pause\tpauses after displaying each pass until mouse clicked\n" "\nPress Q, Esc or mouse button 1 (within image window, after image\n" - "is displayed) to quit.\n" - "\n", PROGNAME, - (int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat-1); + "is displayed) to quit.\n"); exit(1); } - if (!(infile = fopen(filename, "rb"))) { fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename); ++error; @@ -735,6 +749,8 @@ int main(int argc, char **argv) Trace((stderr, "about to call rpng2_x_cleanup()\n")) rpng2_x_cleanup(); + (void)argc; /* Unused */ + return 0; } @@ -1826,6 +1842,9 @@ static void rpng2_x_redisplay_image(ulg startcol, ulg startrow, XFlush(display); } + (void)startcol; + (void)width; + } /* end function rpng2_x_redisplay_image() */ diff --git a/contrib/pngminus/png2pnm.c b/contrib/pngminus/png2pnm.c index aa9513ddc..83d9565a3 100644 --- a/contrib/pngminus/png2pnm.c +++ b/contrib/pngminus/png2pnm.c @@ -52,7 +52,8 @@ int main (int argc, char *argv[]); void usage (); -BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL alpha); +BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, + BOOL alpha); /* * main @@ -85,7 +86,8 @@ int main(int argc, char *argv[]) if ((fp_al = fopen (argv[argi], "wb")) == NULL) { fprintf (stderr, "PNM2PNG\n"); - fprintf (stderr, "Error: can not create alpha-channel file %s\n", argv[argi]); + fprintf (stderr, "Error: can not create alpha-channel file %s\n", + argv[argi]); exit (1); } break; @@ -176,9 +178,11 @@ void usage() fprintf (stderr, "Usage: png2pnm [options] .png [.pnm]\n"); fprintf (stderr, " or: ... | png2pnm [options]\n"); fprintf (stderr, "Options:\n"); - fprintf (stderr, " -r[aw] write pnm-file in binary format (P4/P5/P6) (default)\n"); + fprintf (stderr, + " -r[aw] write pnm-file in binary format (P4/P5/P6) (default)\n"); fprintf (stderr, " -n[oraw] write pnm-file in ascii format (P1/P2/P3)\n"); - fprintf (stderr, " -a[lpha] .pgm write PNG alpha channel as pgm-file\n"); + fprintf (stderr, + " -a[lpha] .pgm write PNG alpha channel as pgm-file\n"); fprintf (stderr, " -h | -? print this help-information\n"); } @@ -186,7 +190,8 @@ void usage() * png2pnm */ -BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL alpha) +BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, + volatile BOOL raw, BOOL alpha) { png_struct *png_ptr = NULL; png_info *info_ptr = NULL; @@ -315,12 +320,14 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a /* row_bytes is the width x number of channels x (bit-depth / 8) */ row_bytes = png_get_rowbytes (png_ptr, info_ptr); - if ((png_pixels = (png_byte *) malloc (row_bytes * height * sizeof (png_byte))) == NULL) { + if ((png_pixels = (png_byte *) + malloc (row_bytes * height * sizeof (png_byte))) == NULL) { png_destroy_read_struct (&png_ptr, &info_ptr, NULL); return FALSE; } - if ((row_pointers = (png_byte **) malloc (height * sizeof (png_bytep))) == NULL) + if ((row_pointers = (png_byte **) + malloc (height * sizeof (png_bytep))) == NULL) { png_destroy_read_struct (&png_ptr, &info_ptr, NULL); free (png_pixels); @@ -329,7 +336,7 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a } /* set the individual row_pointers to point at the correct offsets */ - for (i = 0; i < (height); i++) + for (i = 0; i < ((int) height); i++) row_pointers[i] = png_pixels + i * row_bytes; /* now we can go ahead and just read the whole image */ @@ -372,9 +379,9 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a /* write data to PNM file */ pix_ptr = png_pixels; - for (row = 0; row < height; row++) + for (row = 0; row < (int) height; row++) { - for (col = 0; col < width; col++) + for (col = 0; col < (int) width; col++) { for (i = 0; i < (channels - alpha_present); i++) { diff --git a/contrib/pngminus/pnm2png.c b/contrib/pngminus/pnm2png.c index f9903dd32..b073414ff 100644 --- a/contrib/pngminus/pnm2png.c +++ b/contrib/pngminus/pnm2png.c @@ -50,7 +50,8 @@ int main (int argc, char *argv[]); void usage (); -BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, BOOL alpha); +BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, + BOOL alpha); void get_token(FILE *pnm_file, char *token); png_uint_32 get_data (FILE *pnm_file, int depth); png_uint_32 get_value (FILE *pnm_file, int depth); @@ -176,7 +177,8 @@ void usage() fprintf (stderr, " or: ... | pnm2png [options]\n"); fprintf (stderr, "Options:\n"); fprintf (stderr, " -i[nterlace] write png-file with interlacing on\n"); - fprintf (stderr, " -a[lpha] .pgm read PNG alpha channel as pgm-file\n"); + fprintf (stderr, + " -a[lpha] .pgm read PNG alpha channel as pgm-file\n"); fprintf (stderr, " -h | -? print this help-information\n"); } @@ -184,27 +186,28 @@ void usage() * pnm2png */ -BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, BOOL alpha) +BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, + BOOL alpha) { png_struct *png_ptr = NULL; png_info *info_ptr = NULL; png_byte *png_pixels = NULL; png_byte **row_pointers = NULL; png_byte *pix_ptr = NULL; - png_uint_32 row_bytes; + volatile png_uint_32 row_bytes; char type_token[16]; char width_token[16]; char height_token[16]; char maxval_token[16]; - int color_type; + volatile int color_type; unsigned long ul_width=0, ul_alpha_width=0; unsigned long ul_height=0, ul_alpha_height=0; unsigned long ul_maxval=0; - png_uint_32 width, alpha_width; - png_uint_32 height, alpha_height; + volatile png_uint_32 width, height; + volatile png_uint_32 alpha_width, alpha_height; png_uint_32 maxval; - int bit_depth = 0; + volatile int bit_depth = 0; int channels; int alpha_depth = 0; int alpha_present; @@ -367,23 +370,24 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, /* row_bytes is the width x number of channels x (bit-depth / 8) */ row_bytes = width * channels * ((bit_depth <= 8) ? 1 : 2); - if ((png_pixels = (png_byte *) malloc (row_bytes * height * sizeof (png_byte))) == NULL) + if ((png_pixels = (png_byte *) + malloc (row_bytes * height * sizeof (png_byte))) == NULL) return FALSE; /* read data from PNM file */ pix_ptr = png_pixels; - for (row = 0; row < height; row++) + for (row = 0; row < (int) height; row++) { #if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) if (packed_bitmap) { - for (i = 0; i < row_bytes; i++) + for (i = 0; i < (int) row_bytes; i++) /* png supports this format natively so no conversion is needed */ *pix_ptr++ = get_data (pnm_file, 8); } else #endif { - for (col = 0; col < width; col++) + for (col = 0; col < (int) width; col++) { for (i = 0; i < (channels - alpha_present); i++) { @@ -462,7 +466,8 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, /* if needed we will allocate memory for an new array of row-pointers */ if (row_pointers == (unsigned char**) NULL) { - if ((row_pointers = (png_byte **) malloc (height * sizeof (png_bytep))) == NULL) + if ((row_pointers = (png_byte **) + malloc (height * sizeof (png_bytep))) == NULL) { png_destroy_write_struct (&png_ptr, (png_infopp) NULL); return FALSE; @@ -470,13 +475,13 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, } /* set the individual row_pointers to point at the correct offsets */ - for (i = 0; i < (height); i++) + for (i = 0; i < (int) height; i++) row_pointers[i] = png_pixels + i * row_bytes; /* write out the entire image data in one call */ png_write_image (png_ptr, row_pointers); - /* write the additional chuncks to the PNG file (not really needed) */ + /* write the additional chunks to the PNG file (not really needed) */ png_write_end (png_ptr, info_ptr); /* clean up after the write, and free any memory allocated */ diff --git a/example.c b/example.c index e9747a87b..ad5fc70ca 100644 --- a/example.c +++ b/example.c @@ -2,7 +2,7 @@ #if 0 /* in case someone actually tries to compile this */ /* example.c - an example of using libpng - * Last changed in libpng 1.6.11 [June 12, 2014] + * Last changed in libpng 1.6.11 [June 5, 2014] * Maintained 1998-2014 Glenn Randers-Pehrson * Maintained 1996, 1997 Andreas Dilger) * Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) diff --git a/libpng-manual.txt b/libpng-manual.txt index f79ca7e3c..a394cc9c6 100644 --- a/libpng-manual.txt +++ b/libpng-manual.txt @@ -1,6 +1,6 @@ libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.6.12 - June 12, 2014 + libpng version 1.6.13 - August 21, 2014 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2014 Glenn Randers-Pehrson @@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.6.12 - June 12, 2014 + libpng versions 0.97, January 1998, through 1.6.13 - August 21, 2014 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2014 Glenn Randers-Pehrson @@ -5042,7 +5042,8 @@ very old broken Microsoft/HP 3144-byte sRGB profile. Starting with libpng-1.6.11, recognizing and checking sRGB profiles can be avoided by means of - #ifdef PNG_SKIP_sRGB_CHECK_PROFILE + #if defined(PNG_SKIP_sRGB_CHECK_PROFILE) && \ + defined(PNG_SET_OPTION_SUPPORTED) png_set_option(png_ptr, PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON); #endif @@ -5055,8 +5056,8 @@ The PNG spec requirement that only grayscale profiles may appear in images with color type 0 or 4 and that even if the image only contains gray pixels, only RGB profiles may appear in images with color type 2, 3, or 6, is now enforced. The sRGB chunk is allowed to appear in images with any color type -and is interpreted by libpng to convey a one-tracer-curve profile or a -three-tracer-curve profile as appropriate. +and is interpreted by libpng to convey a one-tracer-curve gray profile or a +three-tracer-curve RGB profile as appropriate. Prior to libpng-1.6.0 a warning would be issued if the iTXt chunk contained an empty language field or an empty translated keyword. Both of these @@ -5275,13 +5276,13 @@ Other rules can be inferred by inspecting the libpng source. XVI. Y2K Compliance in libpng -June 12, 2014 +August 21, 2014 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. This is your unofficial assurance that libpng from version 0.71 and -upward through 1.6.12 are Y2K compliant. It is my belief that earlier +upward through 1.6.13 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. Libpng only has two year fields. One is a 2-byte unsigned integer diff --git a/libpng.3 b/libpng.3 index 6ac1b6a0d..0ace8614f 100644 --- a/libpng.3 +++ b/libpng.3 @@ -1,6 +1,6 @@ -.TH LIBPNG 3 "June 12, 2014" +.TH LIBPNG 3 "August 21, 2014" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.6.12 +libpng \- Portable Network Graphics (PNG) Reference Library 1.6.13 .SH SYNOPSIS \fB #include \fP @@ -504,7 +504,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng. .SH LIBPNG.TXT libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.6.12 - June 12, 2014 + libpng version 1.6.13 - August 21, 2014 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2014 Glenn Randers-Pehrson @@ -515,7 +515,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.6.12 - June 12, 2014 + libpng versions 0.97, January 1998, through 1.6.13 - August 21, 2014 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2014 Glenn Randers-Pehrson @@ -5546,7 +5546,8 @@ very old broken Microsoft/HP 3144-byte sRGB profile. Starting with libpng-1.6.11, recognizing and checking sRGB profiles can be avoided by means of - #ifdef PNG_SKIP_sRGB_CHECK_PROFILE + #if defined(PNG_SKIP_sRGB_CHECK_PROFILE) && \ + defined(PNG_SET_OPTION_SUPPORTED) png_set_option(png_ptr, PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON); #endif @@ -5559,8 +5560,8 @@ The PNG spec requirement that only grayscale profiles may appear in images with color type 0 or 4 and that even if the image only contains gray pixels, only RGB profiles may appear in images with color type 2, 3, or 6, is now enforced. The sRGB chunk is allowed to appear in images with any color type -and is interpreted by libpng to convey a one-tracer-curve profile or a -three-tracer-curve profile as appropriate. +and is interpreted by libpng to convey a one-tracer-curve gray profile or a +three-tracer-curve RGB profile as appropriate. Prior to libpng-1.6.0 a warning would be issued if the iTXt chunk contained an empty language field or an empty translated keyword. Both of these @@ -5779,13 +5780,13 @@ Other rules can be inferred by inspecting the libpng source. .SH XVI. Y2K Compliance in libpng -June 12, 2014 +August 21, 2014 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. This is your unofficial assurance that libpng from version 0.71 and -upward through 1.6.12 are Y2K compliant. It is my belief that earlier +upward through 1.6.13 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. Libpng only has two year fields. One is a 2-byte unsigned integer @@ -6024,6 +6025,9 @@ the first widely used release: 1.6.11 16 10611 16.so.16.11[.0] 1.6.12rc01 16 10612 16.so.16.12[.0] 1.6.12 16 10612 16.so.16.12[.0] + 1.6.13beta01-04 16 10613 16.so.16.13[.0] + 1.6.13rc01-02 16 10613 16.so.16.13[.0] + 1.6.13 16 10613 16.so.16.13[.0] Henceforth the source version will match the shared-library minor and patch numbers; the shared-library major version number will be @@ -6080,7 +6084,7 @@ possible without all of you. Thanks to Frank J. T. Wojcik for helping with the documentation. -Libpng version 1.6.12 - June 12, 2014: +Libpng version 1.6.13 - August 21, 2014: Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). @@ -6103,7 +6107,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.6.12, June 12, 2014, are +libpng versions 1.2.6, August 15, 2004, through 1.6.13, August 21, 2014, are Copyright (c) 2004,2006-2014 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.2.5 with the following individual added to the list of Contributing Authors @@ -6202,7 +6206,7 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -June 12, 2014 +August 21, 2014 .\" end of man page diff --git a/libpngpf.3 b/libpngpf.3 index 6ac628562..e94073562 100644 --- a/libpngpf.3 +++ b/libpngpf.3 @@ -1,6 +1,6 @@ -.TH LIBPNGPF 3 "June 12, 2014" +.TH LIBPNGPF 3 "August 21, 2014" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.6.12 +libpng \- Portable Network Graphics (PNG) Reference Library 1.6.13 (private functions) .SH SYNOPSIS \fB#include \fI"pngpriv.h" diff --git a/png.5 b/png.5 index 8f329fd20..461e2f8ac 100644 --- a/png.5 +++ b/png.5 @@ -1,4 +1,4 @@ -.TH PNG 5 "June 12, 2014" +.TH PNG 5 "August 21, 2014" .SH NAME png \- Portable Network Graphics (PNG) format .SH DESCRIPTION diff --git a/png.c b/png.c index f813e0a22..8d8841fd9 100644 --- a/png.c +++ b/png.c @@ -14,7 +14,7 @@ #include "pngpriv.h" /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_12 Your_png_h_is_not_version_1_6_12; +typedef png_libpng_version_1_6_13 Your_png_h_is_not_version_1_6_13; /* Tells libpng that we have already handled the first "num_bytes" bytes * of the PNG file signature. If the PNG data is embedded into another @@ -773,13 +773,13 @@ png_get_copyright(png_const_structrp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.6.12 - June 12, 2014" PNG_STRING_NEWLINE \ + "libpng version 1.6.13 - August 21, 2014" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2014 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ PNG_STRING_NEWLINE; # else - return "libpng version 1.6.12 - June 12, 2014\ + return "libpng version 1.6.13 - August 21, 2014\ Copyright (c) 1998-2014 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; @@ -2293,8 +2293,8 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr, */ else if (!png_sRGB_checks[i].have_md5) { - png_chunk_report(png_ptr, - "out-of-date sRGB profile with no signature", + png_chunk_report(png_ptr, "out-of-date sRGB profile with" + " no signature", PNG_CHUNK_WARNING); } @@ -2307,8 +2307,8 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr, * way. This probably indicates a data error or uninformed hacking. * Fall through to "no match". */ - png_chunk_report(png_ptr, - "Not recognizing known sRGB profile that has been edited", + png_chunk_report(png_ptr, "Not recognizing known sRGB profile that" + " has been edited", PNG_CHUNK_WARNING); break; # endif diff --git a/png.h b/png.h index 75e87362d..0071c1686 100644 --- a/png.h +++ b/png.h @@ -1,7 +1,7 @@ /* png.h - header file for PNG reference library * - * libpng version 1.6.12 - June 12, 2014 + * libpng version 1.6.13 - August 21, 2014 * Copyright (c) 1998-2014 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.) @@ -11,7 +11,7 @@ * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.6.12 - June 12, 2014: Glenn + * libpng versions 0.97, January 1998, through 1.6.13 - August 21, 2014: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: @@ -200,6 +200,9 @@ * 1.6.11 16 10611 16.so.16.11[.0] * 1.6.12rc01-03 16 10612 16.so.16.12[.0] * 1.6.12 16 10612 16.so.16.12[.0] + * 1.6.13beta01-04 16 10613 16.so.16.13[.0] + * 1.6.13rc01-02 16 10613 16.so.16.13[.0] + * 1.6.13 16 10613 16.so.16.13[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be @@ -231,7 +234,7 @@ * * This code is released under the libpng license. * - * libpng versions 1.2.6, August 15, 2004, through 1.6.12, June 12, 2014, are + * libpng versions 1.2.6, August 15, 2004, through 1.6.13, August 21, 2014, are * Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are * distributed according to the same disclaimer and license as libpng-1.2.5 * with the following individual added to the list of Contributing Authors: @@ -343,13 +346,13 @@ * Y2K compliance in libpng: * ========================= * - * June 12, 2014 + * August 21, 2014 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. * * This is your unofficial assurance that libpng from version 0.71 and - * upward through 1.6.12 are Y2K compliant. It is my belief that + * upward through 1.6.13 are Y2K compliant. It is my belief that * earlier versions were also Y2K compliant. * * Libpng only has two year fields. One is a 2-byte unsigned integer @@ -411,9 +414,9 @@ */ /* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.6.12" +#define PNG_LIBPNG_VER_STRING "1.6.13" #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.6.12 - June 12, 2014\n" + " libpng version 1.6.13 - August 21, 2014\n" #define PNG_LIBPNG_VER_SONUM 16 #define PNG_LIBPNG_VER_DLLNUM 16 @@ -421,7 +424,7 @@ /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MINOR 6 -#define PNG_LIBPNG_VER_RELEASE 12 +#define PNG_LIBPNG_VER_RELEASE 13 /* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: @@ -452,7 +455,7 @@ * version 1.0.0 was mis-numbered 100 instead of 10000). From * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ -#define PNG_LIBPNG_VER 10612 /* 1.6.12 */ +#define PNG_LIBPNG_VER 10613 /* 1.6.13 */ /* Library configuration: these options cannot be changed after * the library has been built. @@ -557,7 +560,7 @@ extern "C" { /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ -typedef char* png_libpng_version_1_6_12; +typedef char* png_libpng_version_1_6_13; /* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. * diff --git a/pngconf.h b/pngconf.h index 72ec81fa2..62e075fd6 100644 --- a/pngconf.h +++ b/pngconf.h @@ -1,7 +1,7 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.6.12 - June 12, 2014 + * libpng version 1.6.13 - August 21, 2014 * * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngerror.c b/pngerror.c index f21f4dda5..a2f8a563d 100644 --- a/pngerror.c +++ b/pngerror.c @@ -1,7 +1,7 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * Last changed in libpng 1.6.11 [June 12, 2014] + * Last changed in libpng 1.6.13 [August 21, 2014] * Copyright (c) 1998-2014 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.) @@ -415,10 +415,13 @@ png_app_error(png_const_structrp png_ptr, png_const_charp error_message) } #endif /* BENIGN_ERRORS */ +#define PNG_MAX_ERROR_TEXT 196 /* Currently limited by profile_error in png.c */ +#if defined(PNG_WARNINGS_SUPPORTED) || \ + (defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)) /* These utilities are used internally to build an error message that relates * to the current chunk. The chunk name comes from png_ptr->chunk_name, - * this is used to prefix the message. The message is limited in length - * to 63 bytes, the name characters are output as hex digits wrapped in [] + * which is used to prefix the message. The message is limited in length + * to 63 bytes. The name characters are output as hex digits wrapped in [] * if the character is invalid. */ #define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97)) @@ -427,9 +430,6 @@ static PNG_CONST char png_digit[16] = { 'A', 'B', 'C', 'D', 'E', 'F' }; -#define PNG_MAX_ERROR_TEXT 196 /* Currently limited be profile_error in png.c */ -#if defined(PNG_WARNINGS_SUPPORTED) || \ - (defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)) static void /* PRIVATE */ png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp error_message) diff --git a/pngget.c b/pngget.c index 9e205ad1e..172f50a90 100644 --- a/pngget.c +++ b/pngget.c @@ -1,7 +1,7 @@ /* pngget.c - retrieval of values from info struct * - * Last changed in libpng 1.6.11 [June 12, 2014] + * Last changed in libpng 1.6.11 [June 5, 2014] * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) diff --git a/pngpread.c b/pngpread.c index 819db0305..a4d073b94 100644 --- a/pngpread.c +++ b/pngpread.c @@ -1,7 +1,7 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.6.11 [June 12, 2014] + * Last changed in libpng 1.6.11 [June 5, 2014] * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) diff --git a/pngpriv.h b/pngpriv.h index c4983137c..71a5ab456 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -119,8 +119,12 @@ * PNG_ARM_NEON_OPT is set in CPPFLAGS (to >0) then arm/arm_init.c will fail * to compile with an appropriate #error if ALIGNED_MEMORY has been turned * off. + * + * Note that gcc-4.9 defines __ARM_NEON instead of __ARM_NEON__, so we + * check both variants. */ -# if defined(__ARM_NEON__) && defined(PNG_ALIGNED_MEMORY_SUPPORTED) +# if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && \ + defined(PNG_ALIGNED_MEMORY_SUPPORTED) # define PNG_ARM_NEON_OPT 2 # else # define PNG_ARM_NEON_OPT 0 @@ -148,7 +152,7 @@ * libpng implementation list for incorporation in the next minor release. */ # ifndef PNG_ARM_NEON_IMPLEMENTATION -# ifdef __ARM_NEON__ +# if defined(__ARM_NEON__) || defined(__ARM_NEON) # if defined(__clang__) /* At present it is unknown by the libpng developers which versions * of clang support the intrinsics, however some or perhaps all diff --git a/pngread.c b/pngread.c index 4bf20219b..845ff7b15 100644 --- a/pngread.c +++ b/pngread.c @@ -1,7 +1,7 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.6.11 [June 12, 2014] + * Last changed in libpng 1.6.11 [June 5, 2014] * Copyright (c) 1998-2014 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.) @@ -945,7 +945,7 @@ png_read_destroy(png_structrp png_ptr) png_free(png_ptr, png_ptr->save_buffer); #endif -#if defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) &&\ +#if defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) && \ defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) png_free(png_ptr, png_ptr->unknown_chunk.data); #endif @@ -1220,7 +1220,7 @@ png_read_png(png_structrp png_ptr, png_inforp info_ptr, # define P_LINEAR8 4 /* 8-bit linear: only from a file value */ /* Color-map processing: after libpng has run on the PNG image further - * processing may be needed to conver the data to color-map indicies. + * processing may be needed to convert the data to color-map indices. */ #define PNG_CMAP_NONE 0 #define PNG_CMAP_GA 1 /* Process GA data to a color-map with alpha */ @@ -2187,7 +2187,7 @@ png_image_read_colormap(png_voidp argument) data_encoding = P_FILE; /* The rows from libpng, while technically gray values, are now also - * color-map indicies; however, they may need to be expanded to 1 + * color-map indices; however, they may need to be expanded to 1 * byte per pixel. This is what png_set_packing does (i.e., it * unpacks the bit values into bytes.) */ @@ -2273,8 +2273,8 @@ png_image_read_colormap(png_voidp argument) * 8-bit GA and it has to be processing to single byte color-map * values. Entry 254 is replaced by either a completely * transparent entry or by the background color at full - * precision (and the background color is not a simple gray leve - * in this case.) + * precision (and the background color is not a simple gray + * level in this case.) */ expand_tRNS = 1; output_processing = PNG_CMAP_TRANS; @@ -2752,7 +2752,7 @@ png_image_read_colormap(png_voidp argument) num_trans = 0; output_processing = PNG_CMAP_NONE; - data_encoding = P_FILE; /* Don't change from color-map indicies */ + data_encoding = P_FILE; /* Don't change from color-map indices */ cmap_entries = png_ptr->num_palette; if (cmap_entries > 256) cmap_entries = 256; @@ -2792,7 +2792,7 @@ png_image_read_colormap(png_voidp argument) i < num_trans ? trans[i] : 255U, P_FILE/*8-bit*/); } - /* The PNG data may have indicies packed in fewer than 8 bits, it + /* The PNG data may have indices packed in fewer than 8 bits, it * must be expanded if so. */ if (png_ptr->bit_depth < 8) diff --git a/pngrtran.c b/pngrtran.c index 5b8942397..d8ab70513 100644 --- a/pngrtran.c +++ b/pngrtran.c @@ -1,7 +1,7 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.6.11 [June 12, 2014] + * Last changed in libpng 1.6.11 [June 5, 2014] * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) diff --git a/pngrutil.c b/pngrutil.c index cc52202a5..3f415bf7d 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -1,7 +1,7 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.6.11 [June 12, 2014] + * Last changed in libpng 1.6.11 [June 5, 2014] * Copyright (c) 1998-2014 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.) @@ -1319,9 +1319,9 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) * chunk is just ignored, so does not invalidate the color space. An * alternative is to set the 'invalid' flags at the start of this routine * and only clear them in they were not set before and all the tests pass. - * The minimum 'deflate' stream is assumed to be just the 2 byte header and 4 - * byte checksum. The keyword must be one character and there is a - * terminator (0) byte and the compression method. + * The minimum 'deflate' stream is assumed to be just the 2 byte header and + * 4 byte checksum. The keyword must be at least one character and there is + * a terminator (0) byte and the compression method. */ if (length < 9) { @@ -2640,7 +2640,7 @@ png_handle_iTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) /* prefix_length should now be at the trailing '\0' of the translated * keyword, but it may already be over the end. None of this arithmetic * can overflow because chunks are at most 2^31 bytes long, but on 16-bit - * systems the available allocaton may overflow. + * systems the available allocation may overflow. */ ++prefix_length; diff --git a/pngset.c b/pngset.c index 0c827d3c1..cde4c6dad 100644 --- a/pngset.c +++ b/pngset.c @@ -1,7 +1,7 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.6.11 [June 12, 2014] + * Last changed in libpng 1.6.11 [June 5, 2014] * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) diff --git a/pngtest.c b/pngtest.c index ffac74e7b..bd9688bba 100644 --- a/pngtest.c +++ b/pngtest.c @@ -1,7 +1,7 @@ /* pngtest.c - a simple test program to test libpng * - * Last changed in libpng 1.6.11 [June 12, 2014] + * Last changed in libpng 1.6.11 [June 5, 2014] * Copyright (c) 1998-2014 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.) @@ -1991,4 +1991,4 @@ main(void) #endif /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_12 Your_png_h_is_not_version_1_6_12; +typedef png_libpng_version_1_6_13 Your_png_h_is_not_version_1_6_13; diff --git a/pngtrans.c b/pngtrans.c index 792e13a44..9b6c3d0cd 100644 --- a/pngtrans.c +++ b/pngtrans.c @@ -1,7 +1,7 @@ /* pngtrans.c - transforms the data in a row (used by both readers and writers) * - * Last changed in libpng 1.6.11 [June 12, 2014] + * Last changed in libpng 1.6.11 [June 5, 2014] * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) diff --git a/pngwrite.c b/pngwrite.c index 7087d08cd..f03aeb2ce 100644 --- a/pngwrite.c +++ b/pngwrite.c @@ -1,7 +1,7 @@ /* pngwrite.c - general routines to write a PNG file * - * Last changed in libpng 1.6.11 [June 12, 2014] + * Last changed in libpng 1.6.11 [June 5, 2014] * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) diff --git a/pngwutil.c b/pngwutil.c index cfc331246..8a0b7f2ec 100644 --- a/pngwutil.c +++ b/pngwutil.c @@ -1,7 +1,7 @@ /* pngwutil.c - utilities to write a PNG file * - * Last changed in libpng 1.6.11 [June 12, 2014] + * Last changed in libpng 1.6.11 [June 5, 2014] * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) diff --git a/projects/vstudio/readme.txt b/projects/vstudio/readme.txt index a39fed546..5b0035d55 100644 --- a/projects/vstudio/readme.txt +++ b/projects/vstudio/readme.txt @@ -1,7 +1,7 @@ VisualStudio instructions -libpng version 1.6.12 - June 12, 2014 +libpng version 1.6.13 - August 21, 2014 Copyright (c) 1998-2010 Glenn Randers-Pehrson diff --git a/projects/vstudio/zlib.props b/projects/vstudio/zlib.props index 7d09a412e..a39e57710 100644 --- a/projects/vstudio/zlib.props +++ b/projects/vstudio/zlib.props @@ -2,7 +2,7 @@