diff options
author | Martin Schröder <martin@oneiros.de> | 2006-12-25 23:51:23 +0000 |
---|---|---|
committer | Martin Schröder <martin@oneiros.de> | 2006-12-25 23:51:23 +0000 |
commit | cb7332d3cba75e7e53f19e04d14f1b0e006959eb (patch) | |
tree | d209d15bd92836f37b285ec2787c00318acbc3d3 /Build | |
parent | d9a9989973de064109f0aa3808304af3f7a5e42a (diff) |
libpng 1.2.14
git-svn-id: svn://tug.org/texlive/trunk@2919 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
33 files changed, 1573 insertions, 1968 deletions
diff --git a/Build/source/libs/libpng/ANNOUNCE b/Build/source/libs/libpng/ANNOUNCE index e40b94a09bf..51a000f8196 100644 --- a/Build/source/libs/libpng/ANNOUNCE +++ b/Build/source/libs/libpng/ANNOUNCE @@ -1,32 +1,53 @@ -Libpng 1.2.8 - December 3, 2004 +Libpng 1.2.14 - November 27, 2006 This is a public release of libpng, intended for use in production codes. -Changes since the last public release (1.2.7): - - Fixed bug in png_text_compress() that would fail to complete a large block. - Fixed bug, introduced in libpng-1.2.7, that overruns a buffer during - strip alpha operation in png_do_strip_filler(). - Added PNG_1_2_X definition in pngconf.h - #ifdef out png_info_init in png.c and png_read_init in pngread.c (as of 1.3.0) - Reduce color_type to a nonalpha type after strip alpha operation in - png_do_strip_filler(). - Revised definitions of PNG_MAX_UINT_32, PNG_MAX_SIZE, and PNG_MAXSUM - Fixed (again) definition of PNG_LIBPNG_VER_DLLNUM in png.h (Cosmin). - Added PNG_LIBPNG_BUILD_PRIVATE in png.h (Cosmin). - Set png_ptr->zstream.data_type to Z_BINARY, to avoid unnecessary detection - of data type in deflate (Cosmin). - Deprecated but continue to support SPECIALBUILD and PRIVATEBUILD in favor of - PNG_LIBPNG_BUILD_SPECIAL_STRING and PNG_LIBPNG_BUILD_PRIVATE_STRING. - Despammed mailing addresses by masking "@" with "at". - Added scripts/makefile.elf with supporting code in pngconf.h for symbol - versioning (John Bowler). - Added projects/visualc71 (Simon-pierre). - -Send comments/corrections/commendations to -png-implement at ccrc.wustl.edu (subscription required; write to -majordomo at ccrc.wustl.edu with "subscribe png-implement" in the message) -or to glennrp at users.sourceforge.net +Files available for download: + +Source files with LF line endings (for Unix/Linux) and with a +"configure" script + + libpng-1.2.14.tar.gz + libpng-1.2.14.tar.bz2 + +Source files with LF line endings (for Unix/Linux) without the +"configure" script + + libpng-1.2.14-no-config.tar.gz + libpng-1.2.14-no-config.tar.bz2 + +Source files with CRLF line endings (for Windows), without the +"configure" script + + lpng1214.zip + lpng1214.tar.bz2 + +Project files + + libpng-1.2.14-project-netware.zip + libpng-1.2.14-project-wince.zip + +Other information: + + libpng-1.2.14-README.txt + libpng-1.2.14-KNOWNBUGS.txt + libpng-1.2.14-LICENSE.txt + libpng-1.2.14-Y2K-compliance.txt + +Changes since the last public release (1.2.13): + +version 1.2.14 [November 27, 2006] + + Relocated three misplaced tests for NULL png_ptr. + Built Makefile.in with automake-1.9.6 instead of 1.9.2. + Build configure with autoconf-2.60 instead of 2.59 + Added some typecasts in png_zalloc(). + Changed "strtod" to "png_strtod" in pngrutil.c + +Send comments/corrections/commendations to png-mng-implement at lists.sf.net +(subscription required; visit +https://lists.sourceforge.net/lists/listinfo/png-mng-implement +to subscribe) or to glennrp at users.sourceforge.net Glenn R-P diff --git a/Build/source/libs/libpng/CHANGES b/Build/source/libs/libpng/CHANGES index 90c816e3514..dfb4fd5ab2d 100644 --- a/Build/source/libs/libpng/CHANGES +++ b/Build/source/libs/libpng/CHANGES @@ -10,7 +10,7 @@ version 0.3 split up pngwrite.c to several files added pnglib.txt added example.c - cleaned up writer, adding a few new tranformations + cleaned up writer, adding a few new transformations fixed some bugs in writer interfaced with zlib 0.5 added K&R support @@ -22,7 +22,7 @@ version 0.4 created png_color_16 and png_color_8 to handle color needs cleaned up color type defines fixed various bugs - made various names more consistant + made various names more consistent interfaced with zlib 0.71 cleaned up zTXt reader and writer (using zlib's Reset functions) split transformations into pngrtran.c and pngwtran.c @@ -151,7 +151,7 @@ version 0.95 [March, 1997] added "packswap" transformation, which changes the endianness of packed-pixel bytes (Kevin Bracey) added "strip_alpha" transformation, which removes the alpha channel of - input images without using it (not neccesarily a good idea) + input images without using it (not necessarily a good idea) added "swap_alpha" transformation, which puts the alpha channel in front of the color bytes instead of after removed all implicit variable tests which assume NULL == 0 (I think) @@ -172,7 +172,7 @@ version 0.95 [March, 1997] more chunk types tested in pngtest.c renamed pngrcb.c to pngset.c, and all png_read_<chunk> functions to be png_set_<chunk>. We now have corresponding png_get_<chunk> - functions in pngget.c to get infomation in info_ptr. This isolates + functions in pngget.c to get information in info_ptr. This isolates the application from the internal organization of png_info_struct (good for shared library implementations). @@ -522,9 +522,9 @@ version 1.0.5b [November 23, 1999] Updated scripts/makevms.com and added makevms.com to contrib/gregbook and contrib/pngminus (Martin Zinser) version 1.0.5c [November 26, 1999] - Moved png_get_header_version from png.h to png.c, to accomodate ansi2knr. + Moved png_get_header_version from png.h to png.c, to accommodate ansi2knr. Removed all global arrays (according to PNG_NO_GLOBAL_ARRAYS macro), to - accomodate making DLL's: Moved usr_png_ver from global variable to function + accommodate making DLL's: Moved usr_png_ver from global variable to function png_get_header_ver() in png.c. Moved png_sig to png_sig_bytes in png.c and eliminated use of png_sig in pngwutil.c. Moved the various png_CHNK arrays into pngtypes.h. Eliminated use of global png_pass arrays. Declared the @@ -1345,7 +1345,7 @@ version 1.0.16rc5 and 1.2.6rc5 [August 10, 2004] Moved "PNG_HANDLE_CHUNK_*" macros out of PNG_ASSEMBLER_CODE_SUPPORTED section of png.h where they were inadvertently placed in version rc3. -version 1.0.16 and 1.2.6 [August 15, 2004] +version 1.2.6 and 1.0.16 [August 15, 2004] Revised pngtest so memory allocation testing is only done when PNG_DEBUG==1. version 1.2.7beta1 [August 26, 2004] Removed unused pngasmrd.h file. @@ -1361,7 +1361,8 @@ version 1.2.7beta2 [August 28, 2004] Added png_set_add_alpha() that updates color type. version 1.0.17rc1 and 1.2.7rc1 [September 4, 2004] Revised png_set_strip_filler() to not remove alpha if color_type has alpha. -version 1.0.17 and 1.2.7 [September 12, 2004] + +version 1.2.7 and 1.0.17 [September 12, 2004] Added makefile.hp64 Changed projects/msvc/png32ms.def to scripts/png32ms.def in makefile.cygwin version 1.2.8beta1 [November 1, 2004] @@ -1408,12 +1409,241 @@ version 1.2.8rc4 [November 29, 2004] Added projects/visualc7 (Simon-pierre). version 1.2.8rc5 [November 29, 2004] Fixed new typo in scripts/pngw32.rc + version 1.2.8 [December 3, 2004] Removed projects/visualc7, added projects/visualc71. -Send comments/corrections/commendations to -png-implement at ccrc.wustl.edu (subscription required; write to -majordomo at ccrc.wustl.edu with "subscribe png-implement" in the message) +version 1.2.9beta1 [February 21, 2006] + + Initialized some structure members in pngwutil.c to avoid gcc-4.0.0 complaints + Revised man page and libpng.txt to make it clear that one should not call + png_read_end or png_write_end after png_read_png or png_write_png. + Updated references to png-mng-implement mailing list. + Fixed an incorrect typecast in pngrutil.c + Added PNG_NO_READ_SUPPORTED conditional for making a write-only library. + Added PNG_NO_WRITE_INTERLACING_SUPPORTED conditional. + Optimized alpha-inversion loops in pngwtran.c + Moved test for nonzero gamma outside of png_build_gamma_table() in pngrtran.c + Make sure num_trans is <= 256 before copying data in png_set_tRNS(). + Make sure num_palette is <= 256 before copying data in png_set_PLTE(). + Interchanged order of write_swap_alpha and write_invert_alpha transforms. + Added parentheses in the definition of PNG_LIBPNG_BUILD_TYPE (Cosmin). + Optimized zlib window flag (CINFO) in contrib/pngsuite/*.png (Cosmin). + Updated scripts/makefile.bc32 for Borland C++ 5.6 (Cosmin). + Exported png_get_uint_32, png_save_uint_32, png_get_uint_16, png_save_uint_16, + png_get_int_32, png_save_int_32, png_get_uint_31 (Cosmin). + Added type cast (png_byte) in png_write_sCAL() (Cosmin). + Fixed scripts/makefile.cygwin (Christian Biesinger, Cosmin). + Default iTXt support was inadvertently enabled. + +version 1.2.9beta2 [February 21, 2006] + + Check for png_rgb_to_gray and png_gray_to_rgb read transformations before + checking for png_read_dither in pngrtran.c + Revised checking of chromaticity limits to accommodate extended RGB + colorspace (John Denker). + Changed line endings in some of the project files to CRLF, even in the + "Unix" tar distributions (Cosmin). + Made png_get_int_32 and png_save_int_32 always available (Cosmin). + Updated scripts/pngos2.def, scripts/pngw32.def and projects/wince/png32ce.def + with the newly exported functions. + Eliminated distributions without the "configure" script. + Updated INSTALL instructions. + +version 1.2.9beta3 [February 24, 2006] + + Fixed CRCRLF line endings in contrib/visupng/VisualPng.dsp + Made libpng.pc respect EXEC_PREFIX (D. P. Kreil, J. Bowler) + Removed reference to pngasmrd.h from Makefile.am + Renamed CHANGES to ChangeLog. + Renamed LICENSE to COPYING. + Renamed ANNOUNCE to NEWS. + Created AUTHORS file. + +version 1.2.9beta4 [March 3, 2006] + + Changed definition of PKGCONFIG from $prefix/lib to $libdir in configure.ac + Reverted to filenames LICENSE and ANNOUNCE; removed AUTHORS and COPYING. + Removed newline from the end of some error and warning messages. + Removed test for sqrt() from configure.ac and configure. + Made swap tables in pngtrans.c PNG_CONST (Carlo Bramix). + Disabled default iTXt support that was inadvertently enabled in + libpng-1.2.9beta1. + Added "OS2" to list of systems that don't need underscores, in pnggccrd.c + Removed libpng version and date from *.c files. + +version 1.2.9beta5 [March 4, 2006] + Removed trailing blanks from source files. + Put version and date of latest change in each source file, and changed + copyright year accordingly. + More cleanup of configure.ac, Makefile.ac, and associated scripts. + Restored scripts/makefile.elf which was inadvertently deleted. + +version 1.2.9beta6 [March 6, 2006] + Fixed typo (14) in configuration files. + +version 1.2.9beta7 [March 7, 2006] + Removed libpng.vers and libpng.sym from libpng12_la_SOURCES in Makefile.am + Fixed inconsistent #ifdef's around png_sig_bytes() and png_set_sCAL_s() + in png.h. + Updated makefile.elf as suggested by debian. + Made cosmetic changes to some makefiles, adding LN_SF and other macros. + Made some makefiles accept "exec_prefix". + +version 1.2.9beta8 [March 9, 2006] + Fixed some "#if defined (..." which should be "#if defined(..." + Bug introduced in libpng-1.2.8. + Fixed inconsistency in definition of png_default_read_data() + Restored blank that was lost from makefile.sggcc "clean" target in beta7. + Revised calculation of "current" and "major" for irix in ltmain.sh + Changed "mkdir" to "MKDIR_P" in some makefiles. + Separated PNG_EXPAND and PNG_EXPAND_tRNS. + Added png_set_expand_gray_1_2_4_to_8() and deprecated + png_set_gray_1_2_4_to_8() which also expands tRNS to alpha. + +version 1.2.9beta9 [March 10, 2006] + Include "config.h" in pngconf.h when available. + Added some checks for NULL png_ptr or NULL info_ptr (timeless) + +version 1.2.9beta10 [March 20, 2006] + Removed extra CR from contrib/visualpng/VisualPng.dsw (Cosmin) + Made pnggccrd.c PIC-compliant (Christian Aichinger). + Added makefile.mingw (Wolfgang Glas). + Revised pngconf.h MMX checking. + +version 1.2.9beta11 [March 22, 2006] + Fixed out-of-order declaration in pngwrite.c that was introduced in beta9 + Simplified some makefiles by using LIBSO, LIBSOMAJ, and LIBSOVER macros. + +version 1.2.9rc1 [March 31, 2006] + Defined PNG_USER_PRIVATEBUILD when including "pngusr.h" (Cosmin). + Removed nonsensical assertion check from pngtest.c (Cosmin). + +version 1.2.9 [April 14, 2006] + Revised makefile.beos and added "none" selector in ltmain.sh + +version 1.2.10beta1 [April 15, 2006] + Renamed "config.h" to "png_conf.h" and revised Makefile.am to add + -DPNG_BUILDING_LIBPNG to compile directive, and modified pngconf.h + to include png_conf.h only when PNG_BUILDING_LIBPNG is defined. + +version 1.2.10beta2 [April 15, 2006] + Manually updated Makefile.in and configure. Changed png_conf.h.in + back to config.h. + +version 1.2.10beta3 [April 15, 2006] + Change png_conf.h back to config.h in pngconf.h. + +version 1.2.10beta4 [April 16, 2006] + Change PNG_BUILDING_LIBPNG to PNG_CONFIGURE_LIBPNG in config/Makefile*. + +version 1.2.10beta5 [April 16, 2006] + Added a configure check for compiling assembler code in pnggccrd.c + +version 1.2.10beta6 [April 17, 2006] + Revised the configure check for pnggccrd.c + Moved -DPNG_CONFIGURE_LIBPNG into @LIBPNG_DEFINES@ + Added @LIBPNG_DEFINES@ to arguments when building libpng.sym + +version 1.2.10beta7 [April 18, 2006] + Change "exec_prefix=$prefix" to "exec_prefix=$(prefix)" in makefiles. + +version 1.2.10rc1 [April 19, 2006] + Ensure pngconf.h doesn't define both PNG_USE_PNGGCCRD and PNG_USE_PNGVCRD + Fixed "LN_FS" typo in makefile.sco and makefile.solaris. + +version 1.2.10rc2 [April 20, 2006] + Added a backslash between -DPNG_CONFIGURE_LIBPNG and -DPNG_NO_ASSEMBLER_CODE + in configure.ac and configure + Made the configure warning about versioned symbols less arrogant. + +version 1.2.10rc3 [April 21, 2006] + Added a note in libpng.txt that png_set_sig_bytes(8) can be used when + writing an embedded PNG without the 8-byte signature. + Revised makefiles and configure to avoid making links to libpng.so.* + +version 1.2.10 [April 23, 2006] + Reverted configure to "rc2" state. + +version 1.2.11beta1 [May 31, 2006] + scripts/libpng.pc.in contained "configure" style version info and would + not work with makefiles. + The shared-library makefiles were linking to libpng.so.0 instead of + libpng.so.3 compatibility as the library. + +version 1.2.11beta2 [June 2, 2006] + Increased sprintf buffer from 50 to 52 chars in pngrutil.c to avoid + buffer overflow. + Fixed bug in example.c (png_set_palette_rgb -> png_set_palette_to_rgb) + +version 1.2.11beta3 [June 5, 2006] + Prepended "#! /bin/sh" to ltmail.sh and contrib/pngminus/*.sh (Cosmin). + Removed the accidental leftover Makefile.in~ (Cosmin). + Avoided potential buffer overflow and optimized buffer in + png_write_sCAL(), png_write_sCAL_s() (Cosmin). + Removed the include directories and libraries from CFLAGS and LDFLAGS + in scripts/makefile.gcc (Nelson A. de Oliveira, Cosmin). + +version 1.2.11beta4 [June 6, 2006] + Allow zero-length IDAT chunks after the entire zlib datastream, but not + after another intervening chunk type. + +version 1.0.19rc1, 1.2.11rc1 [June 13, 2006] + Deleted extraneous square brackets from [config.h] in configure.ac + +version 1.0.19rc2, 1.2.11rc2 [June 14, 2006] + Added prototypes for PNG_INCH_CONVERSIONS functions to png.h + Revised INSTALL and autogen.sh + Fixed typo in several makefiles (-W1 should be -Wl) + Added typedef for png_int_32 and png_uint_32 on 64-bit systems. + +version 1.0.19rc3, 1.2.11rc3 [June 15, 2006] + Removed the new typedefs for 64-bit systems (delay until version 1.4.0) + Added one zero element to png_gamma_shift[] array in pngrtran.c to avoid + reading out of bounds. + +version 1.0.19rc4, 1.2.11rc4 [June 15, 2006] + Really removed the new typedefs for 64-bit systems. + +version 1.0.19rc5, 1.2.11rc5 [June 22, 2006] + Removed png_sig_bytes entry from scripts/pngw32.def + +version 1.0.19, 1.2.11 [June 26, 2006] + None. + +version 1.0.20, 1.2.12 [June 27, 2006] + Really increased sprintf buffer from 50 to 52 chars in pngrutil.c to avoid + buffer overflow. + +version 1.2.13beta1 [October 2, 2006] + Removed AC_FUNC_MALLOC from configure.ac + Work around Intel-Mac compiler bug by setting PNG_NO_MMX_CODE in pngconf.h + Change "logical" to "bitwise" throughout documentation. + Detect and fix attempt to write wrong iCCP profile length. + +version 1.0.21, 1.2.13 [November 14, 2006] + Fix potential buffer overflow in sPLT chunk handler. + Fix Makefile.am to not try to link to noexistent files. + Check all exported functions for NULL png_ptr. + +version 1.2.14beta1 [November 17, 2006] + Relocated three misplaced tests for NULL png_ptr. + Built Makefile.in with automake-1.9.6 instead of 1.9.2. + Build configure with autoconf-2.60 instead of 2.59 + +version 1.2.14beta2 [November 17, 2006] + Added some typecasts in png_zalloc(). + +version 1.2.14rc1 [November 20, 2006] + Changed "strtod" to "png_strtod" in pngrutil.c + +version 1.0.22, 1.2.14 [November 27, 2006] + 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 +to subscribe) or to glennrp at users.sourceforge.net Glenn R-P diff --git a/Build/source/libs/libpng/INSTALL b/Build/source/libs/libpng/INSTALL index ee3d0209c84..79662a2502e 100644 --- a/Build/source/libs/libpng/INSTALL +++ b/Build/source/libs/libpng/INSTALL @@ -1,16 +1,43 @@ -Installing libpng version 1.2.8 - December 3, 2004 +Installing libpng version 1.2.14 - November 27, 2006 -Before installing libpng, you must first install zlib. zlib -can usually be found wherever you got libpng. zlib can be -placed in another directory, at the same level as libpng. -Note that your system might already have a preinstalled -zlib, but you will still need to have access to the -zlib.h and zconf.h include files that correspond to the -version of zlib that's installed. +On Unix/Linux and similar systems, you can simply type + + ./configure [--prefix=$HOME] + make check + make install + +and ignore the rest of this document. + +If configure does not work on your system and you have a reasonably +up-to-date set of tools, running ./autogen.sh before running ./configure +may fix the problem. You can also run the individual commands in +autogen.sh with the --force option, if supported by your version of +the tools. If you run 'libtoolize --force', though, this will replace +the distributed, patched, version of ltmain.sh with an unpatched version +and your shared library builds may fail to produce libraries with the +correct version numbers. + +Instead, you can use one of the custom-built makefiles in the +"scripts" directory + + cp scripts/makefile.system makefile + make test + make install + +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. + +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 +correspond to the version of zlib that's installed. You can rename the directories that you downloaded (they -might be called "libpng-1.2.8" or "lpng109" and "zlib-1.2.1" +might be called "libpng-1.2.14" or "lpng109" and "zlib-1.2.1" or "zlib121") so that you have directories called "zlib" and "libpng". Your directory structure should look like this: @@ -47,7 +74,6 @@ If the line endings in the files look funny, you may wish to get the other distribution of libpng. It is available in both tar.gz (UNIX style line endings) and zip (DOS style line endings) formats. - If you are building libpng with MSVC, you can enter the libpng projects\visualc6 directory and follow the instructions in projects\visualc6\README.txt. @@ -59,19 +85,19 @@ build libpng for Netware or Beos as instructed in projects\netware.txt or projects\beos. Else enter the zlib directory and follow the instructions in zlib/README, -then come back here and choose the appropriate makefile.sys in the scripts -directory. +then come back here and run "configure" or choose the appropriate +makefile.sys in the scripts directory. The files that are presently available in the scripts directory include makefile.std => Generic UNIX makefile (cc, creates static libpng.a) makefile.elf => Linux/ELF makefile symbol versioning, - gcc, creates libpng12.so.0.1.2.8) + gcc, creates libpng12.so.0.1.2.14) makefile.linux => Linux/ELF makefile - (gcc, creates libpng12.so.0.1.2.8) + (gcc, creates libpng12.so.0.1.2.14) makefile.gcmmx => Linux/ELF makefile - (gcc, creates libpng12.so.0.1.2.8, + (gcc, creates libpng12.so.0.1.2.14, uses assembler code tuned for Intel MMX platform) makefile.gcc => Generic makefile (gcc, creates static libpng.a) makefile.knr => Archaic UNIX Makefile that converts files with @@ -94,12 +120,12 @@ include makefile.openbsd => OpenBSD makefile makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib) makefile.sggcc => Silicon Graphics (gcc, - creates libpng12.so.0.1.2.8) + creates libpng12.so.0.1.2.14) makefile.sunos => Sun makefile makefile.solaris => Solaris 2.X makefile (gcc, - creates libpng12.so.0.1.2.8) + creates libpng12.so.0.1.2.14) makefile.so9 => Solaris 9 makefile (gcc, - creates libpng12.so.0.1.2.8) + creates libpng12.so.0.1.2.14) makefile.32sunu => Sun Ultra 32-bit makefile makefile.64sunu => Sun Ultra 64-bit makefile makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc diff --git a/Build/source/libs/libpng/KNOWNBUG b/Build/source/libs/libpng/KNOWNBUG index 620296f679e..6175d6f5f97 100644 --- a/Build/source/libs/libpng/KNOWNBUG +++ b/Build/source/libs/libpng/KNOWNBUG @@ -1,5 +1,5 @@ -Known bugs in libpng version 1.2.8 +Known bugs in libpng version 1.2.14 1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when reading interlaced PNG files, when assembler code is enabled but running @@ -9,3 +9,20 @@ Known bugs in libpng version 1.2.8 fixed a problem under FreeBSD but not the problem with NetBSD, which still fails as of libpng-1.2.2rc1. +2. February 23, 2006: The custom makefiles don't build libpng with -lz. + + STATUS: This is a subject of debate. The change will probably be made + as a part of a major overhaul of the makefiles in libpng version 1.3.0. + +3. February 24, 2006: The Makefile generated by the "configure" script + fails to install symbolic links + libpng12.so => libpng12.so.0.1.2.9betaN + that are generated by the custom makefiles. + + STATUS: For now, system library builders should use the custom makefiles. + +4. November 15, 2006: On some platforms (e.g. x86_64), there are unsatisfied + references to some MMX functions. + + STATUS: This is fixed in libpng-1.4.0, but in libpng-1.0.x and 1.2.x + you have to put PNG_NO_MMX_CODE manually into pngconf.h. diff --git a/Build/source/libs/libpng/LICENSE b/Build/source/libs/libpng/LICENSE index fe3ac4b96fb..644475c2c2f 100644 --- a/Build/source/libs/libpng/LICENSE +++ b/Build/source/libs/libpng/LICENSE @@ -8,8 +8,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: If you modify libpng you may insert additional notices immediately following this sentence. -libpng version 1.2.6, December 3, 2004, is -Copyright (c) 2004 Glenn Randers-Pehrson, and is +libpng versions 1.2.6, August 15, 2004, through 1.2.14, November 27, 2006, are +Copyright (c) 2004, 2006 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 @@ -106,4 +106,4 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -December 3, 2004 +November 27, 2006 diff --git a/Build/source/libs/libpng/Makefile.in b/Build/source/libs/libpng/Makefile.in index c8b5d77de5d..541f8a6eb94 100644 --- a/Build/source/libs/libpng/Makefile.in +++ b/Build/source/libs/libpng/Makefile.in @@ -13,7 +13,7 @@ kpse_include ../texk/make/library.mk ZLIBDIR=../zlib ZLIBSRCDIR=$(srcdir)/$(ZLIBDIR) -XDEFS=@ZLIBCPPFLAGS@ +XDEFS=-DPNG_NO_ASSEMBLER_CODE @ZLIBCPPFLAGS@ OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ diff --git a/Build/source/libs/libpng/README b/Build/source/libs/libpng/README index 06f9fe4d64a..c2aa49ee8c9 100644 --- a/Build/source/libs/libpng/README +++ b/Build/source/libs/libpng/README @@ -1,4 +1,4 @@ -README for libpng version 1.2.8 - December 3, 2004 (shared library 12.0) +README for libpng version 1.2.14 - November 27, 2006 (shared library 12.0) See the note about version numbers near the top of png.h See INSTALL for instructions on how to install libpng. @@ -103,9 +103,10 @@ fix. Please mention "libpng" somewhere in the subject line. Thanks. This release was created and will be supported by myself (of course based in a large way on Guy's and Andreas' earlier work), and the PNG group. -glennrp at users.sourceforge.net -png-implement at ccrc.wustl.edu (subscription required; write to -majordomo at ccrc.wustl.edu with "subscribe png-implement" in the message). +Send comments/corrections/commendations to png-mng-implement at lists.sf.net +(subscription required; visit +https://lists.sourceforge.net/lists/listinfo/png-mng-implement +to subscribe) or to glennrp at users.sourceforge.net You can't reach Guy, the original libpng author, at the addresses given in previous versions of this document. He and Andreas will read mail @@ -189,11 +190,11 @@ Files in this distribution: descrip.mms => VMS makefile for MMS or MMK makefile.std => Generic UNIX makefile (cc, creates static libpng.a) makefile.elf => Linux/ELF makefile symbol versioning, - gcc, creates libpng12.so.0.1.2.8) + gcc, creates libpng12.so.0.1.2.14) makefile.linux => Linux/ELF makefile - (gcc, creates libpng12.so.0.1.2.8) + (gcc, creates libpng12.so.0.1.2.14) makefile.gcmmx => Linux/ELF makefile - (gcc, creates libpng12.so.0.1.2.8, + (gcc, creates libpng12.so.0.1.2.14, uses assembler code tuned for Intel MMX platform) makefile.gcc => Generic makefile (gcc, creates static libpng.a) makefile.knr => Archaic UNIX Makefile that converts files with @@ -215,12 +216,12 @@ Files in this distribution: makefile.openbsd => OpenBSD makefile makefile.sgi => Silicon Graphics IRIX (cc, creates static lib) makefile.sggcc => Silicon Graphics - (gcc, creates libpng12.so.0.1.2.8) + (gcc, creates libpng12.so.0.1.2.14) makefile.sunos => Sun makefile makefile.solaris => Solaris 2.X makefile - (gcc, creates libpng12.so.0.1.2.8) + (gcc, creates libpng12.so.0.1.2.14) makefile.so9 => Solaris 9 makefile - (gcc, creates libpng12.so.0.1.2.8) + (gcc, creates libpng12.so.0.1.2.14) makefile.32sunu => Sun Ultra 32-bit makefile makefile.64sunu => Sun Ultra 64-bit makefile makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc diff --git a/Build/source/libs/libpng/Y2KINFO b/Build/source/libs/libpng/Y2KINFO index 4db294fb53e..731dc7b2ad9 100644 --- a/Build/source/libs/libpng/Y2KINFO +++ b/Build/source/libs/libpng/Y2KINFO @@ -1,13 +1,13 @@ Y2K compliance in libpng: ========================= - December 3, 2004 + November 27, 2006 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.2.8 are Y2K compliant. It is my belief that earlier + upward through 1.2.14 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. Libpng only has three year fields. One is a 2-byte unsigned integer diff --git a/Build/source/libs/libpng/example.c b/Build/source/libs/libpng/example.c index ba0ecc5b5cc..fd7096e4d46 100644 --- a/Build/source/libs/libpng/example.c +++ b/Build/source/libs/libpng/example.c @@ -1,7 +1,13 @@ #if 0 /* in case someone actually tries to compile this */ -/* example.c - an example of using libpng */ +/* example.c - an example of using libpng + * Last changed in libpng 1.2.1 December 7, 2001. + * This file has been placed in the public domain by the authors. + * Maintained 1998-2001 Glenn Randers-Pehrson + * Maintained 1996, 1997 Andreas Dilger) + * Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + */ /* This is an example of how to use libpng to read and write PNG files. * The file libpng.txt is much more verbose then this. If you have not @@ -194,7 +200,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */ /* Expand paletted colors into true RGB triplets */ if (color_type == PNG_COLOR_TYPE_PALETTE) - png_set_palette_rgb(png_ptr); + png_set_palette_to_rgb(png_ptr); /* Expand grayscale images to the full 8 bits from 1, 2, or 4 bits/pixel */ if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) @@ -490,10 +496,10 @@ row_callback(png_structp png_ptr, png_bytep new_row, * In this function you will receive a pointer to new row data from * libpng called new_row that is to replace a corresponding row (of * the same data format) in a buffer allocated by your application. - * + * * The new row data pointer new_row may be NULL, indicating there is * no new data to be replaced (in cases of interlace loading). - * + * * If new_row is not NULL then you need to call * png_progressive_combine_row() to replace the corresponding row as * shown below: diff --git a/Build/source/libs/libpng/libpng.3 b/Build/source/libs/libpng/libpng.3 index 1feceee384b..2c5ed756f3a 100644 --- a/Build/source/libs/libpng/libpng.3 +++ b/Build/source/libs/libpng/libpng.3 @@ -1,775 +1,404 @@ -.TH LIBPNG 3 "December 3, 2004" +.TH LIBPNG 3 "November 27, 2006" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.2.8 +libpng \- Portable Network Graphics (PNG) Reference Library 1.2.14 .SH SYNOPSIS -\fI\fB - -\fB#include <png.h>\fP - -\fI\fB +\fB +#include <png.h>\fP \fBpng_uint_32 png_access_version_number \fI(void\fP\fB);\fP -\fI\fB - \fBint png_check_sig (png_bytep \fP\fIsig\fP\fB, int \fInum\fP\fB);\fP -\fI\fB - \fBvoid png_chunk_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP -\fI\fB - \fBvoid png_chunk_warning (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fImessage\fP\fB);\fP -\fI\fB - \fBvoid png_convert_from_struct_tm (png_timep \fP\fIptime\fP\fB, struct tm FAR * \fIttime\fP\fB);\fP -\fI\fB - \fBvoid png_convert_from_time_t (png_timep \fP\fIptime\fP\fB, time_t \fIttime\fP\fB);\fP -\fI\fB - \fBpng_charp png_convert_to_rfc1123 (png_structp \fP\fIpng_ptr\fP\fB, png_timep \fIptime\fP\fB);\fP -\fI\fB - \fBpng_infop png_create_info_struct (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBpng_structp png_create_read_struct (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fIwarn_fn\fP\fB);\fP -\fI\fB - \fBpng_structp png_create_read_struct_2(png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP -\fI\fB - \fBpng_structp png_create_write_struct (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fIwarn_fn\fP\fB);\fP -\fI\fB - \fBpng_structp png_create_write_struct_2(png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP -\fI\fB - \fBint png_debug(int \fP\fIlevel\fP\fB, png_const_charp \fImessage\fP\fB);\fP -\fI\fB - \fBint png_debug1(int \fP\fIlevel\fP\fB, png_const_charp \fP\fImessage\fP\fB, \fIp1\fP\fB);\fP -\fI\fB - \fBint png_debug2(int \fP\fIlevel\fP\fB, png_const_charp \fP\fImessage\fP\fB, \fP\fIp1\fP\fB, \fIp2\fP\fB);\fP -\fI\fB - \fBvoid png_destroy_info_struct (png_structp \fP\fIpng_ptr\fP\fB, png_infopp \fIinfo_ptr_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_destroy_read_struct (png_structpp \fP\fIpng_ptr_ptr\fP\fB, png_infopp \fP\fIinfo_ptr_ptr\fP\fB, png_infopp \fIend_info_ptr_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_destroy_write_struct (png_structpp \fP\fIpng_ptr_ptr\fP\fB, png_infopp \fIinfo_ptr_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP -\fI\fB - \fBvoid png_free (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fIptr\fP\fB);\fP -\fI\fB - \fBvoid png_free_chunk_list (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_free_default(png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fIptr\fP\fB);\fP -\fI\fB - \fBvoid png_free_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fInum\fP\fB);\fP -\fI\fB - \fBpng_byte png_get_bit_depth (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fI*background\fP\fB);\fP -\fI\fB - \fBpng_byte png_get_channels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fI*white_x\fP\fB, double \fP\fI*white_y\fP\fB, double \fP\fI*red_x\fP\fB, double \fP\fI*red_y\fP\fB, double \fP\fI*green_x\fP\fB, double \fP\fI*green_y\fP\fB, double \fP\fI*blue_x\fP\fB, double \fI*blue_y\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*white_x\fP\fB, png_uint_32 \fP\fI*white_y\fP\fB, png_uint_32 \fP\fI*red_x\fP\fB, png_uint_32 \fP\fI*red_y\fP\fB, png_uint_32 \fP\fI*green_x\fP\fB, png_uint_32 \fP\fI*green_y\fP\fB, png_uint_32 \fP\fI*blue_x\fP\fB, png_uint_32 \fI*blue_y\fP\fB);\fP -\fI\fB - \fBpng_byte png_get_color_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_byte png_get_compression_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_byte png_get_copyright (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBpng_voidp png_get_error_ptr (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBpng_byte png_get_filter_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fI*file_gamma\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fI*int_file_gamma\fP\fB);\fP -\fI\fB - \fBpng_byte png_get_header_ver (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBpng_byte png_get_header_version (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fI*hist\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charpp \fP\fIname\fP\fB, int \fP\fI*compression_type\fP\fB, png_charpp \fP\fIprofile\fP\fB, png_uint_32 \fI*proflen\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*width\fP\fB, png_uint_32 \fP\fI*height\fP\fB, int \fP\fI*bit_depth\fP\fB, int \fP\fI*color_type\fP\fB, int \fP\fI*interlace_type\fP\fB, int \fP\fI*compression_type\fP\fB, int \fI*filter_type\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_image_height (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_image_width (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB +\fB#if !defined(PNG_1_0_X) png_int_32 png_get_int_32 (png_bytep buf); \fI#endif \fBpng_byte png_get_interlace_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_voidp png_get_io_ptr (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBpng_byte png_get_libpng_ver (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBpng_voidp png_get_mem_ptr(png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*offset_x\fP\fB, png_uint_32 \fP\fI*offset_y\fP\fB, int \fI*unit_type\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fI*purpose\fP\fB, png_int_32 \fP\fI*X0\fP\fB, png_int_32 \fP\fI*X1\fP\fB, int \fP\fI*type\fP\fB, int \fP\fI*nparams\fP\fB, png_charp \fP\fI*units\fP\fB, png_charpp \fI*params\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*res_x\fP\fB, png_uint_32 \fP\fI*res_y\fP\fB, int \fI*unit_type\fP\fB);\fP -\fI\fB - \fBfloat png_get_pixel_aspect_ratio (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_voidp png_get_progressive_ptr (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_colorp \fP\fI*palette\fP\fB, int \fI*num_palette\fP\fB);\fP -\fI\fB - -\fBpng_byte png_get_rgb_to_gray_status (png_structp \fIpng_ptr) - -\fBpng_uint_32 png_get_rowbytes (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP - -\fI\fB +\fBpng_byte png_get_rgb_to_gray_status (png_structp png_ptr) png_uint_32 png_get_rowbytes (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP \fBpng_bytepp png_get_rows (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fI*sig_bit\fP\fB);\fP -\fI\fB - \fBpng_bytep png_get_signature (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fI*splt_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fI*intent\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_text (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fI*text_ptr\fP\fB, int \fI*num_text\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fI*mod_time\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fI*trans\fP\fB, int \fP\fI*num_trans\fP\fB, png_color_16p \fI*trans_values\fP\fB);\fP -\fI\fB +\fB#if !defined(PNG_1_0_X) png_uint_16 png_get_uint_16 (png_bytep \fIbuf\fP\fB);\fP -\fBpng_uint_32 png_get_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_unknown_chunkpp \fIunknowns\fP\fB);\fP +\fBpng_uint_32 png_get_uint_31 (png_bytep \fIbuf\fP\fB);\fP -\fI\fB +\fBpng_uint_32 png_get_uint_32 (png_bytep buf); \fI#endif -\fBpng_voidp png_get_user_chunk_ptr (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_unknown_chunkpp \fIunknowns\fP\fB);\fP -\fI\fB +\fBpng_voidp png_get_user_chunk_ptr (png_structp \fIpng_ptr\fP\fB);\fP \fBpng_uint_32 png_get_user_height_max( png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBpng_voidp png_get_user_transform_ptr (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_user_width_max (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_valid (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIflag\fP\fB);\fP -\fI\fB - \fBpng_int_32 png_get_x_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_int_32 png_get_x_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_x_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_int_32 png_get_y_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_int_32 png_get_y_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_y_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_get_compression_buffer_size (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBint png_handle_as_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP -\fI\fB - \fBvoid png_init_io (png_structp \fP\fIpng_ptr\fP\fB, FILE \fI*fp\fP\fB);\fP -\fI\fB - \fBDEPRECATED: void png_info_init (png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBDEPRECATED: void png_info_init_2 (png_infopp \fP\fIptr_ptr\fP\fB, png_size_t \fIpng_info_struct_size\fP\fB);\fP -\fI\fB - \fBpng_voidp png_malloc (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP -\fI\fB - \fBpng_voidp png_malloc_default(png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP -\fI\fB - \fBvoidp png_memcpy (png_voidp \fP\fIs1\fP\fB, png_voidp \fP\fIs2\fP\fB, png_size_t \fIsize\fP\fB);\fP -\fI\fB - \fBpng_voidp png_memcpy_check (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIs1\fP\fB, png_voidp \fP\fIs2\fP\fB, png_uint_32 \fIsize\fP\fB);\fP -\fI\fB - \fBvoidp png_memset (png_voidp \fP\fIs1\fP\fB, int \fP\fIvalue\fP\fB, png_size_t \fIsize\fP\fB);\fP -\fI\fB - \fBpng_voidp png_memset_check (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIs1\fP\fB, int \fP\fIvalue\fP\fB, png_uint_32 \fIsize\fP\fB);\fP -\fI\fB - \fBDEPRECATED: void png_permit_empty_plte (png_structp \fP\fIpng_ptr\fP\fB, int \fIempty_plte_permitted\fP\fB);\fP -\fI\fB - \fBvoid png_process_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_size\fP\fB);\fP -\fI\fB - \fBvoid png_progressive_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIold_row\fP\fB, png_bytep \fInew_row\fP\fB);\fP -\fI\fB - \fBvoid png_read_destroy (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_infop \fIend_info_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_read_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_read_image (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fIimage\fP\fB);\fP -\fI\fB - \fBDEPRECATED: void png_read_init (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBDEPRECATED: void png_read_init_2 (png_structpp \fP\fIptr_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP -\fI\fB - \fBvoid png_read_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_read_png (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fItransforms\fP\fB, png_voidp \fIparams\fP\fB);\fP -\fI\fB - \fBvoid png_read_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fIdisplay_row\fP\fB);\fP -\fI\fB - \fBvoid png_read_rows (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fP\fIrow\fP\fB, png_bytepp \fP\fIdisplay_row\fP\fB, png_uint_32 \fInum_rows\fP\fB);\fP -\fI\fB - \fBvoid png_read_update_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - -\fB#if \fI!defined(PNG_1_0_X) +\fB#if !defined(PNG_1_0_X) png_save_int_32 (png_bytep \fP\fIbuf\fP\fB, png_int_32 \fIi\fP\fB);\fP -\fBvoid png_set_add_alpha (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP +\fBvoid png_save_uint_16 (png_bytep \fP\fIbuf\fP\fB, unsigned int \fIi\fP\fB);\fP -\fI\fB#endif +\fBvoid png_save_uint_32 (png_bytep \fP\fIbuf\fP\fB, png_uint_32 \fIi\fP\fB);\fP -\fI\fB +\fBvoid png_set_add_alpha (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int flags); \fI#endif \fBvoid png_set_background (png_structp \fP\fIpng_ptr\fP\fB, png_color_16p \fP\fIbackground_color\fP\fB, int \fP\fIbackground_gamma_code\fP\fB, int \fP\fIneed_expand\fP\fB, double \fIbackground_gamma\fP\fB);\fP -\fI\fB - \fBvoid png_set_bgr (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_set_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fIbackground\fP\fB);\fP -\fI\fB - \fBvoid png_set_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP -\fI\fB - \fBvoid png_set_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIwhite_x\fP\fB, png_uint_32 \fP\fIwhite_y\fP\fB, png_uint_32 \fP\fIred_x\fP\fB, png_uint_32 \fP\fIred_y\fP\fB, png_uint_32 \fP\fIgreen_x\fP\fB, png_uint_32 \fP\fIgreen_y\fP\fB, png_uint_32 \fP\fIblue_x\fP\fB, png_uint_32 \fIblue_y\fP\fB);\fP -\fI\fB - \fBvoid png_set_compression_level (png_structp \fP\fIpng_ptr\fP\fB, int \fIlevel\fP\fB);\fP -\fI\fB - \fBvoid png_set_compression_mem_level (png_structp \fP\fIpng_ptr\fP\fB, int \fImem_level\fP\fB);\fP -\fI\fB - \fBvoid png_set_compression_method (png_structp \fP\fIpng_ptr\fP\fB, int \fImethod\fP\fB);\fP -\fI\fB - \fBvoid png_set_compression_strategy (png_structp \fP\fIpng_ptr\fP\fB, int \fIstrategy\fP\fB);\fP -\fI\fB - \fBvoid png_set_compression_window_bits (png_structp \fP\fIpng_ptr\fP\fB, int \fIwindow_bits\fP\fB);\fP -\fI\fB - \fBvoid png_set_crc_action (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcrit_action\fP\fB, int \fIancil_action\fP\fB);\fP -\fI\fB - \fBvoid png_set_dither (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fP\fInum_palette\fP\fB, int \fP\fImaximum_colors\fP\fB, png_uint_16p \fP\fIhistogram\fP\fB, int \fIfull_dither\fP\fB);\fP -\fI\fB - \fBvoid png_set_error_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fIwarning_fn\fP\fB);\fP -\fI\fB - \fBvoid png_set_expand (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB +\fBvoid png_set_expand_gray_1_2_4_to_8(png_structp \fIpng_ptr\fP\fB);\fP \fBvoid png_set_filler (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP -\fI\fB - \fBvoid png_set_filter (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fImethod\fP\fB, int \fIfilters\fP\fB);\fP -\fI\fB - \fBvoid png_set_filter_heuristics (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIheuristic_method\fP\fB, int \fP\fInum_weights\fP\fB, png_doublep \fP\fIfilter_weights\fP\fB, png_doublep \fIfilter_costs\fP\fB);\fP -\fI\fB - \fBvoid png_set_flush (png_structp \fP\fIpng_ptr\fP\fB, int \fInrows\fP\fB);\fP -\fI\fB - \fBvoid png_set_gamma (png_structp \fP\fIpng_ptr\fP\fB, double \fP\fIscreen_gamma\fP\fB, double \fIdefault_file_gamma\fP\fB);\fP -\fI\fB - \fBvoid png_set_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP -\fI\fB - \fBvoid png_set_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIfile_gamma\fP\fB);\fP -\fI\fB - \fBvoid png_set_gray_1_2_4_to_8(png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_set_gray_to_rgb (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_set_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fIhist\fP\fB);\fP -\fI\fB - \fBvoid png_set_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_charp \fP\fIprofile\fP\fB, png_uint_32 \fIproflen\fP\fB);\fP -\fI\fB - \fBint png_set_interlace_handling (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_set_invalid (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fImask\fP\fB);\fP -\fI\fB - \fBvoid png_set_invert_alpha (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_set_invert_mono (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_set_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIinterlace_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fIfilter_type\fP\fB);\fP -\fI\fB - \fBvoid png_set_keep_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIkeep\fP\fB, png_bytep \fP\fIchunk_list\fP\fB, int \fInum_chunks\fP\fB);\fP -\fI\fB - \fBvoid png_set_mem_fn(png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP -\fI\fB - \fBvoid png_set_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIoffset_x\fP\fB, png_uint_32 \fP\fIoffset_y\fP\fB, int \fIunit_type\fP\fB);\fP -\fI\fB - \fBvoid png_set_packing (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_set_packswap (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_set_palette_to_rgb(png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_set_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fIpurpose\fP\fB, png_int_32 \fP\fIX0\fP\fB, png_int_32 \fP\fIX1\fP\fB, int \fP\fItype\fP\fB, int \fP\fInparams\fP\fB, png_charp \fP\fIunits\fP\fB, png_charpp \fIparams\fP\fB);\fP -\fI\fB - \fBvoid png_set_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIres_x\fP\fB, png_uint_32 \fP\fIres_y\fP\fB, int \fIunit_type\fP\fB);\fP -\fI\fB - \fBvoid png_set_progressive_read_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIprogressive_ptr\fP\fB, png_progressive_info_ptr \fP\fIinfo_fn\fP\fB, png_progressive_row_ptr \fP\fIrow_fn\fP\fB, png_progressive_end_ptr \fIend_fn\fP\fB);\fP -\fI\fB - \fBvoid png_set_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fInum_palette\fP\fB);\fP -\fI\fB - \fBvoid png_set_read_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIio_ptr\fP\fB, png_rw_ptr \fIread_data_fn\fP\fB);\fP -\fI\fB - \fBvoid png_set_read_status_fn (png_structp \fP\fIpng_ptr\fP\fB, png_read_status_ptr \fIread_row_fn\fP\fB);\fP -\fI\fB - \fBvoid png_set_read_user_transform_fn (png_structp \fP\fIpng_ptr\fP\fB, png_user_transform_ptr \fIread_user_transform_fn\fP\fB);\fP -\fI\fB - \fBvoid png_set_rgb_to_gray (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIerror_action\fP\fB, double \fP\fIred\fP\fB, double \fIgreen\fP\fB);\fP -\fI\fB - \fBvoid png_set_rgb_to_gray_fixed (png_structp \fP\fIpng_ptr\fP\fB, int error_action png_fixed_point \fP\fIred\fP\fB, png_fixed_point \fIgreen\fP\fB);\fP -\fI\fB - \fBvoid png_set_rows (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytepp \fIrow_pointers\fP\fB);\fP -\fI\fB - \fBvoid png_set_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fIsig_bit\fP\fB);\fP -\fI\fB - \fBvoid png_set_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP -\fI\fB - \fBvoid png_set_shift (png_structp \fP\fIpng_ptr\fP\fB, png_color_8p \fItrue_bits\fP\fB);\fP -\fI\fB - \fBvoid png_set_sig_bytes (png_structp \fP\fIpng_ptr\fP\fB, int \fInum_bytes\fP\fB);\fP -\fI\fB - \fBvoid png_set_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fP\fIsplt_ptr\fP\fB, int \fInum_spalettes\fP\fB);\fP -\fI\fB - \fBvoid png_set_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fIintent\fP\fB);\fP -\fI\fB - \fBvoid png_set_sRGB_gAMA_and_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fIintent\fP\fB);\fP -\fI\fB - \fBvoid png_set_strip_16 (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_set_strip_alpha (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_set_swap (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_set_swap_alpha (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_set_text (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fItext_ptr\fP\fB, int \fInum_text\fP\fB);\fP -\fI\fB - \fBvoid png_set_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP -\fI\fB - \fBvoid png_set_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fItrans\fP\fB, int \fP\fInum_trans\fP\fB, png_color_16p \fItrans_values\fP\fB);\fP -\fI\fB - \fBvoid png_set_tRNS_to_alpha(png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBpng_uint_32 png_set_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_unknown_chunkp \fP\fIunknowns\fP\fB, int \fP\fInum\fP\fB, int \fIlocation\fP\fB);\fP -\fI\fB - \fBvoid png_set_unknown_chunk_location(png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIchunk\fP\fB, int \fIlocation\fP\fB);\fP -\fI\fB - \fBvoid png_set_read_user_chunk_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIuser_chunk_ptr\fP\fB, png_user_chunk_ptr \fIread_user_chunk_fn\fP\fB);\fP -\fI\fB - \fBvoid png_set_user_limits (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIuser_width_max\fP\fB, png_uint_32 \fIuser_height_max\fP\fB);\fP -\fI\fB - \fBvoid png_set_user_transform_info (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIuser_transform_ptr\fP\fB, int \fP\fIuser_transform_depth\fP\fB, int \fIuser_transform_channels\fP\fB);\fP -\fI\fB - \fBvoid png_set_write_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIio_ptr\fP\fB, png_rw_ptr \fP\fIwrite_data_fn\fP\fB, png_flush_ptr \fIoutput_flush_fn\fP\fB);\fP -\fI\fB - \fBvoid png_set_write_status_fn (png_structp \fP\fIpng_ptr\fP\fB, png_write_status_ptr \fIwrite_row_fn\fP\fB);\fP -\fI\fB - \fBvoid png_set_write_user_transform_fn (png_structp \fP\fIpng_ptr\fP\fB, png_user_transform_ptr \fIwrite_user_transform_fn\fP\fB);\fP -\fI\fB - \fBvoid png_set_compression_buffer_size(png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP -\fI\fB - \fBint png_sig_cmp (png_bytep \fP\fIsig\fP\fB, png_size_t \fP\fIstart\fP\fB, png_size_t \fInum_to_check\fP\fB);\fP -\fI\fB - \fBvoid png_start_read_image (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_warning (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fImessage\fP\fB);\fP -\fI\fB - \fBvoid png_write_chunk (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIchunk_name\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP -\fI\fB - \fBvoid png_write_chunk_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP -\fI\fB - \fBvoid png_write_chunk_end (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_write_chunk_start (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIchunk_name\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB - \fBvoid png_write_destroy (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_write_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_write_flush (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_write_image (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fIimage\fP\fB);\fP -\fI\fB - \fBDEPRECATED: void png_write_init (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - \fBDEPRECATED: void png_write_init_2 (png_structpp \fP\fIptr_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP -\fI\fB - \fBvoid png_write_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_write_info_before_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB - \fBvoid png_write_png (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fItransforms\fP\fB, png_voidp \fIparams\fP\fB);\fP -\fI\fB - \fBvoid png_write_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fI\fB - \fBvoid png_write_rows (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fP\fIrow\fP\fB, png_uint_32 \fInum_rows\fP\fB);\fP -\fI\fB - \fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP -\fI\fB - \fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP -\fI\fB - .SH DESCRIPTION The .I libpng @@ -781,10 +410,10 @@ Following is a copy of the libpng.txt file that accompanies libpng. .SH LIBPNG.TXT libpng.txt - A description on how to use and modify libpng - libpng version 1.2.8 - December 3, 2004 + libpng version 1.2.14 - November 27, 2006 Updated and distributed by Glenn Randers-Pehrson <glennrp at users.sourceforge.net> - Copyright (c) 1998-2004 Glenn Randers-Pehrson + Copyright (c) 1998-2005 Glenn Randers-Pehrson For conditions of distribution and use, see copyright notice in png.h. @@ -1173,7 +802,7 @@ dithering, and setting filler.) If this is the case, simply do this: png_read_png(png_ptr, info_ptr, png_transforms, NULL) -where png_transforms is an integer containing the logical OR of +where png_transforms is an integer containing the bitwise OR of some set of transformation flags. This call is equivalent to png_read_info(), followed the set of transformations indicated by the transform mask, then png_read_image(), and finally png_read_end(). @@ -1568,7 +1197,7 @@ viewing application that wishes to treat all images in the same way. png_set_palette_to_rgb(png_ptr); if (color_type == PNG_COLOR_TYPE_GRAY && - bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr); + bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr); if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); @@ -1578,6 +1207,11 @@ in libpng version 1.0.4, with the function names expanded to improve code readability. In some future version they may actually do different things. +As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was +added. It expands the sample depth without changing tRNS to alpha. +At the same time, png_set_gray_1_2_4_to_8() was deprecated, and it +will be removed from a future version. + PNG can have files with 16 bits per channel. If you only can handle 8 bits per channel, this will strip the pixels down to 8 bit. @@ -2029,8 +1663,8 @@ the second parameter NULL. .SS Finishing a sequential read -After you are finished reading the image through either the high- or -low-level interfaces, you can finish reading the file. If you are +After you are finished reading the image through the +low-level interface, you can finish reading the file. If you are interested in comments or time, which may be stored either before or after the image data, you should pass the separate png_info struct if you want to keep the comments from before and after the image @@ -2048,7 +1682,7 @@ point to libpng-allocated storage with the following function: png_free_data(png_ptr, info_ptr, mask, seq) mask - identifies data to be freed, a mask - containing the logical OR of one or + containing the bitwise OR of one or more of PNG_FREE_PLTE, PNG_FREE_TRNS, PNG_FREE_HIST, PNG_FREE_ICCP, @@ -2110,7 +1744,7 @@ application instead of by libpng, you can use png_set_invalid(png_ptr, info_ptr, mask); mask - identifies the chunks to be made invalid, - containing the logical OR of one or + containing the bitwise OR of one or more of PNG_INFO_gAMA, PNG_INFO_sBIT, PNG_INFO_cHRM, PNG_INFO_PLTE, @@ -2377,6 +2011,14 @@ Libpng section below. png_init_io(png_ptr, fp); +If you are embedding your PNG into a datastream such as MNG, and don't +want libpng to write the 8-byte signature, or if you have already +written the signature in your application, use + + png_set_sig_bytes(png_ptr, 8); + +to inform libpng that it should not write a signature. + .SS Write callbacks At this point, you can set up a callback function that will be @@ -2414,7 +2056,7 @@ types. /* turn on or off filtering, and/or choose specific filters. You can use either a single - PNG_FILTER_VALUE_NAME or the logical OR of one + PNG_FILTER_VALUE_NAME or the bitwise OR of one or more PNG_FILTER_NAME masks. */ png_set_filter(png_ptr, 0, PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE | @@ -2787,7 +2429,7 @@ png_set_rows() to put image data in the info structure), simply do this: png_write_png(png_ptr, info_ptr, png_transforms, NULL) -where png_transforms is an integer containing the logical OR of some set of +where png_transforms is an integer containing the bitwise OR of some set of transformation flags. This call is equivalent to png_write_info(), followed the set of transformations indicated by the transform mask, then png_write_image(), and finally png_write_end(). @@ -3047,7 +2689,7 @@ point to libpng-allocated storage with the following function: png_free_data(png_ptr, info_ptr, mask, seq) mask - identifies data to be freed, a mask - containing the logical OR of one or + containing the bitwise OR of one or more of PNG_FREE_PLTE, PNG_FREE_TRNS, PNG_FREE_HIST, PNG_FREE_ICCP, @@ -3240,7 +2882,7 @@ to use the "cexcept" facility (see http://cexcept.sourceforge.net). If you need to read or write custom chunks, you may need to get deeper into the libpng code. The library now has mechanisms for storing and writing chunks of unknown type; you can even declare callbacks -for custom chunks. Hoewver, this may not be good enough if the +for custom chunks. However, this may not be good enough if the library code itself needs to know about interactions between your chunk and existing `intrinsic' chunks. @@ -3591,7 +3233,7 @@ defined: #if defined(PNG_USE_PNGGCCRD) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) \ && defined(PNG_THREAD_UNSAFE_OK) /* Disable thread-unsafe features of pnggccrd */ - if (png_access_version() >= 10200) + if (png_access_version_number() >= 10200) { png_uint_32 mmx_disable_mask = 0; png_uint_32 asm_flags; @@ -3617,12 +3259,12 @@ Libpng can support some of these extensions. To enable them, use the png_permit_mng_features() function: feature_set = png_permit_mng_features(png_ptr, mask) - mask is a png_uint_32 containing the logical OR of the + mask is a png_uint_32 containing the bitwise OR of the features you want to enable. These include PNG_FLAG_MNG_EMPTY_PLTE PNG_FLAG_MNG_FILTER_64 PNG_ALL_MNG_FEATURES - feature_set is a png_uint_32 that is the logical AND of + feature_set is a png_uint_32 that is the bitwise AND of your mask with the set of MNG features that is supported by the version of libpng that you are using. @@ -3685,13 +3327,13 @@ application: .SH IX. Y2K Compliance in libpng -December 3, 2004 +November 27, 2006 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.2.8 are Y2K compliant. It is my belief that earlier +upward through 1.2.14 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. Libpng only has three year fields. One is a 2-byte unsigned integer that @@ -3835,15 +3477,35 @@ the first widely used release: 1.0.16 10 10016 10.so.0.1.0.16 1.2.6 13 10206 12.so.0.1.2.6 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2 - 1.0.17rc1 10 10017 12.so.0.1.0.17rc1 + 1.0.17rc1 10 10017 10.so.0.1.0.17rc1 1.2.7rc1 13 10207 12.so.0.1.2.7rc1 - 1.0.17 10 10017 12.so.0.1.0.17 + 1.0.17 10 10017 10.so.0.1.0.17 1.2.7 13 10207 12.so.0.1.2.7 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5 - 1.0.18rc1-5 10 10018 12.so.0.1.0.18rc1-5 + 1.0.18rc1-5 10 10018 10.so.0.1.0.18rc1-5 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5 - 1.0.18 10 10018 12.so.0.1.0.18 + 1.0.18 10 10018 10.so.0.1.0.18 1.2.8 13 10208 12.so.0.1.2.8 + 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3 + 1.2.9beta4-11 13 10209 12.so.0.9[.0] + 1.2.9rc1 13 10209 12.so.0.9[.0] + 1.2.9 13 10209 12.so.0.9[.0] + 1.2.10beta1-8 13 10210 12.so.0.10[.0] + 1.2.10rc1-3 13 10210 12.so.0.10[.0] + 1.2.10 13 10210 12.so.0.10[.0] + 1.2.11beta1-4 13 10211 12.so.0.11[.0] + 1.0.19rc1-5 10 10019 10.so.0.19[.0] + 1.2.11rc1-5 13 10211 12.so.0.11[.0] + 1.0.19 10 10019 10.so.0.19[.0] + 1.2.11 13 10211 12.so.0.11[.0] + 1.0.20 10 10020 10.so.0.20[.0] + 1.2.12 13 10212 12.so.0.12[.0] + 1.2.13beta1 13 10213 12.so.0.13[.0] + 1.0.21 10 10021 10.so.0.21[.0] + 1.2.13 13 10213 12.so.0.13[.0] + 1.2.14beta1-2 13 10214 12.so.0.14[.0] + 1.0.22rc1 10 10022 10.so.0.22[.0] + 1.2.14rc1 13 10214 12.so.0.14[.0] Henceforth the source version will match the shared-library minor and patch numbers; the shared-library major version number will be @@ -3899,14 +3561,17 @@ possible without all of you. Thanks to Frank J. T. Wojcik for helping with the documentation. -Libpng version 1.2.8 - December 3, 2004: +Libpng version 1.2.14 - November 27, 2006: Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). Supported by the PNG development group .br -png-implement at ccrc.wustl.edu (subscription required; write to -majordomo at ccrc.wustl.edu with "subscribe png-implement" in the message). +png-mng-implement at lists.sf.net +(subscription required; visit +png-mng-implement at lists.sourceforge.net (subscription required; visit +https://lists.sourceforge.net/lists/listinfo/png-mng-implement +to subscribe). .SH COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: @@ -3917,8 +3582,8 @@ included in the libpng distribution, the latter shall prevail.) If you modify libpng you may insert additional notices immediately following this sentence. -libpng version 1.2.6, December 3, 2004, is -Copyright (c) 2004 Glenn Randers-Pehrson, and is +libpng versions 1.2.6, August 15, 2004, through 1.2.14, November 27, 2006, are +Copyright (c) 2004-2006 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 @@ -4016,7 +3681,7 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -December 3, 2004 +November 27, 2006 .\" end of man page diff --git a/Build/source/libs/libpng/libpng.txt b/Build/source/libs/libpng/libpng.txt index 9360f33b375..67c06537e04 100644 --- a/Build/source/libs/libpng/libpng.txt +++ b/Build/source/libs/libpng/libpng.txt @@ -1,9 +1,9 @@ libpng.txt - A description on how to use and modify libpng - libpng version 1.2.8 - December 3, 2004 + libpng version 1.2.14 - November 27, 2006 Updated and distributed by Glenn Randers-Pehrson <glennrp at users.sourceforge.net> - Copyright (c) 1998-2004 Glenn Randers-Pehrson + Copyright (c) 1998-2005 Glenn Randers-Pehrson For conditions of distribution and use, see copyright notice in png.h. @@ -392,7 +392,7 @@ dithering, and setting filler.) If this is the case, simply do this: png_read_png(png_ptr, info_ptr, png_transforms, NULL) -where png_transforms is an integer containing the logical OR of +where png_transforms is an integer containing the bitwise OR of some set of transformation flags. This call is equivalent to png_read_info(), followed the set of transformations indicated by the transform mask, then png_read_image(), and finally png_read_end(). @@ -787,7 +787,7 @@ viewing application that wishes to treat all images in the same way. png_set_palette_to_rgb(png_ptr); if (color_type == PNG_COLOR_TYPE_GRAY && - bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr); + bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr); if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); @@ -797,6 +797,11 @@ in libpng version 1.0.4, with the function names expanded to improve code readability. In some future version they may actually do different things. +As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was +added. It expands the sample depth without changing tRNS to alpha. +At the same time, png_set_gray_1_2_4_to_8() was deprecated, and it +will be removed from a future version. + PNG can have files with 16 bits per channel. If you only can handle 8 bits per channel, this will strip the pixels down to 8 bit. @@ -1248,8 +1253,8 @@ the second parameter NULL. Finishing a sequential read -After you are finished reading the image through either the high- or -low-level interfaces, you can finish reading the file. If you are +After you are finished reading the image through the +low-level interface, you can finish reading the file. If you are interested in comments or time, which may be stored either before or after the image data, you should pass the separate png_info struct if you want to keep the comments from before and after the image @@ -1267,7 +1272,7 @@ point to libpng-allocated storage with the following function: png_free_data(png_ptr, info_ptr, mask, seq) mask - identifies data to be freed, a mask - containing the logical OR of one or + containing the bitwise OR of one or more of PNG_FREE_PLTE, PNG_FREE_TRNS, PNG_FREE_HIST, PNG_FREE_ICCP, @@ -1329,7 +1334,7 @@ application instead of by libpng, you can use png_set_invalid(png_ptr, info_ptr, mask); mask - identifies the chunks to be made invalid, - containing the logical OR of one or + containing the bitwise OR of one or more of PNG_INFO_gAMA, PNG_INFO_sBIT, PNG_INFO_cHRM, PNG_INFO_PLTE, @@ -1596,6 +1601,14 @@ Libpng section below. png_init_io(png_ptr, fp); +If you are embedding your PNG into a datastream such as MNG, and don't +want libpng to write the 8-byte signature, or if you have already +written the signature in your application, use + + png_set_sig_bytes(png_ptr, 8); + +to inform libpng that it should not write a signature. + Write callbacks At this point, you can set up a callback function that will be @@ -1633,7 +1646,7 @@ types. /* turn on or off filtering, and/or choose specific filters. You can use either a single - PNG_FILTER_VALUE_NAME or the logical OR of one + PNG_FILTER_VALUE_NAME or the bitwise OR of one or more PNG_FILTER_NAME masks. */ png_set_filter(png_ptr, 0, PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE | @@ -2006,7 +2019,7 @@ png_set_rows() to put image data in the info structure), simply do this: png_write_png(png_ptr, info_ptr, png_transforms, NULL) -where png_transforms is an integer containing the logical OR of some set of +where png_transforms is an integer containing the bitwise OR of some set of transformation flags. This call is equivalent to png_write_info(), followed the set of transformations indicated by the transform mask, then png_write_image(), and finally png_write_end(). @@ -2266,7 +2279,7 @@ point to libpng-allocated storage with the following function: png_free_data(png_ptr, info_ptr, mask, seq) mask - identifies data to be freed, a mask - containing the logical OR of one or + containing the bitwise OR of one or more of PNG_FREE_PLTE, PNG_FREE_TRNS, PNG_FREE_HIST, PNG_FREE_ICCP, @@ -2459,7 +2472,7 @@ Custom chunks If you need to read or write custom chunks, you may need to get deeper into the libpng code. The library now has mechanisms for storing and writing chunks of unknown type; you can even declare callbacks -for custom chunks. Hoewver, this may not be good enough if the +for custom chunks. However, this may not be good enough if the library code itself needs to know about interactions between your chunk and existing `intrinsic' chunks. @@ -2810,7 +2823,7 @@ defined: #if defined(PNG_USE_PNGGCCRD) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) \ && defined(PNG_THREAD_UNSAFE_OK) /* Disable thread-unsafe features of pnggccrd */ - if (png_access_version() >= 10200) + if (png_access_version_number() >= 10200) { png_uint_32 mmx_disable_mask = 0; png_uint_32 asm_flags; @@ -2836,12 +2849,12 @@ Libpng can support some of these extensions. To enable them, use the png_permit_mng_features() function: feature_set = png_permit_mng_features(png_ptr, mask) - mask is a png_uint_32 containing the logical OR of the + mask is a png_uint_32 containing the bitwise OR of the features you want to enable. These include PNG_FLAG_MNG_EMPTY_PLTE PNG_FLAG_MNG_FILTER_64 PNG_ALL_MNG_FEATURES - feature_set is a png_uint_32 that is the logical AND of + feature_set is a png_uint_32 that is the bitwise AND of your mask with the set of MNG features that is supported by the version of libpng that you are using. @@ -2904,13 +2917,13 @@ application: IX. Y2K Compliance in libpng -December 3, 2004 +November 27, 2006 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.2.8 are Y2K compliant. It is my belief that earlier +upward through 1.2.14 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. Libpng only has three year fields. One is a 2-byte unsigned integer that diff --git a/Build/source/libs/libpng/libpngpf.3 b/Build/source/libs/libpng/libpngpf.3 index d196d70c477..f98aeb8c5dd 100644 --- a/Build/source/libs/libpng/libpngpf.3 +++ b/Build/source/libs/libpng/libpngpf.3 @@ -1,1085 +1,263 @@ -.TH LIBPNGPF 3 "December 3, 2004" +.TH LIBPNGPF 3 "November 27, 2006" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.2.8 +libpng \- Portable Network Graphics (PNG) Reference Library 1.2.14 (private functions) .SH SYNOPSIS -\fB\fB#include <png.h>\fP\fP +\fB#include <png.h>\fP -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_build_gamma_table (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_build_grayscale_palette (int \fP\fI\fP\fIbit_depth\fP\fB\fP\fB, png_colorp \fI\fIpalette\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_calculate_crc (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIptr\fP\fB\fP\fB, png_size_t \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_check_chunk_name (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_bytep \fI\fIchunk_name\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBpng_size_t png_check_keyword (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_charp \fP\fI\fP\fIkey\fP\fB\fP\fB, png_charpp \fI\fInew_key\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_combine_row (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, int \fI\fImask\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_correct_palette (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_colorp \fP\fI\fP\fIpalette\fP\fB\fP\fB, int \fI\fInum_palette\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBint png_crc_error (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBint png_crc_finish (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIskip\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_crc_read (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIbuf\fP\fB\fP\fB, png_size_t \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBpng_voidp png_create_struct (int \fI\fItype\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBpng_voidp png_create_struct_2 (int \fP\fI\fP\fItype\fP\fB\fP\fB, png_malloc_ptr \fP\fI\fP\fImalloc_fn\fP\fB\fP\fB, png_voidp \fI\fImem_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBpng_charp png_decompress_chunk (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, int \fP\fI\fP\fIcomp_type\fP\fB\fP\fB, png_charp \fP\fI\fP\fIchunkdata\fP\fB\fP\fB, png_size_t \fP\fI\fP\fIchunklength\fP\fB\fP\fB, png_size_t \fP\fI\fP\fIprefix_length\fP\fB\fP\fB, png_size_t \fI\fI*data_length\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_destroy_struct (png_voidp \fI\fIstruct_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_destroy_struct_2 (png_voidp \fP\fI\fP\fIstruct_ptr\fP\fB\fP\fB, png_free_ptr \fP\fI\fP\fIfree_fn\fP\fB\fP\fB, png_voidp \fI\fImem_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_background (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, png_color_16p \fP\fI\fP\fItrans_values\fP\fB\fP\fB, png_color_16p \fP\fI\fP\fIbackground\fP\fB\fP\fB, png_color_16p \fP\fI\fP\fIbackground_1\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIgamma_table\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIgamma_from_1\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIgamma_to_1\fP\fB\fP\fB, png_uint_16pp \fP\fI\fP\fIgamma_16\fP\fB\fP\fB, png_uint_16pp \fP\fI\fP\fIgamma_16_from_1\fP\fB\fP\fB, png_uint_16pp \fP\fI\fP\fIgamma_16_to_1\fP\fB\fP\fB, int \fI\fIgamma_shift\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_bgr (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fI\fIrow\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_chop (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fI\fIrow\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_dither (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIpalette_lookup\fP\fB\fP\fB, png_bytep \fI\fIdither_lookup\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_expand (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, png_color_16p \fI\fItrans_value\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_expand_palette (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, png_colorp \fP\fI\fP\fIpalette\fP\fB\fP\fB, png_bytep \fP\fI\fP\fItrans\fP\fB\fP\fB, int \fI\fInum_trans\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_gamma (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIgamma_table\fP\fB\fP\fB, png_uint_16pp \fP\fI\fP\fIgamma_16_table\fP\fB\fP\fB, int \fI\fIgamma_shift\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_gray_to_rgb (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fI\fIrow\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_invert (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fI\fIrow\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_pack (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, png_uint_32 \fI\fIbit_depth\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_packswap (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fI\fIrow\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_read_filler (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIfiller\fP\fB\fP\fB, png_uint_32 \fI\fIflags\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_read_interlace (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, int \fP\fI\fP\fIpass\fP\fB\fP\fB, png_uint_32 \fI\fItransformations\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_read_invert_alpha (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fI\fIrow\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_read_swap_alpha (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fI\fIrow\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_read_transformations (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBint png_do_rgb_to_gray (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fI\fIrow\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_shift (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, png_color_8p \fI\fIbit_depth\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_strip_filler (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, png_uint_32 \fI\fIflags\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_swap (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fI\fIrow\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_unpack (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fI\fIrow\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_unshift (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, png_color_8p \fI\fIsig_bits\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_write_interlace (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, int \fI\fIpass\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_write_invert_alpha (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fI\fIrow\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_write_swap_alpha (png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fI\fIrow\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_do_write_transformations (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid *png_far_to_near (png_structp png_ptr,png_voidp \fP\fI\fP\fIptr\fP\fB\fP\fB, int \fI\fIcheck\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_flush (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBpng_int_32 png_get_int_32 (png_bytep \fI\fIbuf\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBpng_uint_16 png_get_uint_16 (png_bytep \fI\fIbuf\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBpng_uint_32 png_get_uint_31 (png_bytep \fI\fIbuf\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBpng_uint_32 png_get_uint_32 (png_bytep \fI\fIbuf\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_bKGD (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_cHRM (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_gAMA (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_hIST (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_IEND (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_IHDR (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_iCCP (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_iTXt (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_oFFs (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB +\fBvoid png_build_gamma_table (png_structp \fIpng_ptr\fP\fB);\fP -\fB\fBvoid png_handle_pCAL (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP +\fBvoid png_build_grayscale_palette (int \fP\fIbit_depth\fP\fB, png_colorp \fIpalette\fP\fB);\fP -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_pHYs (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_PLTE (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_sBIT (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_sCAL (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_sPLT (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_sRGB (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_tEXt (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_tIME (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_tRNS (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_unknown (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_handle_zTXt (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_info_destroy (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fI\fIinfo_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_init_mmx_flags (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_init_read_transformations (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_process_IDAT_data (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIbuffer\fP\fB\fP\fB, png_size_t \fI\fIbuffer_length\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_process_some_data (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fI\fIinfo_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_check_crc (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_crc_finish (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_crc_skip (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_fill_buffer (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIbuffer\fP\fB\fP\fB, png_size_t \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_handle_tEXt (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_handle_unknown (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_handle_zTXt (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_have_end (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fI\fIinfo_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_have_info (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fI\fIinfo_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_have_row (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_bytep \fI\fIrow\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_process_row (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_read_chunk (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fI\fIinfo_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB +\fBvoid png_calculate_crc (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIptr\fP\fB, png_size_t \fIlength\fP\fB);\fP -\fI\fB - -\fB\fBvoid png_push_read_end (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fI\fIinfo_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_read_IDAT (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_read_sig (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fI\fIinfo_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_read_tEXt (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fI\fIinfo_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_read_zTXt (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fI\fIinfo_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_restore_buffer (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIbuffer\fP\fB\fP\fB, png_size_t \fI\fIbuffer_length\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_push_save_buffer (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_read_data (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIdata\fP\fB\fP\fB, png_size_t \fI\fIlength\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_read_filter_row (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_row_infop \fP\fI\fP\fIrow_info\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIrow\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIprev_row\fP\fB\fP\fB, int \fI\fIfilter\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_read_finish_row (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_read_push_finish_row (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_read_start_row (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_read_transform_info (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fI\fIinfo_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_reset_crc (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB +\fBvoid png_check_chunk_name (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP -\fB\fBvoid png_save_int_32 (png_bytep \fP\fI\fP\fIbuf\fP\fB\fP\fB, png_int_32 \fI\fIi\fP\fB\fP\fB);\fP\fP +\fBpng_size_t png_check_keyword (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charpp \fInew_key\fP\fB);\fP -\fI\fB +\fBvoid png_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fImask\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_correct_palette (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fInum_palette\fP\fB);\fP -\fI\fB +\fBint png_crc_error (png_structp \fIpng_ptr\fP\fB);\fP -\fB\fBvoid png_save_uint_16 (png_bytep \fP\fI\fP\fIbuf\fP\fB\fP\fB, unsigned int \fI\fIi\fP\fB\fP\fB);\fP\fP +\fBint png_crc_finish (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIskip\fP\fB);\fP -\fI\fB +\fBvoid png_crc_read (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuf\fP\fB, png_size_t \fIlength\fP\fB);\fP -\fI\fB\fI\fB +\fBpng_voidp png_create_struct (int \fItype\fP\fB);\fP -\fI\fB +\fBpng_voidp png_create_struct_2 (int \fP\fItype\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP -\fB\fBvoid png_save_uint_32 (png_bytep \fP\fI\fP\fIbuf\fP\fB\fP\fB, png_uint_32 \fI\fIi\fP\fB\fP\fB);\fP\fP +\fBpng_charp png_decompress_chunk (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcomp_type\fP\fB, png_charp \fP\fIchunkdata\fP\fB, png_size_t \fP\fIchunklength\fP\fB, png_size_t \fP\fIprefix_length\fP\fB, png_size_t \fI*data_length\fP\fB);\fP -\fI\fB +\fBvoid png_destroy_struct (png_voidp \fIstruct_ptr\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_destroy_struct_2 (png_voidp \fP\fIstruct_ptr\fP\fB, png_free_ptr \fP\fIfree_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP -\fI\fB +\fBvoid png_do_background (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fP\fItrans_values\fP\fB, png_color_16p \fP\fIbackground\fP\fB, png_color_16p \fP\fIbackground_1\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_bytep \fP\fIgamma_from_1\fP\fB, png_bytep \fP\fIgamma_to_1\fP\fB, png_uint_16pp \fP\fIgamma_16\fP\fB, png_uint_16pp \fP\fIgamma_16_from_1\fP\fB, png_uint_16pp \fP\fIgamma_16_to_1\fP\fB, int \fIgamma_shift\fP\fB);\fP -\fB\fBint png_set_text_2 (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_infop \fP\fI\fP\fIinfo_ptr\fP\fB\fP\fB, png_textp \fP\fI\fP\fItext_ptr\fP\fB\fP\fB, int \fI\fInum_text\fP\fB\fP\fB);\fP\fP +\fBvoid png_do_bgr (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fI\fB +\fBvoid png_do_chop (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_do_dither (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIpalette_lookup\fP\fB, png_bytep \fIdither_lookup\fP\fB);\fP -\fI\fB +\fBvoid png_do_expand (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fItrans_value\fP\fB);\fP -\fB\fBvoid png_write_cHRM (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, double \fP\fI\fP\fIwhite_x\fP\fB\fP\fB, double \fP\fI\fP\fIwhite_y\fP\fB\fP\fB, double \fP\fI\fP\fIred_x\fP\fB\fP\fB, double \fP\fI\fP\fIred_y\fP\fB\fP\fB, double \fP\fI\fP\fIgreen_x\fP\fB\fP\fB, double \fP\fI\fP\fIgreen_y\fP\fB\fP\fB, double \fP\fI\fP\fIblue_x\fP\fB\fP\fB, double \fI\fIblue_y\fP\fB\fP\fB);\fP\fP +\fBvoid png_do_expand_palette (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_bytep \fP\fItrans\fP\fB, int \fInum_trans\fP\fB);\fP -\fI\fB +\fBvoid png_do_gamma (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_uint_16pp \fP\fIgamma_16_table\fP\fB, int \fIgamma_shift\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_do_gray_to_rgb (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fI\fB +\fBvoid png_do_invert (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fB\fBvoid png_write_cHRM_fixed (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIwhite_x\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIwhite_y\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIred_x\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIred_y\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIgreen_x\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIgreen_y\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIblue_x\fP\fB\fP\fB, png_uint_32 \fI\fIblue_y\fP\fB\fP\fB);\fP\fP +\fBvoid png_do_pack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIbit_depth\fP\fB);\fP -\fI\fB +\fBvoid png_do_packswap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_do_read_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, png_uint_32 \fIflags\fP\fB);\fP -\fI\fB +\fBvoid png_do_read_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fP\fIpass\fP\fB, png_uint_32 \fItransformations\fP\fB);\fP -\fB\fBvoid png_write_data (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIdata\fP\fB\fP\fB, png_size_t \fI\fIlength\fP\fB\fP\fB);\fP\fP +\fBvoid png_do_read_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fI\fB +\fBvoid png_do_read_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_do_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB +\fBint png_do_rgb_to_gray (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fB\fBvoid png_write_filtered_row (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_bytep \fI\fIfiltered_row\fP\fB\fP\fB);\fP\fP +\fBvoid png_do_shift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIbit_depth\fP\fB);\fP -\fI\fB +\fBvoid png_do_strip_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIflags\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_do_swap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fI\fB +\fBvoid png_do_unpack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fB\fBvoid png_write_find_filter (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_row_infop \fI\fIrow_info\fP\fB\fP\fB);\fP\fP +\fBvoid png_do_unshift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIsig_bits\fP\fB);\fP -\fI\fB +\fBvoid png_do_write_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fIpass\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_do_write_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fI\fB +\fBvoid png_do_write_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fB\fBvoid png_write_finish_row (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP +\fBvoid png_do_write_transformations (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB +\fBvoid *png_far_to_near (png_structp png_ptr,png_voidp \fP\fIptr\fP\fB, int \fIcheck\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_flush (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB +\fBvoid png_handle_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fB\fBvoid png_write_gAMA (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, double \fI\fIfile_gamma\fP\fB\fP\fB);\fP\fP +\fBvoid png_handle_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_handle_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_handle_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_handle_IEND (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fB\fBvoid png_write_gAMA_fixed (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_uint_32 \fI\fIint_file_gamma\fP\fB\fP\fB);\fP\fP +\fBvoid png_handle_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_handle_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_handle_iTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_handle_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fB\fBvoid png_write_hIST (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_uint_16p \fP\fI\fP\fIhist\fP\fB\fP\fB, int \fI\fInum_hist\fP\fB\fP\fB);\fP\fP +\fBvoid png_handle_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_handle_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_handle_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_handle_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fB\fBvoid png_write_iCCP (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_charp \fP\fI\fP\fIname\fP\fB\fP\fB, int \fP\fI\fP\fIcompression_type\fP\fB\fP\fB, png_charp \fP\fI\fP\fIprofile\fP\fB\fP\fB, int \fI\fIproflen\fP\fB\fP\fB);\fP\fP +\fBvoid png_handle_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_handle_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_handle_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fB\fBvoid png_write_IDAT (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_bytep \fP\fI\fP\fIdata\fP\fB\fP\fB, png_size_t \fI\fIlength\fP\fB\fP\fB);\fP\fP +\fBvoid png_handle_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_handle_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fB\fBvoid png_write_IEND (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP +\fBvoid png_info_destroy (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB +\fBvoid png_init_mmx_flags (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_init_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB +\fBvoid png_process_IDAT_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP -\fB\fBvoid png_write_IHDR (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIwidth\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIheight\fP\fB\fP\fB, int \fP\fI\fP\fIbit_depth\fP\fB\fP\fB, int \fP\fI\fP\fIcolor_type\fP\fB\fP\fB, int \fP\fI\fP\fIcompression_type\fP\fB\fP\fB, int \fP\fI\fP\fIfilter_type\fP\fB\fP\fB, int \fI\fIinterlace_type\fP\fB\fP\fB);\fP\fP +\fBvoid png_process_some_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB +\fBvoid png_push_check_crc (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_push_crc_finish (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB +\fBvoid png_push_crc_skip (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fB\fBvoid png_write_iTXt (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, int \fP\fI\fP\fIcompression\fP\fB\fP\fB, png_charp \fP\fI\fP\fIkey\fP\fB\fP\fB, png_charp \fP\fI\fP\fIlang\fP\fB\fP\fB, png_charp \fP\fI\fP\fItranslated_key\fP\fB\fP\fB, png_charp \fI\fItext\fP\fB\fP\fB);\fP\fP +\fBvoid png_push_fill_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_push_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_push_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_push_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP -\fB\fBvoid png_write_oFFs (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIx_offset\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIy_offset\fP\fB\fP\fB, int \fI\fIunit_type\fP\fB\fP\fB);\fP\fP +\fBvoid png_push_have_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB +\fBvoid png_push_have_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_push_have_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIrow\fP\fB);\fP -\fI\fB +\fBvoid png_push_process_row (png_structp \fIpng_ptr\fP\fB);\fP -\fB\fBvoid png_write_pCAL (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_charp \fP\fI\fP\fIpurpose\fP\fB\fP\fB, png_int_32 \fP\fI\fP\fIX0\fP\fB\fP\fB, png_int_32 \fP\fI\fP\fIX1\fP\fB\fP\fB, int \fP\fI\fP\fItype\fP\fB\fP\fB, int \fP\fI\fP\fInparams\fP\fB\fP\fB, png_charp \fP\fI\fP\fIunits\fP\fB\fP\fB, png_charpp \fI\fIparams\fP\fB\fP\fB);\fP\fP +\fBvoid png_push_read_chunk (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB +\fBvoid png_push_read_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_push_read_IDAT (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB +\fBvoid png_push_read_sig (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fB\fBvoid png_write_pHYs (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIx_pixels_per_unit\fP\fB\fP\fB, png_uint_32 \fP\fI\fP\fIy_pixels_per_unit\fP\fB\fP\fB, int \fI\fIunit_type\fP\fB\fP\fB);\fP\fP +\fBvoid png_push_read_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB +\fBvoid png_push_read_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_push_restore_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP -\fI\fB +\fBvoid png_push_save_buffer (png_structp \fIpng_ptr\fP\fB);\fP -\fB\fBvoid png_write_PLTE (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_colorp \fP\fI\fP\fIpalette\fP\fB\fP\fB, png_uint_32 \fI\fInum_pal\fP\fB\fP\fB);\fP\fP +\fBvoid png_read_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_read_filter_row (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIprev_row\fP\fB, int \fIfilter\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_read_finish_row (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB - -\fB\fBvoid png_write_sBIT (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_color_8p \fP\fI\fP\fIsbit\fP\fB\fP\fB, int \fI\fIcolor_type\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_write_sCAL (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_charp \fP\fI\fP\fIunit\fP\fB\fP\fB, double \fP\fI\fP\fIwidth\fP\fB\fP\fB, double \fI\fIheight\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_write_sCAL_s (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_charp \fP\fI\fP\fIunit\fP\fB\fP\fB, png_charp \fP\fI\fP\fIwidth\fP\fB\fP\fB, png_charp \fI\fIheight\fP\fB\fP\fB);\fP\fP - -\fI\fB - -\fI\fB\fI\fB - -\fI\fB - -\fB\fBvoid png_write_sig (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP - -\fI\fB +\fBvoid png_read_push_finish_row (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_read_start_row (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB +\fBvoid png_read_transform_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP -\fB\fBvoid png_write_sRGB (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, int \fI\fIintent\fP\fB\fP\fB);\fP\fP +\fBvoid png_reset_crc (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB +\fBint png_set_text_2 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fItext_ptr\fP\fB, int \fInum_text\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_write_cHRM (png_structp \fP\fIpng_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP -\fI\fB +\fBvoid png_write_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwhite_x\fP\fB, png_uint_32 \fP\fIwhite_y\fP\fB, png_uint_32 \fP\fIred_x\fP\fB, png_uint_32 \fP\fIred_y\fP\fB, png_uint_32 \fP\fIgreen_x\fP\fB, png_uint_32 \fP\fIgreen_y\fP\fB, png_uint_32 \fP\fIblue_x\fP\fB, png_uint_32 \fIblue_y\fP\fB);\fP -\fB\fBvoid png_write_sPLT (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_spalette_p \fI\fIpalette\fP\fB\fP\fB);\fP\fP +\fBvoid png_write_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_write_filtered_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIfiltered_row\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_write_find_filter (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fIrow_info\fP\fB);\fP -\fI\fB +\fBvoid png_write_finish_row (png_structp \fIpng_ptr\fP\fB);\fP -\fB\fBvoid png_write_start_row (png_structp \fI\fIpng_ptr\fP\fB\fP\fB);\fP\fP +\fBvoid png_write_gAMA (png_structp \fP\fIpng_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP -\fI\fB +\fBvoid png_write_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIint_file_gamma\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_write_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_uint_16p \fP\fIhist\fP\fB, int \fInum_hist\fP\fB);\fP -\fI\fB +\fBvoid png_write_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_charp \fP\fIprofile\fP\fB, int \fIproflen\fP\fB);\fP -\fB\fBvoid png_write_tEXt (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_charp \fP\fI\fP\fIkey\fP\fB\fP\fB, png_charp \fP\fI\fP\fItext\fP\fB\fP\fB, png_size_t \fI\fItext_len\fP\fB\fP\fB);\fP\fP +\fBvoid png_write_IDAT (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP -\fI\fB +\fBvoid png_write_IEND (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_write_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fP\fIfilter_type\fP\fB, int \fIinterlace_type\fP\fB);\fP -\fI\fB +\fBvoid png_write_iTXt (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcompression\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fIlang\fP\fB, png_charp \fP\fItranslated_key\fP\fB, png_charp \fItext\fP\fB);\fP -\fB\fBvoid png_write_tIME (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_timep \fI\fImod_time\fP\fB\fP\fB);\fP\fP +\fBvoid png_write_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_offset\fP\fB, png_uint_32 \fP\fIy_offset\fP\fB, int \fIunit_type\fP\fB);\fP -\fI\fB +\fBvoid png_write_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIpurpose\fP\fB, png_int_32 \fP\fIX0\fP\fB, png_int_32 \fP\fIX1\fP\fB, int \fP\fItype\fP\fB, int \fP\fInparams\fP\fB, png_charp \fP\fIunits\fP\fB, png_charpp \fIparams\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_write_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_pixels_per_unit\fP\fB, png_uint_32 \fP\fIy_pixels_per_unit\fP\fB, int \fIunit_type\fP\fB);\fP -\fI\fB - -\fB\fBvoid png_write_tRNS (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_bytep \fP\fI\fP\fItrans\fP\fB\fP\fB, png_color_16p \fP\fI\fP\fIvalues\fP\fB\fP\fB, int \fP\fI\fP\fInumber\fP\fB\fP\fB, int \fI\fIcolor_type\fP\fB\fP\fB);\fP\fP +\fBvoid png_write_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_uint_32 \fInum_pal\fP\fB);\fP -\fI\fB +\fBvoid png_write_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_color_8p \fP\fIsbit\fP\fB, int \fIcolor_type\fP\fB);\fP -\fI\fB\fI\fB - -\fI\fB +\fBvoid png_write_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP -\fB\fBvoid png_write_zTXt (png_structp \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, png_charp \fP\fI\fP\fIkey\fP\fB\fP\fB, png_charp \fP\fI\fP\fItext\fP\fB\fP\fB, png_size_t \fP\fI\fP\fItext_len\fP\fB\fP\fB, int \fI\fIcompression\fP\fB\fP\fB);\fP\fP +\fBvoid png_write_sCAL_s (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, png_charp \fP\fIwidth\fP\fB, png_charp \fIheight\fP\fB);\fP -\fI\fB +\fBvoid png_write_sig (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_write_sRGB (png_structp \fP\fIpng_ptr\fP\fB, int \fIintent\fP\fB);\fP -\fI\fB +\fBvoid png_write_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_spalette_p \fIpalette\fP\fB);\fP -\fB\fBvoidpf png_zalloc (voidpf \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, uInt \fP\fI\fP\fIitems\fP\fB\fP\fB, uInt \fI\fIsize\fP\fB\fP\fB);\fP\fP +\fBvoid png_write_start_row (png_structp \fIpng_ptr\fP\fB);\fP -\fI\fB +\fBvoid png_write_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fItext_len\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_write_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP -\fI\fB +\fBvoid png_write_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fItrans\fP\fB, png_color_16p \fP\fIvalues\fP\fB, int \fP\fInumber\fP\fB, int \fIcolor_type\fP\fB);\fP -\fB\fBvoid png_zfree (voidpf \fP\fI\fP\fIpng_ptr\fP\fB\fP\fB, voidpf \fI\fIptr\fP\fB\fP\fB);\fP\fP +\fBvoid png_write_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fP\fItext_len\fP\fB, int \fIcompression\fP\fB);\fP -\fI\fB +\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP -\fI\fB\fI\fB +\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP \fI\fB diff --git a/Build/source/libs/libpng/png.5 b/Build/source/libs/libpng/png.5 index db7c8341647..db0ddbba4e1 100644 --- a/Build/source/libs/libpng/png.5 +++ b/Build/source/libs/libpng/png.5 @@ -1,4 +1,4 @@ -.TH PNG 5 "December 3, 2004" +.TH PNG 5 "November 27, 2006" .SH NAME png \- Portable Network Graphics (PNG) format .SH DESCRIPTION @@ -58,7 +58,7 @@ Thomas Boutell and others (png-list). .SH COPYRIGHT NOTICE .LP -This man page is Copyright (c) 1998-2004 Glenn Randers-Pehrson. See png.h +This man page is Copyright (c) 1998-2006 Glenn Randers-Pehrson. See png.h for conditions of use and distribution. .LP The PNG Specification (Second Edition) is diff --git a/Build/source/libs/libpng/png.c b/Build/source/libs/libpng/png.c index 608ea2ce7c9..35647560016 100644 --- a/Build/source/libs/libpng/png.c +++ b/Build/source/libs/libpng/png.c @@ -1,9 +1,9 @@ /* png.c - location for general purpose libpng functions * - * libpng version 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.13 November 13, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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.) */ @@ -13,7 +13,7 @@ #include "png.h" /* Generate a compiler error if there is an old png.h in the search path. */ -typedef version_1_2_8 Your_png_h_is_not_version_1_2_8; +typedef version_1_2_14 Your_png_h_is_not_version_1_2_14; /* Version information for C files. This had better match the version * string defined in png.h. */ @@ -22,9 +22,12 @@ typedef version_1_2_8 Your_png_h_is_not_version_1_2_8; /* png_libpng_ver was changed to a function in version 1.0.5c */ const char png_libpng_ver[18] = PNG_LIBPNG_VER_STRING; +#ifdef PNG_READ_SUPPORTED + /* png_sig was changed to a function in version 1.0.5c */ /* Place to hold the signature string for a PNG file. */ const png_byte FARDATA png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10}; +#endif /* PNG_READ_SUPPORTED */ /* Invoke global declarations for constant strings for known chunk types */ PNG_IHDR; @@ -49,6 +52,7 @@ PNG_tIME; PNG_tRNS; PNG_zTXt; +#ifdef PNG_READ_SUPPORTED /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* start of interlace block */ @@ -80,6 +84,7 @@ const int FARDATA png_pass_mask[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; const int FARDATA png_pass_dsp_mask[] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; +#endif /* PNG_READ_SUPPORTED */ #endif /* PNG_USE_GLOBAL_ARRAYS */ /* Tells libpng that we have already handled the first "num_bytes" bytes @@ -88,9 +93,11 @@ const int FARDATA png_pass_dsp_mask[] * or write any of the magic bytes before it starts on the IHDR. */ +#ifdef PNG_READ_SUPPORTED void PNGAPI png_set_sig_bytes(png_structp png_ptr, int num_bytes) { + if(png_ptr == NULL) return; png_debug(1, "in png_set_sig_bytes\n"); if (num_bytes > 8) png_error(png_ptr, "Too many bytes for PNG signature."); @@ -113,10 +120,10 @@ png_sig_cmp(png_bytep sig, png_size_t start, png_size_t num_to_check) if (num_to_check > 8) num_to_check = 8; else if (num_to_check < 1) - return (0); + return (-1); if (start > 7) - return (0); + return (-1); if (start + num_to_check > 8) num_to_check = 8 - start; @@ -124,6 +131,7 @@ png_sig_cmp(png_bytep sig, png_size_t start, png_size_t num_to_check) return ((int)(png_memcmp(&sig[start], &png_signature[start], num_to_check))); } +#if defined(PNG_1_0_X) || defined(PNG_1_2_X) /* (Obsolete) function to check signature bytes. It does not allow one * to check a partial signature. This function might be removed in the * future - use png_sig_cmp(). Returns true (nonzero) if the file is a PNG. @@ -133,7 +141,10 @@ png_check_sig(png_bytep sig, int num) { return ((int)!png_sig_cmp(sig, (png_size_t)0, (png_size_t)num)); } +#endif +#endif /* PNG_READ_SUPPORTED */ +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) /* Function to allocate memory for zlib and clear it to 0. */ #ifdef PNG_1_0_X voidpf PNGAPI @@ -143,13 +154,14 @@ voidpf /* private */ png_zalloc(voidpf png_ptr, uInt items, uInt size) { png_voidp ptr; - png_structp p=png_ptr; + png_structp p=(png_structp)png_ptr; png_uint_32 save_flags=p->flags; png_uint_32 num_bytes; + if(png_ptr == NULL) return (NULL); if (items > PNG_UINT_32_MAX/size) { - png_warning (png_ptr, "Potential overflow in png_zalloc()"); + png_warning (p, "Potential overflow in png_zalloc()"); return (NULL); } num_bytes = (png_uint_32)items * size; @@ -256,6 +268,7 @@ void PNGAPI png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr) { png_infop info_ptr = NULL; + if(png_ptr == NULL) return; png_debug(1, "in png_destroy_info_struct\n"); if (info_ptr_ptr != NULL) @@ -279,7 +292,7 @@ png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr) * and applications using it are urged to use png_create_info_struct() * instead. */ -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +#if defined(PNG_1_0_X) || defined(PNG_1_2_X) #undef png_info_init void PNGAPI png_info_init(png_infop info_ptr) @@ -294,6 +307,8 @@ png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size) { png_infop info_ptr = *ptr_ptr; + if(info_ptr == NULL) return; + png_debug(1, "in png_info_init_3\n"); if(png_sizeof(png_info) > png_info_struct_size) @@ -592,6 +607,7 @@ png_info_destroy(png_structp png_ptr, png_infop info_ptr) png_info_init_3(&info_ptr, png_sizeof(png_info)); } +#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ /* This function returns a pointer to the io_ptr associated with the user * functions. The application should free any memory associated with this @@ -600,9 +616,11 @@ png_info_destroy(png_structp png_ptr, png_infop info_ptr) png_voidp PNGAPI png_get_io_ptr(png_structp png_ptr) { + if(png_ptr == NULL) return (NULL); return (png_ptr->io_ptr); } +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) #if !defined(PNG_NO_STDIO) /* Initialize the default input/output functions for the PNG file. If you * use your own read or write routines, you can call either png_set_read_fn() @@ -614,6 +632,7 @@ void PNGAPI png_init_io(png_structp png_ptr, png_FILE_p fp) { png_debug(1, "in png_init_io\n"); + if(png_ptr == NULL) return; png_ptr->io_ptr = (png_voidp)fp; } #endif @@ -629,6 +648,7 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime) {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; + if(png_ptr == NULL) return (NULL); if (png_ptr->time_buffer == NULL) { png_ptr->time_buffer = (png_charp)png_malloc(png_ptr, (png_uint_32)(29* @@ -675,13 +695,14 @@ png_sig_bytes(void) return ((png_bytep)"\211\120\116\107\015\012\032\012"); } #endif +#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ png_charp PNGAPI png_get_copyright(png_structp png_ptr) { if (&png_ptr != NULL) /* silence compiler warning about unused png_ptr */ - return ((png_charp) "\n libpng version 1.2.8 - December 3, 2004\n\ - Copyright (c) 1998-2004 Glenn Randers-Pehrson\n\ + return ((png_charp) "\n libpng version 1.2.14 - November 27, 2006\n\ + Copyright (c) 1998-2006 Glenn Randers-Pehrson\n\ Copyright (c) 1996-1997 Andreas Dilger\n\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n"); return ((png_charp) ""); @@ -722,6 +743,7 @@ png_get_header_version(png_structp png_ptr) return ((png_charp) ""); } +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED int PNGAPI png_handle_as_unknown(png_structp png_ptr, png_bytep chunk_name) @@ -743,8 +765,10 @@ png_handle_as_unknown(png_structp png_ptr, png_bytep chunk_name) int PNGAPI png_reset_zstream(png_structp png_ptr) { + if (png_ptr == NULL) return Z_STREAM_ERROR; return (inflateReset(&png_ptr->zstream)); } +#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ /* This function was added to libpng-1.0.7 */ png_uint_32 PNGAPI @@ -755,6 +779,7 @@ png_access_version_number(void) } +#if defined(PNG_READ_SUPPORTED) #if !defined(PNG_1_0_X) #if defined(PNG_ASSEMBLER_CODE_SUPPORTED) /* GRR: could add this: && defined(PNG_MMX_CODE_SUPPORTED) */ @@ -762,6 +787,7 @@ png_access_version_number(void) void /* PRIVATE */ png_init_mmx_flags (png_structp png_ptr) { + if(png_ptr == NULL) return; png_ptr->mmx_rowbytes_threshold = 0; png_ptr->mmx_bitdepth_threshold = 0; @@ -814,7 +840,9 @@ png_mmx_support(void) } #endif #endif /* PNG_1_0_X */ +#endif /* PNG_READ_SUPPORTED */ +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) #ifdef PNG_SIZE_T /* Added at libpng version 1.2.6 */ PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size)); @@ -826,3 +854,4 @@ png_convert_size(size_t size) return ((png_size_t)size); } #endif /* PNG_SIZE_T */ +#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ diff --git a/Build/source/libs/libpng/png.h b/Build/source/libs/libpng/png.h index e87a3011cd5..04fb266ba8f 100644 --- a/Build/source/libs/libpng/png.h +++ b/Build/source/libs/libpng/png.h @@ -1,14 +1,15 @@ + /* png.h - header file for PNG reference library * - * libpng version 1.2.8 - December 3, 2004 - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * libpng version 1.2.14 - November 27, 2006 + * Copyright (c) 1998-2006 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.) * * 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.2.8 - December 3, 2004: Glenn + * libpng versions 0.97, January 1998, through 1.2.14 - November 27, 2006: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: @@ -102,15 +103,37 @@ * 1.0.16 10 10016 10.so.0.1.0.16 * 1.2.6 13 10206 12.so.0.1.2.6 * 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2 - * 1.0.17rc1 10 10017 12.so.0.1.0.17rc1 + * 1.0.17rc1 10 10017 10.so.0.1.0.17rc1 * 1.2.7rc1 13 10207 12.so.0.1.2.7rc1 - * 1.0.17 10 10017 12.so.0.1.0.17 + * 1.0.17 10 10017 10.so.0.1.0.17 * 1.2.7 13 10207 12.so.0.1.2.7 * 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5 - * 1.0.18rc1-5 10 10018 12.so.0.1.0.18rc1-5 + * 1.0.18rc1-5 10 10018 10.so.0.1.0.18rc1-5 * 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5 - * 1.0.18 10 10018 12.so.0.1.0.18 + * 1.0.18 10 10018 10.so.0.1.0.18 * 1.2.8 13 10208 12.so.0.1.2.8 + * 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3 + * 1.2.9beta4-11 13 10209 12.so.0.9[.0] + * 1.2.9rc1 13 10209 12.so.0.9[.0] + * 1.2.9 13 10209 12.so.0.9[.0] + * 1.2.10beta1-8 13 10210 12.so.0.10[.0] + * 1.2.10rc1-3 13 10210 12.so.0.10[.0] + * 1.2.10 13 10210 12.so.0.10[.0] + * 1.2.11beta1-4 13 10211 12.so.0.11[.0] + * 1.0.19rc1-5 10 10019 10.so.0.19[.0] + * 1.2.11rc1-5 13 10211 12.so.0.11[.0] + * 1.0.19 10 10019 10.so.0.19[.0] + * 1.2.11 13 10211 12.so.0.11[.0] + * 1.0.20 10 10020 10.so.0.20[.0] + * 1.2.12 13 10212 12.so.0.12[.0] + * 1.2.13beta1 13 10213 12.so.0.13[.0] + * 1.0.21 10 10021 10.so.0.21[.0] + * 1.2.13 13 10213 12.so.0.13[.0] + * 1.2.14beta1-2 13 10214 12.so.0.14[.0] + * 1.0.22rc1 10 10022 10.so.0.22[.0] + * 1.2.14rc1 13 10214 12.so.0.14[.0] + * 1.0.22 10 10022 10.so.0.22[.0] + * 1.2.14 13 10214 12.so.0.14[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be @@ -140,8 +163,8 @@ * If you modify libpng you may insert additional notices immediately following * this sentence. * - * libpng versions 1.2.6, August 15, 2004, through 1.2.8, December 3, 2004, are - * Copyright (c) 2004 Glenn Randers-Pehrson, and are + * libpng versions 1.2.6, August 15, 2004, through 1.2.14, November 27, 2006, are + * Copyright (c) 2004, 2006 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: * @@ -252,13 +275,13 @@ * Y2K compliance in libpng: * ========================= * - * December 3, 2004 + * November 27, 2006 * * 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.2.8 are Y2K compliant. It is my belief that earlier + * upward through 1.2.14 are Y2K compliant. It is my belief that earlier * versions were also Y2K compliant. * * Libpng only has three year fields. One is a 2-byte unsigned integer @@ -314,9 +337,9 @@ */ /* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.2.8" +#define PNG_LIBPNG_VER_STRING "1.2.14" #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.2.8 - December 3, 2004 (header)\n" + " libpng version 1.2.14 - November 27, 2006 (header)\n" #define PNG_LIBPNG_VER_SONUM 0 #define PNG_LIBPNG_VER_DLLNUM 13 @@ -324,7 +347,7 @@ /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MINOR 2 -#define PNG_LIBPNG_VER_RELEASE 8 +#define PNG_LIBPNG_VER_RELEASE 14 /* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ @@ -352,7 +375,7 @@ * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only * 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 10208 /* 1.2.8 */ +#define PNG_LIBPNG_VER 10214 /* 1.2.14 */ #ifndef PNG_VERSION_INFO_ONLY /* include the compression library's header */ @@ -376,14 +399,14 @@ */ #if defined(PNG_USER_PRIVATEBUILD) -# define PNG_LIBPNG_BUILD_TYPE PNG_LIBPNG_BUILD_BASE_TYPE | \ - PNG_LIBPNG_BUILD_PRIVATE +# define PNG_LIBPNG_BUILD_TYPE \ + (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE) #else # if defined(PNG_LIBPNG_SPECIALBUILD) -# define PNG_LIBPNG_BUILD_TYPE PNG_LIBPNG_BUILD_BASE_TYPE | \ - PNG_LIBPNG_BUILD_SPECIAL +# define PNG_LIBPNG_BUILD_TYPE \ + (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL) # else -# define PNG_LIBPNG_BUILD_TYPE PNG_LIBPNG_BUILD_BASE_TYPE +# define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE) # endif #endif @@ -455,7 +478,7 @@ PNG_EXPORT_VAR (const int FARDATA) png_pass_ystart[7]; PNG_EXPORT_VAR (const int FARDATA) png_pass_yinc[7]; PNG_EXPORT_VAR (const int FARDATA) png_pass_mask[7]; PNG_EXPORT_VAR (const int FARDATA) png_pass_dsp_mask[7]; -#ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW +#ifdef PNG_USE_PNGGCCRD PNG_EXPORT_VAR (const int FARDATA) png_pass_width[7]; #endif /* This isn't currently used. If you need it, see png.c for more details. @@ -894,8 +917,10 @@ typedef png_info FAR * FAR * png_infopp; #define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL) #define PNG_UINT_32_MAX ((png_uint_32)(-1)) #define PNG_SIZE_MAX ((png_size_t)(-1)) +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) /* PNG_MAX_UINT is deprecated; use PNG_UINT_31_MAX instead. */ #define PNG_MAX_UINT PNG_UINT_31_MAX +#endif /* These describe the color_type field in png_info. */ /* color type masks */ @@ -1356,7 +1381,7 @@ struct png_struct_def /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ -typedef png_structp version_1_2_8; +typedef png_structp version_1_2_14; typedef png_struct FAR * FAR * png_structpp; @@ -1442,11 +1467,14 @@ extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr)); extern PNG_EXPORT(png_infop,png_create_info_struct) PNGARG((png_structp png_ptr)); +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) /* Initialize the info structure (old interface - DEPRECATED) */ extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr)); #undef png_info_init #define png_info_init(info_ptr) png_info_init_3(&info_ptr,\ png_sizeof(png_info)); +#endif + extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr, png_size_t png_info_struct_size)); @@ -1483,9 +1511,16 @@ extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime, #if defined(PNG_READ_EXPAND_SUPPORTED) /* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr)); +#if !defined(PNG_1_0_X) +extern PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8) PNGARG((png_structp + png_ptr)); +#endif extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr)); extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr)); +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Deprecated */ +extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr)); +#endif #endif #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) @@ -1606,6 +1641,7 @@ extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr, #endif #endif +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) #if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) /* Permit or disallow empty PLTE (0: not permitted, 1: permitted) */ @@ -1613,6 +1649,7 @@ extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr, extern PNG_EXPORT(void,png_permit_empty_plte) PNGARG((png_structp png_ptr, int empty_plte_permitted)); #endif +#endif #if defined(PNG_WRITE_FLUSH_SUPPORTED) /* Set how many lines between output flushes - 0 for no flushing */ @@ -2327,11 +2364,12 @@ extern PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr, #ifdef PNG_FLOATING_POINT_SUPPORTED extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr, png_infop info_ptr, int unit, double width, double height)); -#endif +#else #ifdef PNG_FIXED_POINT_SUPPORTED extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr, png_infop info_ptr, int unit, png_charp swidth, png_charp sheight)); #endif +#endif #endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) @@ -2427,7 +2465,9 @@ extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr, #define png_debug2(l, m, p1, p2) #endif +#if 0 extern PNG_EXPORT(png_bytep,png_sig_bytes) PNGARG((void)); +#endif extern PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr)); extern PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr)); @@ -2572,6 +2612,44 @@ extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp #endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ +/* Inline macros to do direct reads of bytes from the input buffer. These + * require that you are using an architecture that uses PNG byte ordering + * (MSB first) and supports unaligned data storage. I think that PowerPC + * in big-endian mode and 680x0 are the only ones that will support this. + * The x86 line of processors definitely do not. The png_get_int_32() + * routine also assumes we are using two's complement format for negative + * values, which is almost certainly true. + */ +#if defined(PNG_READ_BIG_ENDIAN_SUPPORTED) +# define png_get_uint_32(buf) ( *((png_uint_32p) (buf))) +# define png_get_uint_16(buf) ( *((png_uint_16p) (buf))) +# define png_get_int_32(buf) ( *((png_int_32p) (buf))) +#else +extern PNG_EXPORT(png_uint_32,png_get_uint_32) PNGARG((png_bytep buf)); +extern PNG_EXPORT(png_uint_16,png_get_uint_16) PNGARG((png_bytep buf)); +extern PNG_EXPORT(png_int_32,png_get_int_32) PNGARG((png_bytep buf)); +#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */ +extern PNG_EXPORT(png_uint_32,png_get_uint_31) + PNGARG((png_structp png_ptr, png_bytep buf)); +/* No png_get_int_16 -- may be added if there's a real need for it. */ + +/* Place a 32-bit number into a buffer in PNG byte order (big-endian). + */ +extern PNG_EXPORT(void,png_save_uint_32) + PNGARG((png_bytep buf, png_uint_32 i)); +extern PNG_EXPORT(void,png_save_int_32) + PNGARG((png_bytep buf, png_int_32 i)); + +/* Place a 16-bit number into a buffer in PNG byte order. + * The parameter is declared unsigned int, not png_uint_16, + * just to avoid potential problems on pre-ANSI C compilers. + */ +extern PNG_EXPORT(void,png_save_uint_16) + PNGARG((png_bytep buf, unsigned int i)); +/* No png_save_int_16 -- may be added if there's a real need for it. */ + +/* ************************************************************************* */ + /* These next functions are used internally in the code. They generally * shouldn't be used unless you are writing code to add or replace some * functionality in libpng. More information about most functions can @@ -2586,7 +2664,7 @@ extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp #define PNG_HAVE_IHDR 0x01 #define PNG_HAVE_PLTE 0x02 #define PNG_HAVE_IDAT 0x04 -#define PNG_AFTER_IDAT 0x08 +#define PNG_AFTER_IDAT 0x08 /* Have complete zlib datastream */ #define PNG_HAVE_IEND 0x10 #define PNG_HAVE_gAMA 0x20 #define PNG_HAVE_cHRM 0x40 @@ -2596,6 +2674,7 @@ extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp #define PNG_WROTE_INFO_BEFORE_PLTE 0x400 #define PNG_BACKGROUND_IS_GRAY 0x800 #define PNG_HAVE_PNG_SIGNATURE 0x1000 +#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ /* flags for the transformations the PNG library does on the image data */ #define PNG_BGR 0x0001 @@ -2624,7 +2703,7 @@ extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp #define PNG_RGB_TO_GRAY 0x600000L /* two bits, RGB_TO_GRAY_ERR|WARN */ /* 0x800000L Unused */ #define PNG_ADD_ALPHA 0x1000000L /* Added to libpng-1.2.7 */ - /* 0x2000000L unused */ +#define PNG_EXPAND_tRNS 0x2000000L /* Added to libpng-1.2.9 */ /* 0x4000000L unused */ /* 0x8000000L unused */ /* 0x10000000L unused */ @@ -2708,8 +2787,10 @@ extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp #ifdef PNG_USE_GLOBAL_ARRAYS PNG_EXPORT_VAR (const png_byte FARDATA) png_sig[8]; #else +#if 0 #define png_sig png_sig_bytes(NULL) #endif +#endif #endif /* PNG_NO_EXTERN */ /* Constant strings for known chunk types. If you need to add a chunk, @@ -2762,31 +2843,7 @@ PNG_EXPORT_VAR (const png_byte FARDATA) png_tRNS[5]; PNG_EXPORT_VAR (const png_byte FARDATA) png_zTXt[5]; #endif /* PNG_USE_GLOBAL_ARRAYS */ - -/* Inline macros to do direct reads of bytes from the input buffer. These - * require that you are using an architecture that uses PNG byte ordering - * (MSB first) and supports unaligned data storage. I think that PowerPC - * in big-endian mode and 680x0 are the only ones that will support this. - * The x86 line of processors definitely do not. The png_get_int_32() - * routine also assumes we are using two's complement format for negative - * values, which is almost certainly true. - */ -#if defined(PNG_READ_BIG_ENDIAN_SUPPORTED) -# if defined(PNG_pCAL_SUPPORTED) || defined(PNG_oFFs_SUPPORTED) -# define png_get_int_32(buf) ( *((png_int_32p) (buf))) -# endif -# define png_get_uint_32(buf) ( *((png_uint_32p) (buf))) -# define png_get_uint_16(buf) ( *((png_uint_16p) (buf))) -#else -# if defined(PNG_pCAL_SUPPORTED) || defined(PNG_oFFs_SUPPORTED) -PNG_EXTERN png_int_32 png_get_int_32 PNGARG((png_bytep buf)); -# endif -PNG_EXTERN png_uint_32 png_get_uint_32 PNGARG((png_bytep buf)); -PNG_EXTERN png_uint_16 png_get_uint_16 PNGARG((png_bytep buf)); -#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */ -PNG_EXTERN png_uint_32 png_get_uint_31 PNGARG((png_structp png_ptr, - png_bytep buf)); - +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) /* Initialize png_ptr struct for reading, and allocate any other memory. * (old interface - DEPRECATED - use png_create_read_struct instead). */ @@ -2794,12 +2851,17 @@ extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr)); #undef png_read_init #define png_read_init(png_ptr) png_read_init_3(&png_ptr, \ PNG_LIBPNG_VER_STRING, png_sizeof(png_struct)); +#endif + extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr, png_const_charp user_png_ver, png_size_t png_struct_size)); +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr, png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t png_info_size)); +#endif +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) /* Initialize png_ptr struct for writing, and allocate any other memory. * (old interface - DEPRECATED - use png_create_write_struct instead). */ @@ -2807,6 +2869,8 @@ extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr)); #undef png_write_init #define png_write_init(png_ptr) png_write_init_3(&png_ptr, \ PNG_LIBPNG_VER_STRING, png_sizeof(png_struct)); +#endif + extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr, png_const_charp user_png_ver, png_size_t png_struct_size)); extern PNG_EXPORT(void,png_write_init_2) PNGARG((png_structp png_ptr, @@ -2906,23 +2970,6 @@ PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr, PNG_EXTERN void png_flush PNGARG((png_structp png_ptr)); #endif - -/* Place a 32-bit number into a buffer in PNG byte order (big-endian). - * The only currently known PNG chunks that use signed numbers are - * the ancillary extension chunks, oFFs and pCAL. - */ -PNG_EXTERN void png_save_uint_32 PNGARG((png_bytep buf, png_uint_32 i)); - -#if defined(PNG_WRITE_pCAL_SUPPORTED) || defined(PNG_WRITE_oFFs_SUPPORTED) -PNG_EXTERN void png_save_int_32 PNGARG((png_bytep buf, png_int_32 i)); -#endif - -/* Place a 16-bit number into a buffer in PNG byte order. - * The parameter is declared unsigned int, not png_uint_16, - * just to avoid potential problems on pre-ANSI C compilers. - */ -PNG_EXTERN void png_save_uint_16 PNGARG((png_bytep buf, unsigned int i)); - /* simple function to write the signature */ PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr)); @@ -3406,6 +3453,29 @@ PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info, /* png.c */ /* PRIVATE */ PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr)); #endif + +#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) +PNG_EXTERN png_uint_32 png_get_pixels_per_inch PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN png_uint_32 png_get_x_pixels_per_inch PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN png_uint_32 png_get_y_pixels_per_inch PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN float png_get_x_offset_inches PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN float png_get_y_offset_inches PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#if defined(PNG_pHYs_SUPPORTED) +PNG_EXTERN 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)); +#endif /* PNG_pHYs_SUPPORTED */ +#endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */ + /* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ #endif /* PNG_INTERNAL */ diff --git a/Build/source/libs/libpng/pngconf.h b/Build/source/libs/libpng/pngconf.h index ba508384545..8ce3465d31b 100644 --- a/Build/source/libs/libpng/pngconf.h +++ b/Build/source/libs/libpng/pngconf.h @@ -1,9 +1,9 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.2.8 - December 3, 2004 + * libpng version 1.2.14 - November 27, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2005 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.) */ @@ -24,9 +24,19 @@ * includes the resource compiler for Windows DLL configurations. */ #ifdef PNG_USER_CONFIG +# ifndef PNG_USER_PRIVATEBUILD +# define PNG_USER_PRIVATEBUILD +# endif #include "pngusr.h" #endif +/* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */ +#ifdef PNG_CONFIGURE_LIBPNG +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#endif + /* * Added at libpng-1.2.8 * @@ -55,8 +65,8 @@ #endif #ifdef PRIVATEBUILD -# pragma message("PRIVATEBUILD is deprecated. Use\ - PNG_USER_PRIVATEBUILD instead.") +# pragma message("PRIVATEBUILD is deprecated.\ + Use PNG_USER_PRIVATEBUILD instead.") # define PNG_USER_PRIVATEBUILD PRIVATEBUILD #endif #endif /* __STDC__ */ @@ -453,21 +463,33 @@ */ /* The size of the png_text structure changed in libpng-1.0.6 when - * iTXt is supported. It is turned off by default, to support old apps - * that malloc the png_text structure instead of calling png_set_text() - * and letting libpng malloc it. It will be turned on by default in - * libpng-1.3.0. + * iTXt support was added. iTXt support was turned off by default through + * libpng-1.2.x, to support old apps that malloc the png_text structure + * instead of calling png_set_text() and letting libpng malloc it. It + * was turned on by default in libpng-1.3.0. */ -#ifndef PNG_iTXt_SUPPORTED -# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +# ifndef PNG_NO_iTXt_SUPPORTED +# define PNG_NO_iTXt_SUPPORTED +# endif +# ifndef PNG_NO_READ_iTXt # define PNG_NO_READ_iTXt # endif -# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) +# ifndef PNG_NO_WRITE_iTXt # define PNG_NO_WRITE_iTXt # endif #endif +#if !defined(PNG_NO_iTXt_SUPPORTED) +# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) +# define PNG_READ_iTXt +# endif +# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) +# define PNG_WRITE_iTXt +# endif +#endif + /* The following support, added after version 1.0.0, can be turned off here en * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility * with old applications that require the length of png_struct and png_info @@ -585,11 +607,13 @@ # endif #endif +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) /* Deprecated, will be removed from version 2.0.0. Use PNG_MNG_FEATURES_SUPPORTED instead. */ #ifndef PNG_NO_READ_EMPTY_PLTE # define PNG_READ_EMPTY_PLTE_SUPPORTED #endif +#endif #endif /* PNG_READ_SUPPORTED */ @@ -633,11 +657,15 @@ # endif #endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ +#if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ + !defined(PNG_WRITE_INTERLACING_SUPPORTED) #define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant encoders, but can cause trouble if left undefined */ +#endif #if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ + !defined(PNG_WRITE_WEIGHTED_FILTER) && \ defined(PNG_FLOATING_POINT_SUPPORTED) # define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED #endif @@ -646,10 +674,12 @@ # define PNG_WRITE_FLUSH_SUPPORTED #endif +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) /* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ #ifndef PNG_NO_WRITE_EMPTY_PLTE # define PNG_WRITE_EMPTY_PLTE_SUPPORTED #endif +#endif #endif /* PNG_WRITE_SUPPORTED */ @@ -696,9 +726,18 @@ # ifndef PNG_ASSEMBLER_CODE_SUPPORTED # define PNG_ASSEMBLER_CODE_SUPPORTED # endif -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# if defined(XP_MACOSX) && !defined(PNG_NO_MMX_CODE) + /* work around Intel-Mac compiler bug */ +# define PNG_NO_MMX_CODE +# endif +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) && \ + defined(__MMX__) # define PNG_MMX_CODE_SUPPORTED # endif +# if !defined(PNG_USE_PNGGCCRD) && !defined(PNG_NO_MMX_CODE) && \ + !defined(PNG_USE_PNGVCRD) && defined(__MMX__) +# define PNG_USE_PNGGCCRD +# endif #endif /* If you are sure that you don't need thread safety and you are compiling diff --git a/Build/source/libs/libpng/pngerror.c b/Build/source/libs/libpng/pngerror.c index 6fa40123788..c8c58b91d09 100644 --- a/Build/source/libs/libpng/pngerror.c +++ b/Build/source/libs/libpng/pngerror.c @@ -1,9 +1,9 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * libpng version 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.13 November 13, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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.) * @@ -16,6 +16,7 @@ #define PNG_INTERNAL #include "png.h" +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) static void /* PRIVATE */ png_default_error PNGARG((png_structp png_ptr, png_const_charp error_message)); @@ -33,33 +34,37 @@ png_error(png_structp png_ptr, png_const_charp error_message) { #ifdef PNG_ERROR_NUMBERS_SUPPORTED char msg[16]; - if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) + if (png_ptr != NULL) { - if (*error_message == '#') + if (png_ptr->flags& + (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) { - int offset; - for (offset=1; offset<15; offset++) - if (*(error_message+offset) == ' ') - break; - if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT) - { - int i; - for (i=0; i<offset-1; i++) - msg[i]=error_message[i+1]; - msg[i]='\0'; - error_message=msg; - } - else - error_message+=offset; - } - else - { - if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT) - { - msg[0]='0'; - msg[1]='\0'; - error_message=msg; - } + if (*error_message == '#') + { + int offset; + for (offset=1; offset<15; offset++) + if (*(error_message+offset) == ' ') + break; + if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT) + { + int i; + for (i=0; i<offset-1; i++) + msg[i]=error_message[i+1]; + msg[i]='\0'; + error_message=msg; + } + else + error_message+=offset; + } + else + { + if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT) + { + msg[0]='0'; + msg[1]='\0'; + error_message=msg; + } + } } } #endif @@ -80,19 +85,23 @@ void PNGAPI png_warning(png_structp png_ptr, png_const_charp warning_message) { int offset = 0; + if (png_ptr != NULL) + { #ifdef PNG_ERROR_NUMBERS_SUPPORTED - if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) + if (png_ptr->flags& + (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) #endif - { - if (*warning_message == '#') { - for (offset=1; offset<15; offset++) - if (*(warning_message+offset) == ' ') - break; + if (*warning_message == '#') + { + for (offset=1; offset<15; offset++) + if (*(warning_message+offset) == ' ') + break; + } } + if (png_ptr != NULL && png_ptr->warning_fn != NULL) + (*(png_ptr->warning_fn))(png_ptr, warning_message+offset); } - if (png_ptr != NULL && png_ptr->warning_fn != NULL) - (*(png_ptr->warning_fn))(png_ptr, warning_message+offset); else png_default_warning(png_ptr, warning_message+offset); } @@ -146,16 +155,26 @@ void PNGAPI png_chunk_error(png_structp png_ptr, png_const_charp error_message) { char msg[18+64]; - png_format_buffer(png_ptr, msg, error_message); - png_error(png_ptr, msg); + if (png_ptr == NULL) + png_error(png_ptr, error_message); + else + { + png_format_buffer(png_ptr, msg, error_message); + png_error(png_ptr, msg); + } } void PNGAPI png_chunk_warning(png_structp png_ptr, png_const_charp warning_message) { char msg[18+64]; - png_format_buffer(png_ptr, msg, warning_message); - png_warning(png_ptr, msg); + if (png_ptr == NULL) + png_warning(png_ptr, warning_message); + else + { + png_format_buffer(png_ptr, msg, warning_message); + png_warning(png_ptr, msg); + } } /* This is the default error handling function. Note that replacements for @@ -193,6 +212,8 @@ png_default_error(png_structp png_ptr, png_const_charp error_message) #endif #ifdef PNG_SETJMP_SUPPORTED + if (png_ptr) + { # ifdef USE_FAR_KEYWORD { jmp_buf jmpbuf; @@ -201,10 +222,9 @@ png_default_error(png_structp png_ptr, png_const_charp error_message) } # else longjmp(png_ptr->jmpbuf, 1); -# endif +# endif + } #else - /* make compiler happy */ ; - if (png_ptr) PNG_ABORT(); #endif #ifdef PNG_NO_CONSOLE_IO @@ -265,6 +285,8 @@ void PNGAPI png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn) { + if (png_ptr == NULL) + return; png_ptr->error_ptr = error_ptr; png_ptr->error_fn = error_fn; png_ptr->warning_fn = warning_fn; @@ -278,6 +300,8 @@ png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, png_voidp PNGAPI png_get_error_ptr(png_structp png_ptr) { + if (png_ptr == NULL) + return NULL; return ((png_voidp)png_ptr->error_ptr); } @@ -293,3 +317,4 @@ png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode) } } #endif +#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff --git a/Build/source/libs/libpng/pnggccrd.c b/Build/source/libs/libpng/pnggccrd.c index 248e1b3bb4c..8dc9c537ec1 100644 --- a/Build/source/libs/libpng/pnggccrd.c +++ b/Build/source/libs/libpng/pnggccrd.c @@ -1,3 +1,4 @@ + /* pnggccrd.c - mixed C/assembler version of utilities to read a PNG file * * For Intel x86 CPU (Pentium-MMX or later) and GNU C compiler. @@ -6,9 +7,9 @@ * and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm * for Intel's performance analysis of the MMX vs. non-MMX code. * - * libpng version 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.9 April 14, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 Glenn Randers-Pehrson * Copyright (c) 1998, Intel Corporation * * Based on MSVC code contributed by Nirav Chhatrapati, Intel Corp., 1998. @@ -255,9 +256,10 @@ static const int FARDATA png_pass_width[7] = {8, 4, 4, 2, 2, 1, 1}; #endif #if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -/* djgpp, Win32, and Cygwin add their own underscores to global variables, +/* djgpp, Win32, Cygwin, and OS2 add their own underscores to global variables, * so define them without: */ -#if defined(__DJGPP__) || defined(WIN32) || defined(__CYGWIN__) +#if defined(__DJGPP__) || defined(WIN32) || defined(__CYGWIN__) || \ + defined(__OS2__) # define _mmx_supported mmx_supported # define _const4 const4 # define _const6 const6 @@ -1737,6 +1739,7 @@ png_do_read_interlace(png_structp png_ptr) int dummy_value_c; // fix 'forbidden register spilled' int dummy_value_S; int dummy_value_D; + int dummy_value_a; __asm__ __volatile__ ( "subl $21, %%edi \n\t" @@ -1744,7 +1747,7 @@ png_do_read_interlace(png_structp png_ptr) ".loop3_pass0: \n\t" "movd (%%esi), %%mm0 \n\t" // x x x x x 2 1 0 - "pand _const4, %%mm0 \n\t" // z z z z z 2 1 0 + "pand (%3), %%mm0 \n\t" // z z z z z 2 1 0 "movq %%mm0, %%mm1 \n\t" // z z z z z 2 1 0 "psllq $16, %%mm0 \n\t" // z z z 2 1 0 z z "movq %%mm0, %%mm2 \n\t" // z z z 2 1 0 z z @@ -1769,12 +1772,14 @@ png_do_read_interlace(png_structp png_ptr) : "=c" (dummy_value_c), // output regs (dummy) "=S" (dummy_value_S), - "=D" (dummy_value_D) + "=D" (dummy_value_D), + "=a" (dummy_value_a) + : "1" (sptr), // esi // input regs "2" (dp), // edi "0" (width), // ecx - "rim" (_const4) // %1(?) (0x0000000000FFFFFFLL) + "3" (&_const4) // %1(?) (0x0000000000FFFFFFLL) #if 0 /* %mm0, ..., %mm4 not supported by gcc 2.7.2.3 or egcs 1.1 */ : "%mm0", "%mm1", "%mm2" // clobber list @@ -1787,6 +1792,7 @@ png_do_read_interlace(png_structp png_ptr) int dummy_value_c; // fix 'forbidden register spilled' int dummy_value_S; int dummy_value_D; + int dummy_value_a; __asm__ __volatile__ ( "subl $9, %%edi \n\t" @@ -1794,7 +1800,7 @@ png_do_read_interlace(png_structp png_ptr) ".loop3_pass2: \n\t" "movd (%%esi), %%mm0 \n\t" // x x x x x 2 1 0 - "pand _const4, %%mm0 \n\t" // z z z z z 2 1 0 + "pand (%3), %%mm0 \n\t" // z z z z z 2 1 0 "movq %%mm0, %%mm1 \n\t" // z z z z z 2 1 0 "psllq $16, %%mm0 \n\t" // z z z 2 1 0 z z "movq %%mm0, %%mm2 \n\t" // z z z 2 1 0 z z @@ -1813,12 +1819,13 @@ png_do_read_interlace(png_structp png_ptr) : "=c" (dummy_value_c), // output regs (dummy) "=S" (dummy_value_S), - "=D" (dummy_value_D) + "=D" (dummy_value_D), + "=a" (dummy_value_a) : "1" (sptr), // esi // input regs "2" (dp), // edi "0" (width), // ecx - "rim" (_const4) // (0x0000000000FFFFFFLL) + "3" (&_const4) // (0x0000000000FFFFFFLL) #if 0 /* %mm0, ..., %mm2 not supported by gcc 2.7.2.3 or egcs 1.1 */ : "%mm0", "%mm1", "%mm2" // clobber list @@ -1839,6 +1846,8 @@ png_do_read_interlace(png_structp png_ptr) int dummy_value_c; // fix 'forbidden register spilled' int dummy_value_S; int dummy_value_D; + int dummy_value_a; + int dummy_value_d; __asm__ __volatile__ ( "subl $3, %%esi \n\t" @@ -1850,14 +1859,14 @@ png_do_read_interlace(png_structp png_ptr) "movq %%mm0, %%mm1 \n\t" // x x 5 4 3 2 1 0 "movq %%mm0, %%mm2 \n\t" // x x 5 4 3 2 1 0 "psllq $24, %%mm0 \n\t" // 4 3 2 1 0 z z z - "pand _const4, %%mm1 \n\t" // z z z z z 2 1 0 + "pand (%3), %%mm1 \n\t" // z z z z z 2 1 0 "psrlq $24, %%mm2 \n\t" // z z z x x 5 4 3 "por %%mm1, %%mm0 \n\t" // 4 3 2 1 0 2 1 0 "movq %%mm2, %%mm3 \n\t" // z z z x x 5 4 3 "psllq $8, %%mm2 \n\t" // z z x x 5 4 3 z "movq %%mm0, (%%edi) \n\t" "psrlq $16, %%mm3 \n\t" // z z z z z x x 5 - "pand _const6, %%mm3 \n\t" // z z z z z z z 5 + "pand (%4), %%mm3 \n\t" // z z z z z z z 5 "por %%mm3, %%mm2 \n\t" // z z x x 5 4 3 5 "subl $6, %%esi \n\t" "movd %%mm2, 8(%%edi) \n\t" @@ -1868,13 +1877,15 @@ png_do_read_interlace(png_structp png_ptr) : "=c" (dummy_value_c), // output regs (dummy) "=S" (dummy_value_S), - "=D" (dummy_value_D) + "=D" (dummy_value_D), + "=a" (dummy_value_a), + "=d" (dummy_value_d) : "1" (sptr), // esi // input regs "2" (dp), // edi "0" (width_mmx), // ecx - "rim" (_const4), // 0x0000000000FFFFFFLL - "rim" (_const6) // 0x00000000000000FFLL + "3" (&_const4), // 0x0000000000FFFFFFLL + "4" (&_const6) // 0x00000000000000FFLL #if 0 /* %mm0, ..., %mm3 not supported by gcc 2.7.2.3 or egcs 1.1 */ : "%mm0", "%mm1" // clobber list @@ -5102,7 +5113,7 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep case 1: sprintf(filnm, "sub-%s", #if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) #if !defined(PNG_1_0_X) - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB)? "MMX" : + (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB)? "MMX" : #endif #endif "x86"); @@ -5339,6 +5350,7 @@ int PNGAPI png_mmx_support(void) { #if defined(PNG_MMX_CODE_SUPPORTED) + int result; __asm__ __volatile__ ( "pushl %%ebx \n\t" // ebx gets clobbered by CPUID instruction "pushl %%ecx \n\t" // so does ecx... @@ -5380,7 +5392,6 @@ png_mmx_support(void) "0: \n\t" // .NOT_SUPPORTED: target label for jump instructions "movl $0, %%eax \n\t" // set return value to 0 "1: \n\t" // .RETURN: target label for jump instructions - "movl %%eax, _mmx_supported \n\t" // save in global static variable, too "popl %%edx \n\t" // restore edx "popl %%ecx \n\t" // restore ecx "popl %%ebx \n\t" // restore ebx @@ -5388,16 +5399,17 @@ png_mmx_support(void) // "ret \n\t" // DONE: no MMX support // (fall through to standard C "ret") - : // output list (none) + : "=a" (result) // output list : // any variables used on input (none) - : "%eax" // clobber list + // no clobber list // , "%ebx", "%ecx", "%edx" // GRR: we handle these manually // , "memory" // if write to a variable gcc thought was in a reg // , "cc" // "condition codes" (flag bits) ); -#else + _mmx_supported = result; +#else _mmx_supported = 0; #endif /* PNG_MMX_CODE_SUPPORTED */ diff --git a/Build/source/libs/libpng/pngget.c b/Build/source/libs/libpng/pngget.c index 8eefa7779e1..df7658587e6 100644 --- a/Build/source/libs/libpng/pngget.c +++ b/Build/source/libs/libpng/pngget.c @@ -1,9 +1,9 @@ /* pngget.c - retrieval of values from info struct * - * libpng 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.9 April 14, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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,6 +11,8 @@ #define PNG_INTERNAL #include "png.h" +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) + png_uint_32 PNGAPI png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag) { @@ -916,6 +918,7 @@ png_get_mmx_rowbytes_threshold (png_structp png_ptr) return (png_uint_32)(png_ptr? png_ptr->mmx_rowbytes_threshold : 0L); } #endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */ +#endif /* ?PNG_1_0_X */ #ifdef PNG_SET_USER_LIMITS_SUPPORTED /* these functions were added to libpng 1.2.6 */ @@ -931,4 +934,4 @@ png_get_user_height_max (png_structp png_ptr) } #endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */ -#endif /* ?PNG_1_0_X */ +#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff --git a/Build/source/libs/libpng/pngmem.c b/Build/source/libs/libpng/pngmem.c index f1cb69395e6..248060f3817 100644 --- a/Build/source/libs/libpng/pngmem.c +++ b/Build/source/libs/libpng/pngmem.c @@ -1,9 +1,9 @@ /* pngmem.c - stub functions for memory allocation * - * libpng version 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.13 November 13, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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.) * @@ -17,6 +17,8 @@ #define PNG_INTERNAL #include "png.h" +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) + /* Borland DOS special memory handler */ #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) /* if you change this, be sure to change the one in png.h also */ @@ -135,6 +137,9 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size) png_voidp ret; #endif /* PNG_USER_MEM_SUPPORTED */ + if (png_ptr == NULL || size == 0) + return (NULL); + #ifdef PNG_MAX_MALLOC_64K if (size > (png_uint_32)65536L) { @@ -288,6 +293,8 @@ png_free_default(png_structp png_ptr, png_voidp ptr) { #endif /* PNG_USER_MEM_SUPPORTED */ + if(png_ptr == NULL) return; + if (png_ptr->offset_table != NULL) { int i; @@ -534,8 +541,10 @@ png_voidp PNGAPI png_malloc_warn(png_structp png_ptr, png_uint_32 size) { png_voidp ptr; - png_uint_32 save_flags=png_ptr->flags; + png_uint_32 save_flags; + if(png_ptr == NULL) return (NULL); + save_flags=png_ptr->flags; png_ptr->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK; ptr = (png_voidp)png_malloc((png_structp)png_ptr, size); png_ptr->flags=save_flags; @@ -578,9 +587,11 @@ void PNGAPI png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn) { + if(png_ptr != NULL) { png_ptr->mem_ptr = mem_ptr; png_ptr->malloc_fn = malloc_fn; png_ptr->free_fn = free_fn; + } } /* This function returns a pointer to the mem_ptr associated with the user @@ -590,6 +601,8 @@ png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr png_voidp PNGAPI png_get_mem_ptr(png_structp png_ptr) { + if(png_ptr == NULL) return (NULL); return ((png_voidp)png_ptr->mem_ptr); } #endif /* PNG_USER_MEM_SUPPORTED */ +#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff --git a/Build/source/libs/libpng/pngpread.c b/Build/source/libs/libpng/pngpread.c index 8c35faae446..d226c75d364 100644 --- a/Build/source/libs/libpng/pngpread.c +++ b/Build/source/libs/libpng/pngpread.c @@ -1,9 +1,9 @@ /* pngpread.c - read a png file in push mode * - * libpng version 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.13 November 13, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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.) */ @@ -28,6 +28,7 @@ void PNGAPI png_process_data(png_structp png_ptr, png_infop info_ptr, png_bytep buffer, png_size_t buffer_size) { + if(png_ptr == NULL) return; png_push_restore_buffer(png_ptr, buffer, buffer_size); while (png_ptr->buffer_size) @@ -42,6 +43,7 @@ png_process_data(png_structp png_ptr, png_infop info_ptr, void /* PRIVATE */ png_process_some_data(png_structp png_ptr, png_infop info_ptr) { + if(png_ptr == NULL) return; switch (png_ptr->process_mode) { case PNG_READ_SIG_MODE: @@ -214,6 +216,10 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; } + if (!png_memcmp(png_ptr->chunk_name, (png_bytep)png_IDAT, 4)) + if(png_ptr->mode & PNG_AFTER_IDAT) + png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT; + if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4)) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) @@ -281,8 +287,9 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) if (png_ptr->mode & PNG_HAVE_IDAT) { - if (png_ptr->push_length == 0) - return; + if (!(png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT)) + if (png_ptr->push_length == 0) + return; if (png_ptr->mode & PNG_AFTER_IDAT) png_error(png_ptr, "Too many IDAT's found"); @@ -556,6 +563,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length) { png_bytep ptr; + if(png_ptr == NULL) return; ptr = buffer; if (png_ptr->save_buffer_size) { @@ -614,7 +622,7 @@ png_push_save_buffer(png_structp png_ptr) png_size_t new_max; png_bytep old_buffer; - if (png_ptr->save_buffer_size > PNG_SIZE_MAX - + if (png_ptr->save_buffer_size > PNG_SIZE_MAX - (png_ptr->current_buffer_size + 256)) { png_error(png_ptr, "Potential overflow of save_buffer"); @@ -1545,6 +1553,7 @@ void PNGAPI png_progressive_combine_row (png_structp png_ptr, png_bytep old_row, png_bytep new_row) { + if(png_ptr == NULL) return; #ifdef PNG_USE_LOCAL_ARRAYS const int FARDATA png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; @@ -1558,6 +1567,7 @@ png_set_progressive_read_fn(png_structp png_ptr, png_voidp progressive_ptr, png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn) { + if(png_ptr == NULL) return; png_ptr->info_fn = info_fn; png_ptr->row_fn = row_fn; png_ptr->end_fn = end_fn; @@ -1568,6 +1578,7 @@ png_set_progressive_read_fn(png_structp png_ptr, png_voidp progressive_ptr, png_voidp PNGAPI png_get_progressive_ptr(png_structp png_ptr) { + if(png_ptr == NULL) return (NULL); return png_ptr->io_ptr; } #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ diff --git a/Build/source/libs/libpng/pngread.c b/Build/source/libs/libpng/pngread.c index 5924333df34..4040d51e311 100644 --- a/Build/source/libs/libpng/pngread.c +++ b/Build/source/libs/libpng/pngread.c @@ -1,9 +1,9 @@ /* pngread.c - read a PNG file * - * libpng 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.13 November 13, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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.) * @@ -14,6 +14,8 @@ #define PNG_INTERNAL #include "png.h" +#if defined(PNG_READ_SUPPORTED) + /* Create a PNG structure for reading, and allocate any memory needed. */ png_structp PNGAPI png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr, @@ -75,7 +77,7 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, png_free(png_ptr, png_ptr->zbuf); png_ptr->zbuf=NULL; #ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)png_ptr, + png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn, (png_voidp)mem_ptr); #else png_destroy_struct((png_voidp)png_ptr); @@ -169,10 +171,10 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, return (png_ptr); } +#if defined(PNG_1_0_X) || defined(PNG_1_2_X) /* Initialize PNG structure for reading, and allocate any memory needed. This interface is deprecated in favour of the png_create_read_struct(), - and it will eventually disappear. */ -#if defined(PNG_1_0_X) || defined (PNG_1_2_X) + and it will disappear as of libpng-1.3.0. */ #undef png_read_init void PNGAPI png_read_init(png_structp png_ptr) @@ -180,15 +182,15 @@ png_read_init(png_structp png_ptr) /* We only come here via pre-1.0.7-compiled applications */ png_read_init_2(png_ptr, "1.0.6 or earlier", 0, 0); } -#endif void PNGAPI png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t png_info_size) { /* We only come here via pre-1.0.12-compiled applications */ + if(png_ptr == NULL) return; #if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - if(png_sizeof(png_struct) > png_struct_size || + if(png_sizeof(png_struct) > png_struct_size || png_sizeof(png_info) > png_info_size) { char msg[80]; @@ -224,6 +226,7 @@ png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver, } png_read_init_3(&png_ptr, user_png_ver, png_struct_size); } +#endif /* PNG_1_0_X || PNG_1_2_X */ void PNGAPI png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, @@ -237,6 +240,8 @@ png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, png_structp png_ptr=*ptr_ptr; + if(png_ptr == NULL) return; + do { if(user_png_ver[i] != png_libpng_ver[i]) @@ -315,6 +320,7 @@ png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, void PNGAPI png_read_info(png_structp png_ptr, png_infop info_ptr) { + if(png_ptr == NULL) return; png_debug(1, "in png_read_info\n"); /* If we haven't checked all of the PNG signature bytes, do so now. */ if (png_ptr->sig_bytes < 8) @@ -411,6 +417,10 @@ png_read_info(png_structp png_ptr, png_infop info_ptr) /* This should be a binary subdivision search or a hash for * matching the chunk name rather than a linear search. */ + if (!png_memcmp(png_ptr->chunk_name, (png_bytep)png_IDAT, 4)) + if(png_ptr->mode & PNG_AFTER_IDAT) + png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT; + if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4)) png_handle_IHDR(png_ptr, info_ptr, length); else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) @@ -527,6 +537,7 @@ void PNGAPI png_read_update_info(png_structp png_ptr, png_infop info_ptr) { png_debug(1, "in png_read_update_info\n"); + if(png_ptr == NULL) return; if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) png_read_start_row(png_ptr); else @@ -545,6 +556,7 @@ void PNGAPI png_start_read_image(png_structp png_ptr) { png_debug(1, "in png_start_read_image\n"); + if(png_ptr == NULL) return; if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) png_read_start_row(png_ptr); } @@ -560,6 +572,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) const int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; #endif int ret; + if(png_ptr == NULL) return; png_debug2(1, "in png_read_row (row %lu, pass %d)\n", png_ptr->row_number, png_ptr->pass); if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) @@ -736,7 +749,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf, png_ptr->rowbytes + 1); - + #if defined(PNG_MNG_FEATURES_SUPPORTED) if((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING)) @@ -806,7 +819,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) * not called png_set_interlace_handling(), the display_row buffer will * be ignored, so pass NULL to it. * - * [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.8 + * [*] png_handle_alpha() does not exist yet, as of this version of libpng */ void PNGAPI @@ -818,6 +831,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row, png_bytepp dp; png_debug(1, "in png_read_rows\n"); + if(png_ptr == NULL) return; rp = row; dp = display_row; if (rp != NULL && dp != NULL) @@ -856,7 +870,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row, * only call this function once. If you desire to have an image for * each pass of a interlaced image, use png_read_rows() instead. * - * [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.8 + * [*] png_handle_alpha() does not exist yet, as of this version of libpng */ void PNGAPI png_read_image(png_structp png_ptr, png_bytepp image) @@ -866,6 +880,7 @@ png_read_image(png_structp png_ptr, png_bytepp image) png_bytepp rp; png_debug(1, "in png_read_image\n"); + if(png_ptr == NULL) return; #ifdef PNG_READ_INTERLACING_SUPPORTED pass = png_set_interlace_handling(png_ptr); @@ -904,6 +919,7 @@ png_read_end(png_structp png_ptr, png_infop info_ptr) png_uint_32 length; png_debug(1, "in png_read_end\n"); + if(png_ptr == NULL) return; png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */ do @@ -983,11 +999,9 @@ png_read_end(png_structp png_ptr, png_infop info_ptr) { if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) { - if (length > 0 || png_ptr->mode & PNG_AFTER_IDAT) + if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT)) png_error(png_ptr, "Too many IDAT's found"); } - else - png_ptr->mode |= PNG_AFTER_IDAT; png_handle_unknown(png_ptr, info_ptr, length); if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) png_ptr->mode |= PNG_HAVE_PLTE; @@ -998,7 +1012,7 @@ png_read_end(png_structp png_ptr, png_infop info_ptr) /* Zero length IDATs are legal after the last IDAT has been * read, but not after other chunks have been read. */ - if (length > 0 || png_ptr->mode & PNG_AFTER_IDAT) + if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT)) png_error(png_ptr, "Too many IDAT's found"); png_crc_finish(png_ptr, length); } @@ -1296,6 +1310,7 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr void PNGAPI png_set_read_status_fn(png_structp png_ptr, png_read_status_ptr read_row_fn) { + if(png_ptr == NULL) return; png_ptr->read_row_fn = read_row_fn; } @@ -1309,6 +1324,7 @@ png_read_png(png_structp png_ptr, png_infop info_ptr, { int row; + if(png_ptr == NULL) return; #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) /* invert the alpha channel from opacity to transparency */ @@ -1452,5 +1468,6 @@ png_read_png(png_structp png_ptr, png_infop info_ptr, /* quiet compiler warnings */ return; } -#endif +#endif /* PNG_INFO_IMAGE_SUPPORTED */ #endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ +#endif /* PNG_READ_SUPPORTED */ diff --git a/Build/source/libs/libpng/pngrio.c b/Build/source/libs/libpng/pngrio.c index cae501a5ca1..7d2522f1f86 100644 --- a/Build/source/libs/libpng/pngrio.c +++ b/Build/source/libs/libpng/pngrio.c @@ -1,9 +1,9 @@ /* pngrio.c - functions for data input * - * libpng 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.13 November 13, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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.) * @@ -18,6 +18,8 @@ #define PNG_INTERNAL #include "png.h" +#if defined(PNG_READ_SUPPORTED) + /* Read the data from whatever input you are using. The default routine reads from a file pointer. Note that this routine sometimes gets called with very small lengths, so you should implement some kind of simple @@ -44,6 +46,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { png_size_t check; + if(png_ptr == NULL) return; /* fread() returns 0 on error, so it is OK to store this in a png_size_t * instead of an int, which is what fread() actually returns. */ @@ -67,13 +70,14 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) #define NEAR_BUF_SIZE 1024 #define MIN(a,b) (a <= b ? a : b) -static void /* PRIVATE */ +static void PNGAPI png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { int check; png_byte *n_data; png_FILE_p io_ptr; + if(png_ptr == NULL) return; /* Check if data really is near. If so, use usual code. */ n_data = (png_byte *)CVT_PTR_NOCHECK(data); io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); @@ -134,6 +138,7 @@ void PNGAPI png_set_read_fn(png_structp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn) { + if(png_ptr == NULL) return; png_ptr->io_ptr = io_ptr; #if !defined(PNG_NO_STDIO) @@ -159,3 +164,4 @@ png_set_read_fn(png_structp png_ptr, png_voidp io_ptr, png_ptr->output_flush_fn = NULL; #endif } +#endif /* PNG_READ_SUPPORTED */ diff --git a/Build/source/libs/libpng/pngrtran.c b/Build/source/libs/libpng/pngrtran.c index e1d6e3ce39a..8f6860367aa 100644 --- a/Build/source/libs/libpng/pngrtran.c +++ b/Build/source/libs/libpng/pngrtran.c @@ -1,9 +1,9 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * libpng version 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.13 November 13, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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.) * @@ -16,12 +16,15 @@ #define PNG_INTERNAL #include "png.h" +#if defined(PNG_READ_SUPPORTED) + /* Set the action on getting a CRC error for an ancillary or critical chunk. */ void PNGAPI png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action) { png_debug(1, "in png_set_crc_action\n"); /* Tell libpng how we react to CRC errors in critical chunks */ + if(png_ptr == NULL) return; switch (crit_action) { case PNG_CRC_NO_CHANGE: /* leave setting as is */ @@ -78,6 +81,7 @@ png_set_background(png_structp png_ptr, int need_expand, double background_gamma) { png_debug(1, "in png_set_background\n"); + if(png_ptr == NULL) return; if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN) { png_warning(png_ptr, "Application must supply a known background gamma"); @@ -110,6 +114,7 @@ void PNGAPI png_set_strip_16(png_structp png_ptr) { png_debug(1, "in png_set_strip_16\n"); + if(png_ptr == NULL) return; png_ptr->transformations |= PNG_16_TO_8; } #endif @@ -119,6 +124,7 @@ void PNGAPI png_set_strip_alpha(png_structp png_ptr) { png_debug(1, "in png_set_strip_alpha\n"); + if(png_ptr == NULL) return; png_ptr->flags |= PNG_FLAG_STRIP_ALPHA; } #endif @@ -148,6 +154,7 @@ png_set_dither(png_structp png_ptr, png_colorp palette, int full_dither) { png_debug(1, "in png_set_dither\n"); + if(png_ptr == NULL) return; png_ptr->transformations |= PNG_DITHER; if (!full_dither) @@ -531,6 +538,7 @@ void PNGAPI png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma) { png_debug(1, "in png_set_gamma\n"); + if(png_ptr == NULL) return; if ((fabs(scrn_gamma * file_gamma - 1.0) > PNG_GAMMA_THRESHOLD) || (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) || (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)) @@ -549,7 +557,8 @@ void PNGAPI png_set_expand(png_structp png_ptr) { png_debug(1, "in png_set_expand\n"); - png_ptr->transformations |= PNG_EXPAND; + if(png_ptr == NULL) return; + png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); } /* GRR 19990627: the following three functions currently are identical @@ -564,30 +573,50 @@ png_set_expand(png_structp png_ptr) * * More to the point, these functions make it obvious what libpng will be * doing, whereas "expand" can (and does) mean any number of things. + * + * GRP 20060307: In libpng-1.4.0, png_set_gray_1_2_4_to_8() was modified + * to expand only the sample depth but not to expand the tRNS to alpha. */ /* Expand paletted images to RGB. */ void PNGAPI png_set_palette_to_rgb(png_structp png_ptr) { - png_debug(1, "in png_set_expand\n"); - png_ptr->transformations |= PNG_EXPAND; + png_debug(1, "in png_set_palette_to_rgb\n"); + if(png_ptr == NULL) return; + png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); +} + +#if !defined(PNG_1_0_X) +/* Expand grayscale images of less than 8-bit depth to 8 bits. */ +void PNGAPI +png_set_expand_gray_1_2_4_to_8(png_structp png_ptr) +{ + png_debug(1, "in png_set_expand_gray_1_2_4_to_8\n"); + if(png_ptr == NULL) return; + png_ptr->transformations |= PNG_EXPAND_tRNS; } +#endif +#if defined(PNG_1_0_X) || defined(PNG_1_2_X) /* Expand grayscale images of less than 8-bit depth to 8 bits. */ +/* Deprecated as of libpng-1.2.9 */ void PNGAPI png_set_gray_1_2_4_to_8(png_structp png_ptr) { - png_debug(1, "in png_set_expand\n"); - png_ptr->transformations |= PNG_EXPAND; + png_debug(1, "in png_set_gray_1_2_4_to_8\n"); + if(png_ptr == NULL) return; + png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); } +#endif + /* Expand tRNS chunks to alpha channels. */ void PNGAPI png_set_tRNS_to_alpha(png_structp png_ptr) { png_debug(1, "in png_set_expand\n"); - png_ptr->transformations |= PNG_EXPAND; + png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); } #endif /* defined(PNG_READ_EXPAND_SUPPORTED) */ @@ -612,6 +641,7 @@ png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red, { int red_fixed = (int)((float)red*100000.0 + 0.5); int green_fixed = (int)((float)green*100000.0 + 0.5); + if(png_ptr == NULL) return; png_set_rgb_to_gray_fixed(png_ptr, error_action, red_fixed, green_fixed); } #endif @@ -621,6 +651,7 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action, png_fixed_point red, png_fixed_point green) { png_debug(1, "in png_set_rgb_to_gray\n"); + if(png_ptr == NULL) return; switch(error_action) { case 1: png_ptr->transformations |= PNG_RGB_TO_GRAY; @@ -671,6 +702,7 @@ png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr read_user_transform_fn) { png_debug(1, "in png_set_read_user_transform_fn\n"); + if(png_ptr == NULL) return; #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) png_ptr->transformations |= PNG_USER_TRANSFORM; png_ptr->read_user_transform_fn = read_user_transform_fn; @@ -705,23 +737,41 @@ png_init_read_transformations(png_structp png_ptr) { if (!(color_type & PNG_COLOR_MASK_COLOR)) /* i.e., GRAY or GRAY_ALPHA */ { - /* expand background chunk. */ + /* expand background and tRNS chunks */ switch (png_ptr->bit_depth) { case 1: png_ptr->background.gray *= (png_uint_16)0xff; png_ptr->background.red = png_ptr->background.green = png_ptr->background.blue = png_ptr->background.gray; + if (!(png_ptr->transformations & PNG_EXPAND_tRNS)) + { + png_ptr->trans_values.gray *= (png_uint_16)0xff; + png_ptr->trans_values.red = png_ptr->trans_values.green + = png_ptr->trans_values.blue = png_ptr->trans_values.gray; + } break; case 2: png_ptr->background.gray *= (png_uint_16)0x55; png_ptr->background.red = png_ptr->background.green = png_ptr->background.blue = png_ptr->background.gray; + if (!(png_ptr->transformations & PNG_EXPAND_tRNS)) + { + png_ptr->trans_values.gray *= (png_uint_16)0x55; + png_ptr->trans_values.red = png_ptr->trans_values.green + = png_ptr->trans_values.blue = png_ptr->trans_values.gray; + } break; case 4: png_ptr->background.gray *= (png_uint_16)0x11; png_ptr->background.red = png_ptr->background.green = png_ptr->background.blue = png_ptr->background.gray; + if (!(png_ptr->transformations & PNG_EXPAND_tRNS)) + { + png_ptr->trans_values.gray *= (png_uint_16)0x11; + png_ptr->trans_values.red = png_ptr->trans_values.green + = png_ptr->trans_values.blue = png_ptr->trans_values.gray; + } break; case 8: case 16: @@ -743,7 +793,7 @@ png_init_read_transformations(png_structp png_ptr) if (png_ptr->transformations & PNG_INVERT_ALPHA) { #if defined(PNG_READ_EXPAND_SUPPORTED) - if (!(png_ptr->transformations & PNG_EXPAND)) + if (!(png_ptr->transformations & PNG_EXPAND_tRNS)) #endif { /* invert the alpha channel (in tRNS) unless the pixels are @@ -780,7 +830,8 @@ png_init_read_transformations(png_structp png_ptr) png_ptr->transformations &= (~PNG_GAMMA); } - if (png_ptr->transformations & (PNG_GAMMA | PNG_RGB_TO_GRAY)) + if ((png_ptr->transformations & (PNG_GAMMA | PNG_RGB_TO_GRAY)) && + png_ptr->gamma != 0.0) { png_build_gamma_table(png_ptr); #if defined(PNG_READ_BACKGROUND_SUPPORTED) @@ -788,7 +839,7 @@ png_init_read_transformations(png_structp png_ptr) { if (color_type == PNG_COLOR_TYPE_PALETTE) { - /* could skip if no transparency and + /* could skip if no transparency and */ png_color back, back_1; png_colorp palette = png_ptr->palette; @@ -1042,7 +1093,7 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr) { if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { - if (png_ptr->num_trans) + if (png_ptr->num_trans && (png_ptr->transformations & PNG_EXPAND_tRNS)) info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA; else info_ptr->color_type = PNG_COLOR_TYPE_RGB; @@ -1052,7 +1103,12 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr) else { if (png_ptr->num_trans) - info_ptr->color_type |= PNG_COLOR_MASK_ALPHA; + { + if (png_ptr->transformations & PNG_EXPAND_tRNS) + info_ptr->color_type |= PNG_COLOR_MASK_ALPHA; + else + info_ptr->color_type |= PNG_COLOR_MASK_COLOR; + } if (info_ptr->bit_depth < 8) info_ptr->bit_depth = 8; info_ptr->num_trans = 0; @@ -1086,6 +1142,16 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr) info_ptr->bit_depth = 8; #endif +#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) + if (png_ptr->transformations & PNG_GRAY_TO_RGB) + info_ptr->color_type |= PNG_COLOR_MASK_COLOR; +#endif + +#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) + if (png_ptr->transformations & PNG_RGB_TO_GRAY) + info_ptr->color_type &= ~PNG_COLOR_MASK_COLOR; +#endif + #if defined(PNG_READ_DITHER_SUPPORTED) if (png_ptr->transformations & PNG_DITHER) { @@ -1103,16 +1169,6 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr) info_ptr->bit_depth = 8; #endif -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) - if (png_ptr->transformations & PNG_GRAY_TO_RGB) - info_ptr->color_type |= PNG_COLOR_MASK_COLOR; -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & PNG_RGB_TO_GRAY) - info_ptr->color_type &= ~PNG_COLOR_MASK_COLOR; -#endif - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) info_ptr->channels = 1; else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) @@ -1198,7 +1254,7 @@ png_do_read_transformations(png_structp png_ptr) } else { - if (png_ptr->num_trans) + if (png_ptr->num_trans && (png_ptr->transformations & PNG_EXPAND_tRNS)) png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1, &(png_ptr->trans_values)); else @@ -3601,8 +3657,8 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row, } } -/* If the bit depth < 8, it is expanded to 8. Also, if the - * transparency value is supplied, an alpha channel is built. +/* If the bit depth < 8, it is expanded to 8. Also, if the already + * expanded transparency value is supplied, an alpha channel is built. */ void /* PRIVATE */ png_do_expand(png_row_infop row_info, png_bytep row, @@ -3895,7 +3951,7 @@ png_do_dither(png_row_infop row_info, png_bytep row, #ifdef PNG_FLOATING_POINT_SUPPORTED #if defined(PNG_READ_GAMMA_SUPPORTED) static int png_gamma_shift[] = - {0x10, 0x21, 0x42, 0x84, 0x110, 0x248, 0x550, 0xff0}; + {0x10, 0x21, 0x42, 0x84, 0x110, 0x248, 0x550, 0xff0, 0x00}; /* We build the 8- or 16-bit gamma tables here. Note that for 16-bit * tables, we don't make a full table if we are reducing to 8-bit in @@ -3906,210 +3962,208 @@ void /* PRIVATE */ png_build_gamma_table(png_structp png_ptr) { png_debug(1, "in png_build_gamma_table\n"); - if(png_ptr->gamma != 0.0) + + if (png_ptr->bit_depth <= 8) { - if (png_ptr->bit_depth <= 8) - { - int i; - double g; + int i; + double g; - if (png_ptr->screen_gamma > .000001) - g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); - else - g = 1.0; + if (png_ptr->screen_gamma > .000001) + g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); + else + g = 1.0; - png_ptr->gamma_table = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); + png_ptr->gamma_table = (png_bytep)png_malloc(png_ptr, + (png_uint_32)256); - for (i = 0; i < 256; i++) - { - png_ptr->gamma_table[i] = (png_byte)(pow((double)i / 255.0, - g) * 255.0 + .5); - } + for (i = 0; i < 256; i++) + { + png_ptr->gamma_table[i] = (png_byte)(pow((double)i / 255.0, + g) * 255.0 + .5); + } #if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & ((PNG_BACKGROUND) | PNG_RGB_TO_GRAY)) - { + defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) + if (png_ptr->transformations & ((PNG_BACKGROUND) | PNG_RGB_TO_GRAY)) + { - g = 1.0 / (png_ptr->gamma); + g = 1.0 / (png_ptr->gamma); - png_ptr->gamma_to_1 = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); + png_ptr->gamma_to_1 = (png_bytep)png_malloc(png_ptr, + (png_uint_32)256); - for (i = 0; i < 256; i++) - { - png_ptr->gamma_to_1[i] = (png_byte)(pow((double)i / 255.0, - g) * 255.0 + .5); - } + for (i = 0; i < 256; i++) + { + png_ptr->gamma_to_1[i] = (png_byte)(pow((double)i / 255.0, + g) * 255.0 + .5); + } - png_ptr->gamma_from_1 = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); + png_ptr->gamma_from_1 = (png_bytep)png_malloc(png_ptr, + (png_uint_32)256); - if(png_ptr->screen_gamma > 0.000001) - g = 1.0 / png_ptr->screen_gamma; - else - g = png_ptr->gamma; /* probably doing rgb_to_gray */ + if(png_ptr->screen_gamma > 0.000001) + g = 1.0 / png_ptr->screen_gamma; + else + g = png_ptr->gamma; /* probably doing rgb_to_gray */ - for (i = 0; i < 256; i++) - { - png_ptr->gamma_from_1[i] = (png_byte)(pow((double)i / 255.0, - g) * 255.0 + .5); + for (i = 0; i < 256; i++) + { + png_ptr->gamma_from_1[i] = (png_byte)(pow((double)i / 255.0, + g) * 255.0 + .5); - } - } + } + } #endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_RGB_TO_GRAY_SUPPORTED */ - } - else - { - double g; - int i, j, shift, num; - int sig_bit; - png_uint_32 ig; + } + else + { + double g; + int i, j, shift, num; + int sig_bit; + png_uint_32 ig; - if (png_ptr->color_type & PNG_COLOR_MASK_COLOR) - { - sig_bit = (int)png_ptr->sig_bit.red; - if ((int)png_ptr->sig_bit.green > sig_bit) - sig_bit = png_ptr->sig_bit.green; - if ((int)png_ptr->sig_bit.blue > sig_bit) - sig_bit = png_ptr->sig_bit.blue; - } - else - { - sig_bit = (int)png_ptr->sig_bit.gray; - } + if (png_ptr->color_type & PNG_COLOR_MASK_COLOR) + { + sig_bit = (int)png_ptr->sig_bit.red; + if ((int)png_ptr->sig_bit.green > sig_bit) + sig_bit = png_ptr->sig_bit.green; + if ((int)png_ptr->sig_bit.blue > sig_bit) + sig_bit = png_ptr->sig_bit.blue; + } + else + { + sig_bit = (int)png_ptr->sig_bit.gray; + } - if (sig_bit > 0) - shift = 16 - sig_bit; - else - shift = 0; + if (sig_bit > 0) + shift = 16 - sig_bit; + else + shift = 0; - if (png_ptr->transformations & PNG_16_TO_8) - { - if (shift < (16 - PNG_MAX_GAMMA_8)) - shift = (16 - PNG_MAX_GAMMA_8); - } + if (png_ptr->transformations & PNG_16_TO_8) + { + if (shift < (16 - PNG_MAX_GAMMA_8)) + shift = (16 - PNG_MAX_GAMMA_8); + } - if (shift > 8) - shift = 8; - if (shift < 0) - shift = 0; + if (shift > 8) + shift = 8; + if (shift < 0) + shift = 0; - png_ptr->gamma_shift = (png_byte)shift; + png_ptr->gamma_shift = (png_byte)shift; - num = (1 << (8 - shift)); + num = (1 << (8 - shift)); - if (png_ptr->screen_gamma > .000001) - g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); - else - g = 1.0; + if (png_ptr->screen_gamma > .000001) + g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); + else + g = 1.0; - png_ptr->gamma_16_table = (png_uint_16pp)png_malloc(png_ptr, - (png_uint_32)(num * png_sizeof (png_uint_16p))); + png_ptr->gamma_16_table = (png_uint_16pp)png_malloc(png_ptr, + (png_uint_32)(num * png_sizeof (png_uint_16p))); - if (png_ptr->transformations & (PNG_16_TO_8 | PNG_BACKGROUND)) - { - double fin, fout; - png_uint_32 last, max; + if (png_ptr->transformations & (PNG_16_TO_8 | PNG_BACKGROUND)) + { + double fin, fout; + png_uint_32 last, max; - for (i = 0; i < num; i++) - { - png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * png_sizeof (png_uint_16))); - } + for (i = 0; i < num; i++) + { + png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr, + (png_uint_32)(256 * png_sizeof (png_uint_16))); + } - g = 1.0 / g; - last = 0; - for (i = 0; i < 256; i++) - { - fout = ((double)i + 0.5) / 256.0; - fin = pow(fout, g); - max = (png_uint_32)(fin * (double)((png_uint_32)num << 8)); - while (last <= max) - { - png_ptr->gamma_16_table[(int)(last & (0xff >> shift))] - [(int)(last >> (8 - shift))] = (png_uint_16)( - (png_uint_16)i | ((png_uint_16)i << 8)); - last++; - } - } - while (last < ((png_uint_32)num << 8)) - { - png_ptr->gamma_16_table[(int)(last & (0xff >> shift))] - [(int)(last >> (8 - shift))] = (png_uint_16)65535L; - last++; - } - } - else - { - for (i = 0; i < num; i++) - { - png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * png_sizeof (png_uint_16))); + g = 1.0 / g; + last = 0; + for (i = 0; i < 256; i++) + { + fout = ((double)i + 0.5) / 256.0; + fin = pow(fout, g); + max = (png_uint_32)(fin * (double)((png_uint_32)num << 8)); + while (last <= max) + { + png_ptr->gamma_16_table[(int)(last & (0xff >> shift))] + [(int)(last >> (8 - shift))] = (png_uint_16)( + (png_uint_16)i | ((png_uint_16)i << 8)); + last++; + } + } + while (last < ((png_uint_32)num << 8)) + { + png_ptr->gamma_16_table[(int)(last & (0xff >> shift))] + [(int)(last >> (8 - shift))] = (png_uint_16)65535L; + last++; + } + } + else + { + for (i = 0; i < num; i++) + { + png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr, + (png_uint_32)(256 * png_sizeof (png_uint_16))); - ig = (((png_uint_32)i * (png_uint_32)png_gamma_shift[shift]) >> 4); - for (j = 0; j < 256; j++) - { - png_ptr->gamma_16_table[i][j] = - (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / - 65535.0, g) * 65535.0 + .5); - } - } - } + ig = (((png_uint_32)i * (png_uint_32)png_gamma_shift[shift]) >> 4); + for (j = 0; j < 256; j++) + { + png_ptr->gamma_16_table[i][j] = + (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / + 65535.0, g) * 65535.0 + .5); + } + } + } #if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & (PNG_BACKGROUND | PNG_RGB_TO_GRAY)) - { + defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) + if (png_ptr->transformations & (PNG_BACKGROUND | PNG_RGB_TO_GRAY)) + { - g = 1.0 / (png_ptr->gamma); + g = 1.0 / (png_ptr->gamma); - png_ptr->gamma_16_to_1 = (png_uint_16pp)png_malloc(png_ptr, - (png_uint_32)(num * png_sizeof (png_uint_16p ))); + png_ptr->gamma_16_to_1 = (png_uint_16pp)png_malloc(png_ptr, + (png_uint_32)(num * png_sizeof (png_uint_16p ))); - for (i = 0; i < num; i++) - { - png_ptr->gamma_16_to_1[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * png_sizeof (png_uint_16))); + for (i = 0; i < num; i++) + { + png_ptr->gamma_16_to_1[i] = (png_uint_16p)png_malloc(png_ptr, + (png_uint_32)(256 * png_sizeof (png_uint_16))); - ig = (((png_uint_32)i * - (png_uint_32)png_gamma_shift[shift]) >> 4); - for (j = 0; j < 256; j++) - { - png_ptr->gamma_16_to_1[i][j] = - (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / - 65535.0, g) * 65535.0 + .5); - } - } + ig = (((png_uint_32)i * + (png_uint_32)png_gamma_shift[shift]) >> 4); + for (j = 0; j < 256; j++) + { + png_ptr->gamma_16_to_1[i][j] = + (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / + 65535.0, g) * 65535.0 + .5); + } + } - if(png_ptr->screen_gamma > 0.000001) - g = 1.0 / png_ptr->screen_gamma; - else - g = png_ptr->gamma; /* probably doing rgb_to_gray */ + if(png_ptr->screen_gamma > 0.000001) + g = 1.0 / png_ptr->screen_gamma; + else + g = png_ptr->gamma; /* probably doing rgb_to_gray */ - png_ptr->gamma_16_from_1 = (png_uint_16pp)png_malloc(png_ptr, - (png_uint_32)(num * png_sizeof (png_uint_16p))); + png_ptr->gamma_16_from_1 = (png_uint_16pp)png_malloc(png_ptr, + (png_uint_32)(num * png_sizeof (png_uint_16p))); - for (i = 0; i < num; i++) - { - png_ptr->gamma_16_from_1[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * png_sizeof (png_uint_16))); + for (i = 0; i < num; i++) + { + png_ptr->gamma_16_from_1[i] = (png_uint_16p)png_malloc(png_ptr, + (png_uint_32)(256 * png_sizeof (png_uint_16))); - ig = (((png_uint_32)i * - (png_uint_32)png_gamma_shift[shift]) >> 4); - for (j = 0; j < 256; j++) - { - png_ptr->gamma_16_from_1[i][j] = - (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / - 65535.0, g) * 65535.0 + .5); - } - } - } + ig = (((png_uint_32)i * + (png_uint_32)png_gamma_shift[shift]) >> 4); + for (j = 0; j < 256; j++) + { + png_ptr->gamma_16_from_1[i][j] = + (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / + 65535.0, g) * 65535.0 + .5); + } + } + } #endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_RGB_TO_GRAY_SUPPORTED */ - } - } + } } #endif /* To do: install integer version of png_build_gamma_table here */ @@ -4175,3 +4229,4 @@ png_do_read_intrapixel(png_row_infop row_info, png_bytep row) } } #endif /* PNG_MNG_FEATURES_SUPPORTED */ +#endif /* PNG_READ_SUPPORTED */ diff --git a/Build/source/libs/libpng/pngrutil.c b/Build/source/libs/libpng/pngrutil.c index 99e466f18e6..be43d4b4726 100644 --- a/Build/source/libs/libpng/pngrutil.c +++ b/Build/source/libs/libpng/pngrutil.c @@ -1,8 +1,9 @@ + /* pngrutil.c - utilities to read a PNG file * - * libpng version 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.13 November 13, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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.) * @@ -13,41 +14,45 @@ #define PNG_INTERNAL #include "png.h" -#if defined(_WIN32_WCE) +#if defined(PNG_READ_SUPPORTED) + +#ifdef PNG_FLOATING_POINT_SUPPORTED +# if defined(_WIN32_WCE) /* strtod() function is not supported on WindowsCE */ -# ifdef PNG_FLOATING_POINT_SUPPORTED -__inline double strtod(const char *nptr, char **endptr) +__inline double png_strtod(png_structp png_ptr, const char *nptr, char **endptr) { double result = 0; int len; wchar_t *str, *end; len = MultiByteToWideChar(CP_ACP, 0, nptr, -1, NULL, 0); - str = (wchar_t *)malloc(len * sizeof(wchar_t)); + str = (wchar_t *)png_malloc(png_ptr, len * sizeof(wchar_t)); if ( NULL != str ) { MultiByteToWideChar(CP_ACP, 0, nptr, -1, str, len); result = wcstod(str, &end); len = WideCharToMultiByte(CP_ACP, 0, end, -1, NULL, 0, NULL, NULL); *endptr = (char *)nptr + (png_strlen(nptr) - len + 1); - free(str); + png_free(str); } return result; } +# else +# define png_strtod(p,a,b) strtod(a,b) # endif #endif -png_uint_32 /* PRIVATE */ +png_uint_32 PNGAPI png_get_uint_31(png_structp png_ptr, png_bytep buf) { png_uint_32 i = png_get_uint_32(buf); if (i > PNG_UINT_31_MAX) - png_error(png_ptr, "PNG unsigned integer out of range.\n"); + png_error(png_ptr, "PNG unsigned integer out of range."); return (i); } #ifndef PNG_READ_BIG_ENDIAN_SUPPORTED /* Grab an unsigned 32-bit integer from a buffer in big-endian format. */ -png_uint_32 /* PRIVATE */ +png_uint_32 PNGAPI png_get_uint_32(png_bytep buf) { png_uint_32 i = ((png_uint_32)(*buf) << 24) + @@ -58,11 +63,10 @@ png_get_uint_32(png_bytep buf) return (i); } -#if defined(PNG_READ_pCAL_SUPPORTED) || defined(PNG_READ_oFFs_SUPPORTED) /* Grab a signed 32-bit integer from a buffer in big-endian format. The * data is stored in the PNG file in two's complement format, and it is * assumed that the machine format for signed integers is the same. */ -png_int_32 /* PRIVATE */ +png_int_32 PNGAPI png_get_int_32(png_bytep buf) { png_int_32 i = ((png_int_32)(*buf) << 24) + @@ -72,10 +76,9 @@ png_get_int_32(png_bytep buf) return (i); } -#endif /* PNG_READ_pCAL_SUPPORTED */ /* Grab an unsigned 16-bit integer from a buffer in big-endian format. */ -png_uint_16 /* PRIVATE */ +png_uint_16 PNGAPI png_get_uint_16(png_bytep buf) { png_uint_16 i = (png_uint_16)(((png_uint_16)(*buf) << 8) + @@ -89,6 +92,7 @@ png_get_uint_16(png_bytep buf) void /* PRIVATE */ png_crc_read(png_structp png_ptr, png_bytep buf, png_size_t length) { + if(png_ptr == NULL) return; png_read_data(png_ptr, buf, length); png_calculate_crc(png_ptr, buf, length); } @@ -275,7 +279,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type, if (ret != Z_STREAM_END) { #if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char umsg[50]; + char umsg[52]; if (ret == Z_BUF_ERROR) sprintf(umsg,"Buffer error in compressed datastream in %s chunk", @@ -619,7 +623,7 @@ png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) } #if defined(PNG_READ_sRGB_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sRGB) + if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB)) if (PNG_OUT_OF_RANGE(igamma, 45500L, 500)) { png_warning(png_ptr, @@ -777,8 +781,7 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) png_crc_read(png_ptr, buf, 4); uint_y = png_get_uint_32(buf); - if (uint_x > 80000L || uint_y > 80000L || - uint_x + uint_y > 100000L) + if (uint_x + uint_y > 100000L) { png_warning(png_ptr, "Invalid cHRM red point"); png_crc_finish(png_ptr, 16); @@ -793,8 +796,7 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) png_crc_read(png_ptr, buf, 4); uint_y = png_get_uint_32(buf); - if (uint_x > 80000L || uint_y > 80000L || - uint_x + uint_y > 100000L) + if (uint_x + uint_y > 100000L) { png_warning(png_ptr, "Invalid cHRM green point"); png_crc_finish(png_ptr, 8); @@ -809,8 +811,7 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) png_crc_read(png_ptr, buf, 4); uint_y = png_get_uint_32(buf); - if (uint_x > 80000L || uint_y > 80000L || - uint_x + uint_y > 100000L) + if (uint_x + uint_y > 100000L) { png_warning(png_ptr, "Invalid cHRM blue point"); png_crc_finish(png_ptr, 0); @@ -831,7 +832,7 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) #endif #if defined(PNG_READ_sRGB_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sRGB) + if ((info_ptr != NULL) && (info_ptr->valid & PNG_INFO_sRGB)) { if (PNG_OUT_OF_RANGE(int_x_white, 31270, 1000) || PNG_OUT_OF_RANGE(int_y_white, 32900, 1000) || @@ -842,7 +843,6 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) PNG_OUT_OF_RANGE(int_x_blue, 15000, 1000) || PNG_OUT_OF_RANGE(int_y_blue, 6000, 1000)) { - png_warning(png_ptr, "Ignoring incorrect cHRM value when sRGB is also present"); #ifndef PNG_NO_CONSOLE_IO @@ -926,7 +926,7 @@ png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) } #if defined(PNG_READ_gAMA_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED) - if ((info_ptr->valid & PNG_INFO_gAMA)) + if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)) { png_fixed_point igamma; #ifdef PNG_FIXED_POINT_SUPPORTED @@ -955,7 +955,7 @@ png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) #ifdef PNG_READ_cHRM_SUPPORTED #ifdef PNG_FIXED_POINT_SUPPORTED - if (info_ptr->valid & PNG_INFO_cHRM) + if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) if (PNG_OUT_OF_RANGE(info_ptr->int_x_white, 31270, 1000) || PNG_OUT_OF_RANGE(info_ptr->int_y_white, 32900, 1000) || PNG_OUT_OF_RANGE(info_ptr->int_x_red, 64000L, 1000) || @@ -1079,7 +1079,7 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) if(profile_size > profile_length) { png_free(png_ptr, chunkdata); - png_warning(png_ptr, "Ignoring truncated iCCP profile.\n"); + png_warning(png_ptr, "Ignoring truncated iCCP profile."); return; } @@ -1160,7 +1160,7 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) return; } - new_palette.nentries = (png_uint_32) (data_length / entry_size); + new_palette.nentries = (png_int_32) ( data_length / entry_size); if ((png_uint_32) new_palette.nentries > (png_uint_32) (PNG_SIZE_MAX / png_sizeof(png_sPLT_entry))) { @@ -1733,7 +1733,7 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ep = buffer + 1; /* skip unit byte */ #ifdef PNG_FLOATING_POINT_SUPPORTED - width = strtod(ep, &vp); + width = png_strtod(png_ptr, ep, &vp); if (*vp) { png_warning(png_ptr, "malformed width string in sCAL chunk"); @@ -1756,7 +1756,7 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ep++; #ifdef PNG_FLOATING_POINT_SUPPORTED - height = strtod(ep, &vp); + height = png_strtod(png_ptr, ep, &vp); if (*vp) { png_warning(png_ptr, "malformed height string in sCAL chunk"); @@ -2170,7 +2170,8 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) } #if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if (png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS) + if ((png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS) || + (png_ptr->read_user_chunk_fn != NULL)) { png_unknown_chunk chunk; @@ -3106,7 +3107,7 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) if ((png_uint_32)png_ptr->rowbytes + 1 > (png_uint_32)65536L) png_error(png_ptr, "This image requires a row greater than 64KB"); #endif - if ((png_uint_32)png_ptr->rowbytes > PNG_SIZE_MAX - 1) + if ((png_uint_32)png_ptr->rowbytes > (png_uint_32)(PNG_SIZE_MAX - 1)) png_error(png_ptr, "Row has too many bytes to allocate in memory."); png_ptr->prev_row = (png_bytep)png_malloc(png_ptr, (png_uint_32)( png_ptr->rowbytes + 1)); @@ -3122,3 +3123,4 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) png_ptr->flags |= PNG_FLAG_ROW_INIT; } +#endif /* PNG_READ_SUPPORTED */ diff --git a/Build/source/libs/libpng/pngset.c b/Build/source/libs/libpng/pngset.c index 5922cad0c5d..22879f71903 100644 --- a/Build/source/libs/libpng/pngset.c +++ b/Build/source/libs/libpng/pngset.c @@ -1,9 +1,9 @@ /* pngset.c - storage of image information into info struct * - * libpng 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.13 November 13, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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.) * @@ -16,6 +16,8 @@ #define PNG_INTERNAL #include "png.h" +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) + #if defined(PNG_bKGD_SUPPORTED) void PNGAPI png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p background) @@ -100,6 +102,7 @@ png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, "Ignoring attempt to set negative chromaticity value"); return; } +#ifdef PNG_FLOATING_POINT_SUPPORTED if (white_x > (double) PNG_UINT_31_MAX || white_y > (double) PNG_UINT_31_MAX || red_x > (double) PNG_UINT_31_MAX || @@ -108,6 +111,16 @@ png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, green_y > (double) PNG_UINT_31_MAX || blue_x > (double) PNG_UINT_31_MAX || blue_y > (double) PNG_UINT_31_MAX) +#else + if (white_x > (png_fixed_point) PNG_UINT_31_MAX/100000L || + white_y > (png_fixed_point) PNG_UINT_31_MAX/100000L || + red_x > (png_fixed_point) PNG_UINT_31_MAX/100000L || + red_y > (png_fixed_point) PNG_UINT_31_MAX/100000L || + green_x > (png_fixed_point) PNG_UINT_31_MAX/100000L || + green_y > (png_fixed_point) PNG_UINT_31_MAX/100000L || + blue_x > (png_fixed_point) PNG_UINT_31_MAX/100000L || + blue_y > (png_fixed_point) PNG_UINT_31_MAX/100000L) +#endif { png_warning(png_ptr, "Ignoring attempt to set chromaticity value exceeding 21474.83"); @@ -209,19 +222,21 @@ png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist) png_debug1(1, "in %s storage function\n", "hIST"); if (png_ptr == NULL || info_ptr == NULL) return; - if (info_ptr->num_palette == 0) + if (info_ptr->num_palette <= 0 || info_ptr->num_palette + > PNG_MAX_PALETTE_LENGTH) { png_warning(png_ptr, - "Palette size 0, hIST allocation skipped."); + "Invalid palette size, hIST allocation skipped."); return; } #ifdef PNG_FREE_ME_SUPPORTED png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0); #endif - /* Changed from info->num_palette to 256 in version 1.2.1 */ + /* Changed from info->num_palette to PNG_MAX_PALETTE_LENGTH in version + 1.2.1 */ png_ptr->hist = (png_uint_16p)png_malloc_warn(png_ptr, - (png_uint_32)(256 * png_sizeof (png_uint_16))); + (png_uint_32)(PNG_MAX_PALETTE_LENGTH * png_sizeof (png_uint_16))); if (png_ptr->hist == NULL) { png_warning(png_ptr, "Insufficient memory for hIST chunk data."); @@ -303,13 +318,13 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr, * 5. The color_type is RGB or RGBA */ if((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&png_ptr->mng_features_permitted) - png_warning(png_ptr,"MNG features are not allowed in a PNG datastream\n"); + png_warning(png_ptr,"MNG features are not allowed in a PNG datastream"); if(filter_type != PNG_FILTER_TYPE_BASE) { if(!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && (filter_type == PNG_INTRAPIXEL_DIFFERENCING) && ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) && - (color_type == PNG_COLOR_TYPE_RGB || + (color_type == PNG_COLOR_TYPE_RGB || color_type == PNG_COLOR_TYPE_RGB_ALPHA))) png_error(png_ptr, "Unknown filter method in IHDR"); if(png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) @@ -517,6 +532,17 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr, if (png_ptr == NULL || info_ptr == NULL) return; + if (num_palette < 0 || num_palette > PNG_MAX_PALETTE_LENGTH) + { + if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + png_error(png_ptr, "Invalid palette length"); + else + { + png_warning(png_ptr, "Invalid palette length"); + return; + } + } + /* * It may not actually be necessary to set png_ptr->palette here; * we do it for backward compatibility with the way the png_handle_tRNS @@ -526,11 +552,13 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr, png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0); #endif - /* Changed in libpng-1.2.1 to allocate 256 instead of num_palette entries, + /* Changed in libpng-1.2.1 to allocate PNG_MAX_PALETTE_LENGTH instead + of num_palette entries, in case of an invalid PNG file that has too-large sample values. */ png_ptr->palette = (png_colorp)png_malloc(png_ptr, - 256 * png_sizeof(png_color)); - png_memset(png_ptr->palette, 0, 256 * png_sizeof(png_color)); + PNG_MAX_PALETTE_LENGTH * png_sizeof(png_color)); + png_memset(png_ptr->palette, 0, PNG_MAX_PALETTE_LENGTH * + png_sizeof(png_color)); png_memcpy(png_ptr->palette, palette, num_palette * png_sizeof (png_color)); info_ptr->palette = png_ptr->palette; info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette; @@ -890,10 +918,11 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr, #ifdef PNG_FREE_ME_SUPPORTED png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0); #endif - /* Changed from num_trans to 256 in version 1.2.1 */ + /* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */ png_ptr->trans = info_ptr->trans = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); - png_memcpy(info_ptr->trans, trans, (png_size_t)num_trans); + (png_uint_32)PNG_MAX_PALETTE_LENGTH); + if (num_trans <= PNG_MAX_PALETTE_LENGTH) + png_memcpy(info_ptr->trans, trans, (png_size_t)num_trans); #ifdef PNG_FREE_ME_SUPPORTED info_ptr->free_me |= PNG_FREE_TRNS; #else @@ -921,6 +950,9 @@ png_set_sPLT(png_structp png_ptr, png_sPLT_tp np; int i; + if (png_ptr == NULL || info_ptr == NULL) + return; + np = (png_sPLT_tp)png_malloc_warn(png_ptr, (info_ptr->splt_palettes_num + nentries) * png_sizeof(png_sPLT_t)); if (np == NULL) @@ -944,10 +976,10 @@ png_set_sPLT(png_structp png_ptr, /* TODO: use png_malloc_warn */ png_strcpy(to->name, from->name); to->entries = (png_sPLT_entryp)png_malloc(png_ptr, - from->nentries * png_sizeof(png_sPLT_t)); + from->nentries * png_sizeof(png_sPLT_entry)); /* TODO: use png_malloc_warn */ png_memcpy(to->entries, from->entries, - from->nentries * png_sizeof(png_sPLT_t)); + from->nentries * png_sizeof(png_sPLT_entry)); to->nentries = from->nentries; to->depth = from->depth; } @@ -1023,13 +1055,14 @@ png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr, } #endif +#if defined(PNG_1_0_X) || defined(PNG_1_2_X) #if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) void PNGAPI png_permit_empty_plte (png_structp png_ptr, int empty_plte_permitted) { /* This function is deprecated in favor of png_permit_mng_features() - and will be removed from libpng-2.0.0 */ + and will be removed from libpng-1.3.0 */ png_debug(1, "in png_permit_empty_plte, DEPRECATED.\n"); if (png_ptr == NULL) return; @@ -1038,6 +1071,7 @@ png_permit_empty_plte (png_structp png_ptr, int empty_plte_permitted) ((empty_plte_permitted & PNG_FLAG_MNG_EMPTY_PLTE))); } #endif +#endif #if defined(PNG_MNG_FEATURES_SUPPORTED) png_uint_32 PNGAPI @@ -1059,6 +1093,8 @@ png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep { png_bytep new_list, p; int i, old_num_chunks; + if (png_ptr == NULL) + return; if (num_chunks == 0) { if(keep == PNG_HANDLE_CHUNK_ALWAYS || keep == PNG_HANDLE_CHUNK_IF_SAFE) @@ -1102,6 +1138,8 @@ png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn) { png_debug(1, "in png_set_read_user_chunk_fn\n"); + if (png_ptr == NULL) + return; png_ptr->read_user_chunk_fn = read_user_chunk_fn; png_ptr->user_chunk_ptr = user_chunk_ptr; } @@ -1128,6 +1166,8 @@ png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers) void PNGAPI png_set_compression_buffer_size(png_structp png_ptr, png_uint_32 size) { + if (png_ptr == NULL) + return; if(png_ptr->zbuf) png_free(png_ptr, png_ptr->zbuf); png_ptr->zbuf_size = (png_size_t)size; @@ -1154,6 +1194,9 @@ png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags) png_uint_32 settable_asm_flags; png_uint_32 settable_mmx_flags; + if (png_ptr == NULL) + return; + settable_mmx_flags = #ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW PNG_ASM_FLAG_MMX_READ_COMBINE_ROW | @@ -1181,7 +1224,7 @@ png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags) } /* we're replacing the settable bits with those passed in by the user, - * so first zero them out of the master copy, then logical-OR in the + * so first zero them out of the master copy, then bitwise-OR in the * allowed subset that was requested */ png_ptr->asm_flags &= ~settable_asm_flags; /* zero them */ @@ -1196,6 +1239,8 @@ png_set_mmx_thresholds (png_structp png_ptr, png_byte mmx_bitdepth_threshold, png_uint_32 mmx_rowbytes_threshold) { + if (png_ptr == NULL) + return; png_ptr->mmx_bitdepth_threshold = mmx_bitdepth_threshold; png_ptr->mmx_rowbytes_threshold = mmx_rowbytes_threshold; } @@ -1211,9 +1256,11 @@ png_set_user_limits (png_structp png_ptr, png_uint_32 user_width_max, * rejected by png_set_IHDR(). To accept any PNG datastream * regardless of dimensions, set both limits to 0x7ffffffL. */ + if(png_ptr == NULL) return; png_ptr->user_width_max = user_width_max; png_ptr->user_height_max = user_height_max; } #endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */ #endif /* ?PNG_1_0_X */ +#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff --git a/Build/source/libs/libpng/pngtest.c b/Build/source/libs/libpng/pngtest.c index f2085e1e550..f14de7cf35a 100644 --- a/Build/source/libs/libpng/pngtest.c +++ b/Build/source/libs/libpng/pngtest.c @@ -1,7 +1,7 @@ /* pngtest.c - a simple test program to test libpng * - * libpng 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.6 - August 15, 2004 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2004 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) @@ -44,7 +44,6 @@ #else # include <stdio.h> # include <stdlib.h> -# include <assert.h> # define READFILE(file, data, length, check) \ check=(png_size_t)fread(data,(png_size_t)1,length,file) # define WRITEFILE(file, data, length, check) \ @@ -538,7 +537,6 @@ png_debug_malloc(png_structp png_ptr, png_uint_32 size) png_memset(pinfo->pointer, 0xdd, pinfo->size); if(verbose) printf("png_malloc %lu bytes at %x\n",size,pinfo->pointer); - assert(pinfo->size != 12345678); return (png_voidp)(pinfo->pointer); } } @@ -1435,7 +1433,7 @@ main(int argc, char *argv[]) current_allocation); while (pinfo != NULL) { - fprintf(STDERR, " %lu bytes at %x\n", pinfo->size, + fprintf(STDERR, " %lu bytes at %x\n", pinfo->size, (unsigned int) pinfo->pointer); pinfo = pinfo->next; } @@ -1551,4 +1549,4 @@ main(int argc, char *argv[]) } /* Generate a compiler error if there is an old png.h in the search path. */ -typedef version_1_2_8 your_png_h_is_not_version_1_2_8; +typedef version_1_2_14 your_png_h_is_not_version_1_2_14; diff --git a/Build/source/libs/libpng/pngtrans.c b/Build/source/libs/libpng/pngtrans.c index 9003a2109bf..25f42c871be 100644 --- a/Build/source/libs/libpng/pngtrans.c +++ b/Build/source/libs/libpng/pngtrans.c @@ -1,9 +1,9 @@ /* pngtrans.c - transforms the data in a row (used by both readers and writers) * - * libpng 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.13 November 13, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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,12 +11,14 @@ #define PNG_INTERNAL #include "png.h" +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) /* turn on BGR-to-RGB mapping */ void PNGAPI png_set_bgr(png_structp png_ptr) { png_debug(1, "in png_set_bgr\n"); + if(png_ptr == NULL) return; png_ptr->transformations |= PNG_BGR; } #endif @@ -27,6 +29,7 @@ void PNGAPI png_set_swap(png_structp png_ptr) { png_debug(1, "in png_set_swap\n"); + if(png_ptr == NULL) return; if (png_ptr->bit_depth == 16) png_ptr->transformations |= PNG_SWAP_BYTES; } @@ -38,6 +41,7 @@ void PNGAPI png_set_packing(png_structp png_ptr) { png_debug(1, "in png_set_packing\n"); + if(png_ptr == NULL) return; if (png_ptr->bit_depth < 8) { png_ptr->transformations |= PNG_PACK; @@ -52,6 +56,7 @@ void PNGAPI png_set_packswap(png_structp png_ptr) { png_debug(1, "in png_set_packswap\n"); + if(png_ptr == NULL) return; if (png_ptr->bit_depth < 8) png_ptr->transformations |= PNG_PACKSWAP; } @@ -62,6 +67,7 @@ void PNGAPI png_set_shift(png_structp png_ptr, png_color_8p true_bits) { png_debug(1, "in png_set_shift\n"); + if(png_ptr == NULL) return; png_ptr->transformations |= PNG_SHIFT; png_ptr->shift = *true_bits; } @@ -73,7 +79,7 @@ int PNGAPI png_set_interlace_handling(png_structp png_ptr) { png_debug(1, "in png_set_interlace handling\n"); - if (png_ptr->interlaced) + if (png_ptr && png_ptr->interlaced) { png_ptr->transformations |= PNG_INTERLACE; return (7); @@ -93,6 +99,7 @@ void PNGAPI png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc) { png_debug(1, "in png_set_filler\n"); + if(png_ptr == NULL) return; png_ptr->transformations |= PNG_FILLER; png_ptr->filler = (png_byte)filler; if (filler_loc == PNG_FILLER_AFTER) @@ -125,6 +132,7 @@ void PNGAPI png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc) { png_debug(1, "in png_set_add_alpha\n"); + if(png_ptr == NULL) return; png_set_filler(png_ptr, filler, filler_loc); png_ptr->transformations |= PNG_ADD_ALPHA; } @@ -138,6 +146,7 @@ void PNGAPI png_set_swap_alpha(png_structp png_ptr) { png_debug(1, "in png_set_swap_alpha\n"); + if(png_ptr == NULL) return; png_ptr->transformations |= PNG_SWAP_ALPHA; } #endif @@ -148,6 +157,7 @@ void PNGAPI png_set_invert_alpha(png_structp png_ptr) { png_debug(1, "in png_set_invert_alpha\n"); + if(png_ptr == NULL) return; png_ptr->transformations |= PNG_INVERT_ALPHA; } #endif @@ -157,6 +167,7 @@ void PNGAPI png_set_invert_mono(png_structp png_ptr) { png_debug(1, "in png_set_invert_mono\n"); + if(png_ptr == NULL) return; png_ptr->transformations |= PNG_INVERT_MONO; } @@ -241,7 +252,7 @@ png_do_swap(png_row_infop row_info, png_bytep row) #endif #if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED) -static png_byte onebppswaptable[256] = { +static PNG_CONST png_byte onebppswaptable[256] = { 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, @@ -276,7 +287,7 @@ static png_byte onebppswaptable[256] = { 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF }; -static png_byte twobppswaptable[256] = { +static PNG_CONST png_byte twobppswaptable[256] = { 0x00, 0x40, 0x80, 0xC0, 0x10, 0x50, 0x90, 0xD0, 0x20, 0x60, 0xA0, 0xE0, 0x30, 0x70, 0xB0, 0xF0, 0x04, 0x44, 0x84, 0xC4, 0x14, 0x54, 0x94, 0xD4, @@ -311,7 +322,7 @@ static png_byte twobppswaptable[256] = { 0x2F, 0x6F, 0xAF, 0xEF, 0x3F, 0x7F, 0xBF, 0xFF }; -static png_byte fourbppswaptable[256] = { +static PNG_CONST png_byte fourbppswaptable[256] = { 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0, 0x01, 0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71, @@ -362,11 +373,11 @@ png_do_packswap(png_row_infop row_info, png_bytep row) end = row + row_info->rowbytes; if (row_info->bit_depth == 1) - table = onebppswaptable; + table = (png_bytep)onebppswaptable; else if (row_info->bit_depth == 2) - table = twobppswaptable; + table = (png_bytep)twobppswaptable; else if (row_info->bit_depth == 4) - table = fourbppswaptable; + table = (png_bytep)fourbppswaptable; else return; @@ -620,6 +631,7 @@ png_set_user_transform_info(png_structp png_ptr, png_voidp user_transform_ptr, int user_transform_depth, int user_transform_channels) { png_debug(1, "in png_set_user_transform_info\n"); + if(png_ptr == NULL) return; #if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) png_ptr->user_transform_ptr = user_transform_ptr; png_ptr->user_transform_depth = (png_byte)user_transform_depth; @@ -640,11 +652,10 @@ png_set_user_transform_info(png_structp png_ptr, png_voidp png_voidp PNGAPI png_get_user_transform_ptr(png_structp png_ptr) { + if (png_ptr == NULL) return (NULL); #if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) return ((png_voidp)png_ptr->user_transform_ptr); -#else - if(png_ptr) - return (NULL); - return (NULL); #endif + return (NULL); } +#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff --git a/Build/source/libs/libpng/pngvcrd.c b/Build/source/libs/libpng/pngvcrd.c index 940a7fc0f4e..d1c6405e5fe 100644 --- a/Build/source/libs/libpng/pngvcrd.c +++ b/Build/source/libs/libpng/pngvcrd.c @@ -1,8 +1,9 @@ + /* pngvcrd.c - mixed C/assembler version of utilities to read a PNG file * * For Intel x86 CPU and Microsoft Visual C++ compiler * - * libpng version 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.6 - August 15, 2004 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2004 Glenn Randers-Pehrson * Copyright (c) 1998, Intel Corporation diff --git a/Build/source/libs/libpng/pngwio.c b/Build/source/libs/libpng/pngwio.c index d5d61f49e0a..4d9d57e36a7 100644 --- a/Build/source/libs/libpng/pngwio.c +++ b/Build/source/libs/libpng/pngwio.c @@ -1,9 +1,9 @@ /* pngwio.c - functions for data output * - * libpng 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.13 November 13, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2002 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.) * @@ -45,6 +45,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length) { png_uint_32 check; + if(png_ptr == NULL) return; #if defined(_WIN32_WCE) if ( !WriteFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) ) check = 0; @@ -70,6 +71,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length) png_byte *near_data; /* Needs to be "png_byte *" instead of "png_bytep" */ png_FILE_p io_ptr; + if(png_ptr == NULL) return; /* Check if data really is near. If so, use usual code. */ near_data = (png_byte *)CVT_PTR_NOCHECK(data); io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); @@ -131,6 +133,9 @@ png_default_flush(png_structp png_ptr) { #if !defined(_WIN32_WCE) png_FILE_p io_ptr; +#endif + if(png_ptr == NULL) return; +#if !defined(_WIN32_WCE) io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); if (io_ptr != NULL) fflush(io_ptr); @@ -165,6 +170,7 @@ void PNGAPI png_set_write_fn(png_structp png_ptr, png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn) { + if(png_ptr == NULL) return; png_ptr->io_ptr = io_ptr; #if !defined(PNG_NO_STDIO) diff --git a/Build/source/libs/libpng/pngwrite.c b/Build/source/libs/libpng/pngwrite.c index 3246fdaafcf..bc4821869e8 100644 --- a/Build/source/libs/libpng/pngwrite.c +++ b/Build/source/libs/libpng/pngwrite.c @@ -1,9 +1,9 @@ /* pngwrite.c - general routines to write a PNG file * - * libpng 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.13 November 13, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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.) */ @@ -26,13 +26,15 @@ void PNGAPI png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr) { png_debug(1, "in png_write_info_before_PLTE\n"); + if (png_ptr == NULL || info_ptr == NULL) + return; if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE)) { png_write_sig(png_ptr); /* write PNG signature */ #if defined(PNG_MNG_FEATURES_SUPPORTED) if((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&(png_ptr->mng_features_permitted)) { - png_warning(png_ptr,"MNG features are not allowed in a PNG datastream\n"); + png_warning(png_ptr,"MNG features are not allowed in a PNG datastream"); png_ptr->mng_features_permitted=0; } #endif @@ -128,13 +130,16 @@ png_write_info(png_structp png_ptr, png_infop info_ptr) png_debug(1, "in png_write_info\n"); + if (png_ptr == NULL || info_ptr == NULL) + return; + png_write_info_before_PLTE(png_ptr, info_ptr); if (info_ptr->valid & PNG_INFO_PLTE) png_write_PLTE(png_ptr, info_ptr->palette, (png_uint_32)info_ptr->num_palette); else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - png_error(png_ptr, "Valid palette required for paletted images\n"); + png_error(png_ptr, "Valid palette required for paletted images"); #if defined(PNG_WRITE_tRNS_SUPPORTED) if (info_ptr->valid & PNG_INFO_tRNS) @@ -183,7 +188,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr) info_ptr->scal_s_width, info_ptr->scal_s_height); #else png_warning(png_ptr, - "png_write_sCAL not supported; sCAL chunk not written.\n"); + "png_write_sCAL not supported; sCAL chunk not written."); #endif #endif #endif @@ -222,7 +227,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr) info_ptr->text[i].lang_key, info_ptr->text[i].text); #else - png_warning(png_ptr, "Unable to write international text\n"); + png_warning(png_ptr, "Unable to write international text"); #endif /* Mark this chunk as written */ info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; @@ -236,7 +241,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr) info_ptr->text[i].text, 0, info_ptr->text[i].compression); #else - png_warning(png_ptr, "Unable to write compressed text\n"); + png_warning(png_ptr, "Unable to write compressed text"); #endif /* Mark this chunk as written */ info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR; @@ -249,7 +254,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr) info_ptr->text[i].text, 0); #else - png_warning(png_ptr, "Unable to write uncompressed text\n"); + png_warning(png_ptr, "Unable to write uncompressed text"); #endif /* Mark this chunk as written */ info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; @@ -290,6 +295,8 @@ void PNGAPI png_write_end(png_structp png_ptr, png_infop info_ptr) { png_debug(1, "in png_write_end\n"); + if (png_ptr == NULL) + return; if (!(png_ptr->mode & PNG_HAVE_IDAT)) png_error(png_ptr, "No IDATs written into file"); @@ -323,7 +330,7 @@ png_write_end(png_structp png_ptr, png_infop info_ptr) info_ptr->text[i].lang_key, info_ptr->text[i].text); #else - png_warning(png_ptr, "Unable to write international text\n"); + png_warning(png_ptr, "Unable to write international text"); #endif /* Mark this chunk as written */ info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; @@ -336,7 +343,7 @@ png_write_end(png_structp png_ptr, png_infop info_ptr) info_ptr->text[i].text, 0, info_ptr->text[i].compression); #else - png_warning(png_ptr, "Unable to write compressed text\n"); + png_warning(png_ptr, "Unable to write compressed text"); #endif /* Mark this chunk as written */ info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR; @@ -348,7 +355,7 @@ png_write_end(png_structp png_ptr, png_infop info_ptr) png_write_tEXt(png_ptr, info_ptr->text[i].key, info_ptr->text[i].text, 0); #else - png_warning(png_ptr, "Unable to write uncompressed text\n"); + png_warning(png_ptr, "Unable to write uncompressed text"); #endif /* Mark this chunk as written */ @@ -554,6 +561,8 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, } /* Initialize png_ptr structure, and allocate any memory needed */ +#if defined(PNG_1_0_X) || defined(PNG_1_2_X) +/* Deprecated. */ #undef png_write_init void PNGAPI png_write_init(png_structp png_ptr) @@ -567,6 +576,7 @@ png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t png_info_size) { /* We only come here via pre-1.0.12-compiled applications */ + if(png_ptr == NULL) return; #if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) if(png_sizeof(png_struct) > png_struct_size || png_sizeof(png_info) > png_info_size) @@ -604,6 +614,7 @@ png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver, } png_write_init_3(&png_ptr, user_png_ver, png_struct_size); } +#endif /* PNG_1_0_X || PNG_1_2_X */ void PNGAPI @@ -614,7 +625,12 @@ png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, #ifdef PNG_SETJMP_SUPPORTED jmp_buf tmp_jmp; /* to save current jump buffer */ #endif + int i = 0; + + if (png_ptr == NULL) + return; + do { if (user_png_ver[i] != png_libpng_ver[i]) @@ -691,6 +707,10 @@ png_write_rows(png_structp png_ptr, png_bytepp row, png_bytepp rp; /* row pointer */ png_debug(1, "in png_write_rows\n"); + + if (png_ptr == NULL) + return; + /* loop through the rows */ for (i = 0, rp = row; i < num_rows; i++, rp++) { @@ -708,6 +728,9 @@ png_write_image(png_structp png_ptr, png_bytepp image) int pass, num_pass; /* pass variables */ png_bytepp rp; /* points to current row */ + if (png_ptr == NULL) + return; + png_debug(1, "in png_write_image\n"); #if defined(PNG_WRITE_INTERLACING_SUPPORTED) /* intialize interlace handling. If image is not interlaced, @@ -731,8 +754,11 @@ png_write_image(png_structp png_ptr, png_bytepp image) void PNGAPI png_write_row(png_structp png_ptr, png_bytep row) { + if (png_ptr == NULL) + return; png_debug2(1, "in png_write_row (row %ld, pass %d)\n", 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) { @@ -906,6 +932,8 @@ void PNGAPI png_set_flush(png_structp png_ptr, int nrows) { png_debug(1, "in png_set_flush\n"); + if (png_ptr == NULL) + return; png_ptr->flush_dist = (nrows < 0 ? 0 : nrows); } @@ -916,6 +944,8 @@ png_write_flush(png_structp png_ptr) int wrote_IDAT; png_debug(1, "in png_write_flush\n"); + if (png_ptr == NULL) + return; /* We have already written out all of the data */ if (png_ptr->row_number >= png_ptr->num_rows) return; @@ -1092,6 +1122,8 @@ void PNGAPI png_set_filter(png_structp png_ptr, int method, int filters) { png_debug(1, "in png_set_filter\n"); + if (png_ptr == NULL) + return; #if defined(PNG_MNG_FEATURES_SUPPORTED) if((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && (method == PNG_INTRAPIXEL_DIFFERENCING)) @@ -1200,6 +1232,8 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method, int i; png_debug(1, "in png_set_filter_heuristics\n"); + if (png_ptr == NULL) + return; if (heuristic_method >= PNG_FILTER_HEURISTIC_LAST) { png_warning(png_ptr, "Unknown filter heuristic method"); @@ -1312,6 +1346,8 @@ void PNGAPI png_set_compression_level(png_structp png_ptr, int level) { png_debug(1, "in png_set_compression_level\n"); + if (png_ptr == NULL) + return; png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_LEVEL; png_ptr->zlib_level = level; } @@ -1320,6 +1356,8 @@ void PNGAPI png_set_compression_mem_level(png_structp png_ptr, int mem_level) { png_debug(1, "in png_set_compression_mem_level\n"); + if (png_ptr == NULL) + return; png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL; png_ptr->zlib_mem_level = mem_level; } @@ -1328,6 +1366,8 @@ void PNGAPI png_set_compression_strategy(png_structp png_ptr, int strategy) { png_debug(1, "in png_set_compression_strategy\n"); + if (png_ptr == NULL) + return; png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY; png_ptr->zlib_strategy = strategy; } @@ -1335,6 +1375,8 @@ png_set_compression_strategy(png_structp png_ptr, int strategy) void PNGAPI png_set_compression_window_bits(png_structp png_ptr, int window_bits) { + if (png_ptr == NULL) + return; if (window_bits > 15) png_warning(png_ptr, "Only compression windows <= 32k supported by PNG"); else if (window_bits < 8) @@ -1355,6 +1397,8 @@ void PNGAPI png_set_compression_method(png_structp png_ptr, int method) { png_debug(1, "in png_set_compression_method\n"); + if (png_ptr == NULL) + return; if (method != 8) png_warning(png_ptr, "Only compression method 8 is supported by PNG"); png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_METHOD; @@ -1364,6 +1408,8 @@ png_set_compression_method(png_structp png_ptr, int method) void PNGAPI png_set_write_status_fn(png_structp png_ptr, png_write_status_ptr write_row_fn) { + if (png_ptr == NULL) + return; png_ptr->write_row_fn = write_row_fn; } @@ -1373,6 +1419,8 @@ png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr write_user_transform_fn) { png_debug(1, "in png_set_write_user_transform_fn\n"); + if (png_ptr == NULL) + return; png_ptr->transformations |= PNG_USER_TRANSFORM; png_ptr->write_user_transform_fn = write_user_transform_fn; } @@ -1384,6 +1432,8 @@ void PNGAPI png_write_png(png_structp png_ptr, png_infop info_ptr, int transforms, voidp params) { + if (png_ptr == NULL || info_ptr == NULL) + return; #if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) /* invert the alpha channel from opacity to transparency */ if (transforms & PNG_TRANSFORM_INVERT_ALPHA) diff --git a/Build/source/libs/libpng/pngwtran.c b/Build/source/libs/libpng/pngwtran.c index f1c8b3e62a5..0372fe656ce 100644 --- a/Build/source/libs/libpng/pngwtran.c +++ b/Build/source/libs/libpng/pngwtran.c @@ -1,9 +1,9 @@ /* pngwtran.c - transforms the data in a row for PNG writers * - * libpng version 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.9 April 14, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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.) */ @@ -60,14 +60,14 @@ png_do_write_transformations(png_structp png_ptr) png_do_shift(&(png_ptr->row_info), png_ptr->row_buf + 1, &(png_ptr->shift)); #endif -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_ALPHA) - png_do_write_invert_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif #if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) if (png_ptr->transformations & PNG_SWAP_ALPHA) png_do_write_swap_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); #endif +#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) + if (png_ptr->transformations & PNG_INVERT_ALPHA) + png_do_write_invert_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); +#endif #if defined(PNG_WRITE_BGR_SUPPORTED) if (png_ptr->transformations & PNG_BGR) png_do_bgr(&(png_ptr->row_info), png_ptr->row_buf + 1); @@ -439,9 +439,12 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) png_uint_32 row_width = row_info->width; for (i = 0, sp = dp = row; i < row_width; i++) { + /* does nothing *(dp++) = *(sp++); *(dp++) = *(sp++); *(dp++) = *(sp++); + */ + sp+=3; dp = sp; *(dp++) = (png_byte)(255 - *(sp++)); } } @@ -454,12 +457,15 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) for (i = 0, sp = dp = row; i < row_width; i++) { + /* does nothing *(dp++) = *(sp++); *(dp++) = *(sp++); *(dp++) = *(sp++); *(dp++) = *(sp++); *(dp++) = *(sp++); *(dp++) = *(sp++); + */ + sp+=6; dp = sp; *(dp++) = (png_byte)(255 - *(sp++)); *(dp++) = (png_byte)(255 - *(sp++)); } @@ -489,8 +495,11 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) for (i = 0, sp = dp = row; i < row_width; i++) { + /* does nothing *(dp++) = *(sp++); *(dp++) = *(sp++); + */ + sp+=2; dp = sp; *(dp++) = (png_byte)(255 - *(sp++)); *(dp++) = (png_byte)(255 - *(sp++)); } diff --git a/Build/source/libs/libpng/pngwutil.c b/Build/source/libs/libpng/pngwutil.c index dd7b150b75f..f7e72e36f4a 100644 --- a/Build/source/libs/libpng/pngwutil.c +++ b/Build/source/libs/libpng/pngwutil.c @@ -1,9 +1,9 @@ /* pngwutil.c - utilities to write a PNG file * - * libpng version 1.2.8 - December 3, 2004 + * Last changed in libpng 1.2.13 November 13, 2006 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson + * Copyright (c) 1998-2006 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.) */ @@ -16,7 +16,7 @@ * with unsigned numbers for convenience, although one supported * ancillary chunk uses signed (two's complement) numbers. */ -void /* PRIVATE */ +void PNGAPI png_save_uint_32(png_bytep buf, png_uint_32 i) { buf[0] = (png_byte)((i >> 24) & 0xff); @@ -25,12 +25,11 @@ png_save_uint_32(png_bytep buf, png_uint_32 i) buf[3] = (png_byte)(i & 0xff); } -#if defined(PNG_WRITE_pCAL_SUPPORTED) || defined(PNG_WRITE_oFFs_SUPPORTED) /* The png_save_int_32 function assumes integers are stored in two's * complement format. If this isn't the case, then this routine needs to * be modified to write data in two's complement format. */ -void /* PRIVATE */ +void PNGAPI png_save_int_32(png_bytep buf, png_int_32 i) { buf[0] = (png_byte)((i >> 24) & 0xff); @@ -38,13 +37,12 @@ png_save_int_32(png_bytep buf, png_int_32 i) buf[2] = (png_byte)((i >> 8) & 0xff); buf[3] = (png_byte)(i & 0xff); } -#endif /* Place a 16-bit number into a buffer in PNG byte order. * The parameter is declared unsigned int, not png_uint_16, * just to avoid potential problems on pre-ANSI C compilers. */ -void /* PRIVATE */ +void PNGAPI png_save_uint_16(png_bytep buf, unsigned int i) { buf[0] = (png_byte)((i >> 8) & 0xff); @@ -64,6 +62,7 @@ void PNGAPI png_write_chunk(png_structp png_ptr, png_bytep chunk_name, png_bytep data, png_size_t length) { + if(png_ptr == NULL) return; png_write_chunk_start(png_ptr, chunk_name, (png_uint_32)length); png_write_chunk_data(png_ptr, data, length); png_write_chunk_end(png_ptr); @@ -79,6 +78,7 @@ png_write_chunk_start(png_structp png_ptr, png_bytep chunk_name, { png_byte buf[4]; png_debug2(0, "Writing %s chunk (%lu bytes)\n", chunk_name, length); + if(png_ptr == NULL) return; /* write the length */ png_save_uint_32(buf, length); @@ -100,6 +100,7 @@ void PNGAPI png_write_chunk_data(png_structp png_ptr, png_bytep data, png_size_t length) { /* write the data, and run the CRC over it */ + if(png_ptr == NULL) return; if (data != NULL && length > 0) { png_calculate_crc(png_ptr, data, length); @@ -113,6 +114,8 @@ png_write_chunk_end(png_structp png_ptr) { png_byte buf[4]; + if(png_ptr == NULL) return; + /* write the crc */ png_save_uint_32(buf, png_ptr->crc); @@ -161,9 +164,11 @@ png_text_compress(png_structp png_ptr, { int ret; - comp->num_output_ptr = comp->max_output_ptr = 0; + comp->num_output_ptr = 0; + comp->max_output_ptr = 0; comp->output_ptr = NULL; comp->input = NULL; + comp->input_len = 0; /* we may just want to pass the text right through */ if (compression == PNG_TEXT_COMPRESSION_NONE) @@ -728,8 +733,16 @@ png_write_iCCP(png_structp png_ptr, png_charp name, int compression_type, png_size_t name_len; png_charp new_name; compression_state comp; + int embedded_profile_len = 0; png_debug(1, "in png_write_iCCP\n"); + + comp.num_output_ptr = 0; + comp.max_output_ptr = 0; + comp.output_ptr = NULL; + comp.input = NULL; + comp.input_len = 0; + if (name == NULL || (name_len = png_check_keyword(png_ptr, name, &new_name)) == 0) { @@ -743,6 +756,24 @@ png_write_iCCP(png_structp png_ptr, png_charp name, int compression_type, if (profile == NULL) profile_len = 0; + if (profile_len > 3) + embedded_profile_len = ((*(profile ))<<24) | ((*(profile+1))<<16) | + ((*(profile+2))<< 8) | ((*(profile+3)) ); + + if (profile_len < embedded_profile_len) + { + png_warning(png_ptr, + "Embedded profile length too large in iCCP chunk"); + return; + } + + if (profile_len > embedded_profile_len) + { + png_warning(png_ptr, + "Truncating profile to actual length in iCCP chunk"); + profile_len = embedded_profile_len; + } + if (profile_len) profile_len = png_text_compress(png_ptr, profile, (png_size_t)profile_len, PNG_COMPRESSION_TYPE_BASE, &comp); @@ -930,8 +961,7 @@ png_write_cHRM(png_structp png_ptr, double white_x, double white_y, itemp = (png_uint_32)(white_y * 100000.0 + 0.5); png_save_uint_32(buf + 4, itemp); - if (red_x < 0 || red_x > 0.8 || red_y < 0 || red_y > 0.8 || - red_x + red_y > 1.0) + if (red_x < 0 || red_y < 0 || red_x + red_y > 1.0) { png_warning(png_ptr, "Invalid cHRM red point specified"); return; @@ -941,8 +971,7 @@ png_write_cHRM(png_structp png_ptr, double white_x, double white_y, itemp = (png_uint_32)(red_y * 100000.0 + 0.5); png_save_uint_32(buf + 12, itemp); - if (green_x < 0 || green_x > 0.8 || green_y < 0 || green_y > 0.8 || - green_x + green_y > 1.0) + if (green_x < 0 || green_y < 0 || green_x + green_y > 1.0) { png_warning(png_ptr, "Invalid cHRM green point specified"); return; @@ -952,8 +981,7 @@ png_write_cHRM(png_structp png_ptr, double white_x, double white_y, itemp = (png_uint_32)(green_y * 100000.0 + 0.5); png_save_uint_32(buf + 20, itemp); - if (blue_x < 0 || blue_x > 0.8 || blue_y < 0 || blue_y > 0.8 || - blue_x + blue_y > 1.0) + if (blue_x < 0 || blue_y < 0 || blue_x + blue_y > 1.0) { png_warning(png_ptr, "Invalid cHRM blue point specified"); return; @@ -991,7 +1019,7 @@ png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x, png_save_uint_32(buf, (png_uint_32)white_x); png_save_uint_32(buf + 4, (png_uint_32)white_y); - if (red_x > 80000L || red_y > 80000L || red_x + red_y > 100000L) + if (red_x + red_y > 100000L) { png_warning(png_ptr, "Invalid cHRM fixed red point specified"); return; @@ -999,7 +1027,7 @@ png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x, png_save_uint_32(buf + 8, (png_uint_32)red_x); png_save_uint_32(buf + 12, (png_uint_32)red_y); - if (green_x > 80000L || green_y > 80000L || green_x + green_y > 100000L) + if (green_x + green_y > 100000L) { png_warning(png_ptr, "Invalid fixed cHRM green point specified"); return; @@ -1007,7 +1035,7 @@ png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x, png_save_uint_32(buf + 16, (png_uint_32)green_x); png_save_uint_32(buf + 20, (png_uint_32)green_y); - if (blue_x > 80000L || blue_y > 80000L || blue_x + blue_y > 100000L) + if (blue_x + blue_y > 100000L) { png_warning(png_ptr, "Invalid fixed cHRM blue point specified"); return; @@ -1344,6 +1372,12 @@ png_write_zTXt(png_structp png_ptr, png_charp key, png_charp text, png_debug(1, "in png_write_zTXt\n"); + comp.num_output_ptr = 0; + comp.max_output_ptr = 0; + comp.output_ptr = NULL; + comp.input = NULL; + comp.input_len = 0; + if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0) { png_warning(png_ptr, "Empty keyword in zTXt chunk"); @@ -1397,6 +1431,11 @@ png_write_iTXt(png_structp png_ptr, int compression, png_charp key, png_debug(1, "in png_write_iTXt\n"); + comp.num_output_ptr = 0; + comp.max_output_ptr = 0; + comp.output_ptr = NULL; + comp.input = NULL; + if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0) { png_warning(png_ptr, "Empty keyword in iTXt chunk"); @@ -1552,39 +1591,41 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0, /* write the sCAL chunk */ #if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) void /* PRIVATE */ -png_write_sCAL(png_structp png_ptr, int unit, double width,double height) +png_write_sCAL(png_structp png_ptr, int unit, double width, double height) { #ifdef PNG_USE_LOCAL_ARRAYS PNG_sCAL; #endif + char buf[64]; png_size_t total_len; - char wbuf[32], hbuf[32]; - png_byte bunit = unit; png_debug(1, "in png_write_sCAL\n"); + buf[0] = (char)unit; #if defined(_WIN32_WCE) /* sprintf() function is not supported on WindowsCE */ { wchar_t wc_buf[32]; + size_t wc_len; swprintf(wc_buf, TEXT("%12.12e"), width); - WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, wbuf, 32, NULL, NULL); + wc_len = wcslen(wc_buf); + WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, buf + 1, wc_len, NULL, NULL); + total_len = wc_len + 2; swprintf(wc_buf, TEXT("%12.12e"), height); - WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, hbuf, 32, NULL, NULL); + wc_len = wcslen(wc_buf); + WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, buf + total_len, wc_len, + NULL, NULL); + total_len += wc_len; } #else - sprintf(wbuf, "%12.12e", width); - sprintf(hbuf, "%12.12e", height); + sprintf(buf + 1, "%12.12e", width); + total_len = 1 + png_strlen(buf + 1) + 1; + sprintf(buf + total_len, "%12.12e", height); + total_len += png_strlen(buf + total_len); #endif - total_len = 1 + png_strlen(wbuf)+1 + png_strlen(hbuf); - - png_debug1(3, "sCAL total length = %d\n", (int)total_len); - png_write_chunk_start(png_ptr, (png_bytep)png_sCAL, (png_uint_32)total_len); - png_write_chunk_data(png_ptr, (png_bytep)&bunit, 1); - png_write_chunk_data(png_ptr, (png_bytep)wbuf, png_strlen(wbuf)+1); - png_write_chunk_data(png_ptr, (png_bytep)hbuf, png_strlen(hbuf)); - png_write_chunk_end(png_ptr); + png_debug1(3, "sCAL total length = %u\n", (unsigned int)total_len); + png_write_chunk(png_ptr, (png_bytep)png_sCAL, (png_bytep)buf, total_len); } #else #ifdef PNG_FIXED_POINT_SUPPORTED @@ -1595,23 +1636,26 @@ png_write_sCAL_s(png_structp png_ptr, int unit, png_charp width, #ifdef PNG_USE_LOCAL_ARRAYS PNG_sCAL; #endif - png_size_t total_len; - char wbuf[32], hbuf[32]; - png_byte bunit = unit; + png_byte buf[64]; + png_size_t wlen, hlen, total_len; png_debug(1, "in png_write_sCAL_s\n"); - png_strcpy(wbuf,(const char *)width); - png_strcpy(hbuf,(const char *)height); - total_len = 1 + png_strlen(wbuf)+1 + png_strlen(hbuf); + wlen = png_strlen(width); + hlen = png_strlen(height); + total_len = wlen + hlen + 2; + if (total_len > 64) + { + png_warning(png_ptr, "Can't write sCAL (buffer too small)"); + return; + } - png_debug1(3, "sCAL total length = %d\n", total_len); - png_write_chunk_start(png_ptr, (png_bytep)png_sCAL, (png_uint_32)total_len); - png_write_chunk_data(png_ptr, (png_bytep)&bunit, 1); - png_write_chunk_data(png_ptr, (png_bytep)wbuf, png_strlen(wbuf)+1); - png_write_chunk_data(png_ptr, (png_bytep)hbuf, png_strlen(hbuf)); + buf[0] = (png_byte)unit; + png_memcpy(buf + 1, width, wlen + 1); /* append the '\0' here */ + png_memcpy(buf + wlen + 2, height, hlen); /* do NOT append the '\0' here */ - png_write_chunk_end(png_ptr); + png_debug1(3, "sCAL total length = %u\n", (unsigned int)total_len); + png_write_chunk(png_ptr, (png_bytep)png_sCAL, buf, total_len); } #endif #endif |