diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-12-20 16:05:28 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-12-20 16:05:28 +0000 |
commit | 79f2291eb9b49abd0c39190e56d893b61eada8f2 (patch) | |
tree | abaee102571e03749ab1a228f9265e5bd41b077d /Build/source/libs/libpng | |
parent | ae9ca1e2640b2a90c0dbb695f95bc6c3d36d42e2 (diff) |
libpng 1.5.7
git-svn-id: svn://tug.org/texlive/trunk@24888 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/libpng')
-rw-r--r-- | Build/source/libs/libpng/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/libs/libpng/Makefile.am | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/Makefile.in | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/config.h.in | 14 | ||||
-rwxr-xr-x | Build/source/libs/libpng/configure | 70 | ||||
-rw-r--r-- | Build/source/libs/libpng/configure.ac | 1 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5-PATCHES/TL-Changes | 14 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/ANNOUNCE | 91 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.5/test-pngtest.sh | 8 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7-PATCHES/ChangeLog (renamed from Build/source/libs/libpng/libpng-1.5.5-PATCHES/ChangeLog) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7-PATCHES/TL-Changes | 17 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/ANNOUNCE | 98 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/CHANGES (renamed from Build/source/libs/libpng/libpng-1.5.5/CHANGES) | 201 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/CMakeLists.txt (renamed from Build/source/libs/libpng/libpng-1.5.5/CMakeLists.txt) | 95 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/INSTALL (renamed from Build/source/libs/libpng/libpng-1.5.5/INSTALL) | 20 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/LICENSE (renamed from Build/source/libs/libpng/libpng-1.5.5/LICENSE) | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/Makefile.am (renamed from Build/source/libs/libpng/libpng-1.5.5/Makefile.am) | 38 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/Makefile.in (renamed from Build/source/libs/libpng/libpng-1.5.5/Makefile.in) | 113 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/README (renamed from Build/source/libs/libpng/libpng-1.5.5/README) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/TODO (renamed from Build/source/libs/libpng/libpng-1.5.5/TODO) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/aclocal.m4 (renamed from Build/source/libs/libpng/libpng-1.5.5/aclocal.m4) | 310 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/arm/filter_neon.S | 225 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.7/autogen.sh (renamed from Build/source/libs/libpng/libpng-1.5.5/autogen.sh) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/config.h.in (renamed from Build/source/libs/libpng/libpng-1.5.5/config.h.in) | 23 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.7/configure (renamed from Build/source/libs/libpng/libpng-1.5.5/configure) | 484 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/configure.ac (renamed from Build/source/libs/libpng/libpng-1.5.5/configure.ac) | 26 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/README.txt | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/COPYING (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/COPYING) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/LICENSE (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/LICENSE) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/Makefile.mingw32 (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.mingw32) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/Makefile.sgi (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.sgi) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/Makefile.unx (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.unx) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/Makefile.w32 (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.w32) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/README (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/makevms.com (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/makevms.com) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readpng.c (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readpng.h (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readpng2.c (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng2.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readpng2.h (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng2.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readppm.c (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readppm.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/rpng-win.c (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng-win.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/rpng-x.c (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng-x.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/rpng2-win.c (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng2-win.c) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/rpng2-x.c (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng2-x.c) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/toucan.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/toucan.png) | bin | 12901 -> 12901 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/wpng.c (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/wpng.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/writepng.c (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/writepng.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/writepng.h (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/writepng.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/libtests/pngvalid.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngvalid.c) | 337 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/README (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/decoder/README (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/decoder/makefile (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/makefile) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/decoder/pngusr.dfa (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/pngusr.dfa) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/decoder/pngusr.h (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/pngusr.h) | 1 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/encoder/README (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/encoder/makefile (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/makefile) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/encoder/pngusr.dfa (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/pngusr.dfa) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/encoder/pngusr.h (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/pngusr.h) | 1 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/preader/README (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/preader/makefile (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/makefile) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/preader/pngusr.dfa (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/pngusr.dfa) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/preader/pngusr.h (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/pngusr.h) | 1 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/README (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/makefile.std (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makefile.std) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/makefile.tc3 (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makefile.tc3) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/makevms.com (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makevms.com) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/png2pnm.bat (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.bat) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/png2pnm.c (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/png2pnm.sh (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.sh) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pngminus.bat (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pngminus.bat) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pngminus.sh (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pngminus.sh) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pnm2png.bat (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.bat) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pnm2png.c (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pnm2png.sh (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.sh) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/README (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g01.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g01.png) | bin | 164 -> 164 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g02.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g02.png) | bin | 104 -> 104 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g04.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g04.png) | bin | 145 -> 145 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g08.png) | bin | 138 -> 138 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g16.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g16.png) | bin | 167 -> 167 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn2c08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn2c08.png) | bin | 145 -> 145 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn2c16.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn2c16.png) | bin | 302 -> 302 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn3p01.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p01.png) | bin | 112 -> 112 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn3p02.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p02.png) | bin | 146 -> 146 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn3p04.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p04.png) | bin | 216 -> 216 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p08.png) | bin | 1286 -> 1286 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn4a08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn4a08.png) | bin | 126 -> 126 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn4a16.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn4a16.png) | bin | 2206 -> 2206 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn6a08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn6a08.png) | bin | 184 -> 184 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn6a16.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn6a16.png) | bin | 3435 -> 3435 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbbn1g04.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn1g04.png) | bin | 429 -> 429 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbbn2c16.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn2c16.png) | bin | 2041 -> 2041 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbbn3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn3p08.png) | bin | 1499 -> 1499 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbgn2c16.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbgn2c16.png) | bin | 2041 -> 2041 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbgn3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbgn3p08.png) | bin | 1499 -> 1499 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbrn2c08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbrn2c08.png) | bin | 1633 -> 1633 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbwn1g16.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbwn1g16.png) | bin | 1313 -> 1313 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbwn3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbwn3p08.png) | bin | 1496 -> 1496 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbyn3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbyn3p08.png) | bin | 1499 -> 1499 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftp0n1g08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n1g08.png) | bin | 719 -> 719 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftp0n2c08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n2c08.png) | bin | 1594 -> 1594 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftp0n3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n3p08.png) | bin | 1476 -> 1476 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftp1n3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp1n3p08.png) | bin | 1483 -> 1483 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/PngFile.c (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/PngFile.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/PngFile.h (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/PngFile.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/README.txt (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/README.txt) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.c (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.dsp (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.dsp) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.dsw (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.dsw) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.ico (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.ico) | bin | 766 -> 766 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.png (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.png) | bin | 208 -> 208 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.rc (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.rc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/cexcept.h (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/cexcept.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/resource.h (renamed from Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/resource.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/example.c (renamed from Build/source/libs/libpng/libpng-1.5.5/example.c) | 16 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.7/libpng-config.in (renamed from Build/source/libs/libpng/libpng-1.5.5/libpng-config.in) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/libpng-manual.txt (renamed from Build/source/libs/libpng/libpng-1.5.5/libpng-manual.txt) | 47 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/libpng.3 (renamed from Build/source/libs/libpng/libpng-1.5.5/libpng.3) | 63 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/libpng.pc.in (renamed from Build/source/libs/libpng/libpng-1.5.5/libpng.pc.in) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/libpngpf.3 (renamed from Build/source/libs/libpng/libpng-1.5.5/libpngpf.3) | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/png.5 (renamed from Build/source/libs/libpng/libpng-1.5.5/png.5) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/png.c (renamed from Build/source/libs/libpng/libpng-1.5.5/png.c) | 169 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/png.h (renamed from Build/source/libs/libpng/libpng-1.5.5/png.h) | 86 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngbar.jpg (renamed from Build/source/libs/libpng/libpng-1.5.5/pngbar.jpg) | bin | 2498 -> 2498 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngbar.png (renamed from Build/source/libs/libpng/libpng-1.5.5/pngbar.png) | bin | 2399 -> 2399 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngconf.h (renamed from Build/source/libs/libpng/libpng-1.5.5/pngconf.h) | 6 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngdebug.h (renamed from Build/source/libs/libpng/libpng-1.5.5/pngdebug.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngerror.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngerror.c) | 16 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngget.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngget.c) | 23 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pnginfo.h (renamed from Build/source/libs/libpng/libpng-1.5.5/pnginfo.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pnglibconf.h (renamed from Build/source/libs/libpng/libpng-1.5.5/pnglibconf.h) | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngmem.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngmem.c) | 16 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngnow.png (renamed from Build/source/libs/libpng/libpng-1.5.5/pngnow.png) | bin | 2069 -> 2069 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngpread.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngpread.c) | 244 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngpriv.h (renamed from Build/source/libs/libpng/libpng-1.5.5/pngpriv.h) | 256 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngread.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngread.c) | 396 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngrio.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngrio.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngrtran.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngrtran.c) | 414 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngrutil.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngrutil.c) | 1122 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngset.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngset.c) | 16 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngstruct.h (renamed from Build/source/libs/libpng/libpng-1.5.5/pngstruct.h) | 40 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngtest.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngtest.c) | 31 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngtest.png (renamed from Build/source/libs/libpng/libpng-1.5.5/pngtest.png) | bin | 8695 -> 8695 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngtrans.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngtrans.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngwio.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngwio.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngwrite.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngwrite.c) | 66 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngwtran.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngwtran.c) | 26 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/pngwutil.c (renamed from Build/source/libs/libpng/libpng-1.5.5/pngwutil.c) | 219 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/libpng.tgt (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/libpng.tgt) | 766 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/libpng.wpj (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/libpng.wpj) | 184 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/pngconfig.mak (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngconfig.mak) | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/pngtest.tgt (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngtest.tgt) | 358 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/pngvalid.tgt (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngvalid.tgt) | 420 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/PRJ0041.mak (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/PRJ0041.mak) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/README.txt (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/README.txt) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/README_zlib.txt (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/README_zlib.txt) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/libpng.sln (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/libpng.sln) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/libpng.vcproj (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/libpng.vcproj) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/pngtest.vcproj (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/pngtest.vcproj) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/zlib.vcproj (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/zlib.vcproj) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/libpng/libpng.vcxproj (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/libpng/libpng.vcxproj) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/pnglibconf/pnglibconf.vcxproj (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pnglibconf/pnglibconf.vcxproj) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/pngtest/pngtest.vcxproj (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pngtest/pngtest.vcxproj) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/pngvalid/pngvalid.vcxproj (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pngvalid/pngvalid.vcxproj) | 3 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/readme.txt (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/readme.txt) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/vstudio.sln (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/vstudio.sln) | 32 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/zlib.props (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/zlib.props) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/zlib/zlib.vcxproj (renamed from Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/zlib/zlib.vcxproj) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/README.txt (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/README.txt) | 12 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/SCOPTIONS.ppc (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/SCOPTIONS.ppc) | 0 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.7/scripts/checksym.awk (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/checksym.awk) | 0 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.7/scripts/chkfmt (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/chkfmt) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/def.dfn (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/def.dfn) | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/descrip.mms (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/descrip.mms) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/libpng-config-body.in (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/libpng-config-body.in) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/libpng-config-head.in (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/libpng-config-head.in) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/libpng.pc.in (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/libpng.pc.in) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.32sunu (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.32sunu) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.64sunu (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.64sunu) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.acorn (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.acorn) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.aix (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.aix) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.amiga (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.amiga) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.atari (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.atari) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.bc32 (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.bc32) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.beos (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.beos) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.bor (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.bor) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.cegcc (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.cegcc) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.darwin (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.darwin) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.dec (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.dec) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.dj2 (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.dj2) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.elf (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.elf) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.freebsd (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.freebsd) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.gcc (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.gcc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.hp64 (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hp64) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.hpgcc (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hpgcc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.hpux (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hpux) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.ibmc (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.ibmc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.intel (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.intel) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.knr (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.knr) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.linux (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.linux) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.mips (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.mips) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.msc (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.msc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.ne12bsd (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.ne12bsd) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.netbsd (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.netbsd) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.openbsd (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.openbsd) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.sco (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sco) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.sggcc (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sggcc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.sgi (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sgi) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.so9 (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.so9) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.solaris (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.solaris) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.solaris-x86 (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.solaris-x86) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.std (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.std) | 8 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.sunos (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sunos) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.tc3 (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.tc3) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.vcwin32 (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.vcwin32) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/makevms.com (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/makevms.com) | 0 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.7/scripts/options.awk (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/options.awk) | 55 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/pnglibconf.dfa (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.dfa) | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/pnglibconf.h.prebuilt (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.h.prebuilt) | 4 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.7/scripts/pnglibconf.mak (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.mak) | 11 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/pngwin.rc (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/pngwin.rc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/smakefile.ppc (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/smakefile.ppc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/sym.dfn (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/sym.dfn) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/symbols.def (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/symbols.def) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/symbols.dfn (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/symbols.dfn) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.7/scripts/vers.dfn (renamed from Build/source/libs/libpng/libpng-1.5.5/scripts/vers.dfn) | 4 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.7/test-pngtest.sh | 16 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.7/test-pngvalid-full.sh (renamed from Build/source/libs/libpng/libpng-1.5.5/test-pngvalid-full.sh) | 8 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.7/test-pngvalid-simple.sh (renamed from Build/source/libs/libpng/libpng-1.5.5/test-pngvalid-simple.sh) | 6 | ||||
-rw-r--r-- | Build/source/libs/libpng/version.ac | 2 |
230 files changed, 4793 insertions, 2626 deletions
diff --git a/Build/source/libs/libpng/ChangeLog b/Build/source/libs/libpng/ChangeLog index 1d0a08d222d..5f03a4e6879 100644 --- a/Build/source/libs/libpng/ChangeLog +++ b/Build/source/libs/libpng/ChangeLog @@ -1,3 +1,9 @@ +2011-12-20 Peter Breitenlohner <peb@mppmu.mpg.de> + + Import libpng-1.5.7. + * version.ac: Adjust. + * configure.ac: Add AC_C_RESTRICT as in libpng-1.5.7. + 2011-10-05 Peter Breitenlohner <peb@mppmu.mpg.de> Import libpng-1.5.5. diff --git a/Build/source/libs/libpng/Makefile.am b/Build/source/libs/libpng/Makefile.am index 41d0610dcb1..4bd3685d5cb 100644 --- a/Build/source/libs/libpng/Makefile.am +++ b/Build/source/libs/libpng/Makefile.am @@ -1,6 +1,6 @@ ## Proxy Makefile.am to build libpng for TeX Live. ## -## Copyright (C) 2009, 2010 Peter Breitenlohner <tex-live@tug.org> +## Copyright (C) 2009-2011 Peter Breitenlohner <tex-live@tug.org> ## ## This file is free software; the copyright holder ## gives unlimited permission to copy and/or distribute it, @@ -70,8 +70,8 @@ DISTCLEANFILES = config.force ## Rebuild zlib @ZLIB_RULE@ -if build TESTS_ENVIRONMENT = LIBPNG_TREE=$(LIBPNG_TREE) +if build TESTS = libpng.test check_PROGRAMS = pngtest dist_check_SCRIPTS = libpng.test diff --git a/Build/source/libs/libpng/Makefile.in b/Build/source/libs/libpng/Makefile.in index 0e75b30cb6a..8cb8be105ca 100644 --- a/Build/source/libs/libpng/Makefile.in +++ b/Build/source/libs/libpng/Makefile.in @@ -259,7 +259,7 @@ nodist_libpng_a_SOURCES = \ $(LIBPNG_TREE)/pngpread.c DISTCLEANFILES = config.force -@build_TRUE@TESTS_ENVIRONMENT = LIBPNG_TREE=$(LIBPNG_TREE) +TESTS_ENVIRONMENT = LIBPNG_TREE=$(LIBPNG_TREE) @build_TRUE@TESTS = libpng.test @build_TRUE@dist_check_SCRIPTS = libpng.test CLEANFILES = pngout.png diff --git a/Build/source/libs/libpng/config.h.in b/Build/source/libs/libpng/config.h.in index feb835c55a1..466673bf296 100644 --- a/Build/source/libs/libpng/config.h.in +++ b/Build/source/libs/libpng/config.h.in @@ -66,5 +66,19 @@ /* Define to empty if `const' does not conform to ANSI C. */ #undef const +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif + /* Define to `unsigned int' if <sys/types.h> does not define. */ #undef size_t diff --git a/Build/source/libs/libpng/configure b/Build/source/libs/libpng/configure index 25f569ef34c..8732d51a179 100755 --- a/Build/source/libs/libpng/configure +++ b/Build/source/libs/libpng/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for libpng for TeX Live 1.5.5. +# Generated by GNU Autoconf 2.68 for libpng for TeX Live 1.5.7. # # Report bugs to <tex-k@tug.org>. # @@ -560,12 +560,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libpng for TeX Live' PACKAGE_TARNAME='libpng-for-tex-live' -PACKAGE_VERSION='1.5.5' -PACKAGE_STRING='libpng for TeX Live 1.5.5' +PACKAGE_VERSION='1.5.7' +PACKAGE_STRING='libpng for TeX Live 1.5.7' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' -ac_unique_file="libpng-1.5.5/pngget.c" +ac_unique_file="libpng-1.5.7/pngget.c" # Factoring default headers for most tests. ac_includes_default="\ #include <stdio.h> @@ -1262,7 +1262,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libpng for TeX Live 1.5.5 to adapt to many kinds of systems. +\`configure' configures libpng for TeX Live 1.5.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1329,7 +1329,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libpng for TeX Live 1.5.5:";; + short | recursive ) echo "Configuration of libpng for TeX Live 1.5.7:";; esac cat <<\_ACEOF @@ -1429,7 +1429,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libpng for TeX Live configure 1.5.5 +libpng for TeX Live configure 1.5.7 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1852,7 +1852,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libpng for TeX Live $as_me 1.5.5, which was +It was created by libpng for TeX Live $as_me 1.5.7, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2671,7 +2671,7 @@ fi # Define the identity of the package. PACKAGE='libpng-for-tex-live' - VERSION='1.5.5' + VERSION='1.5.7' cat >>confdefs.h <<_ACEOF @@ -4431,6 +4431,52 @@ $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +$as_echo_n "checking for C/C++ restrict keyword... " >&6; } +if ${ac_cv_c_restrict+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int * int_ptr; + int foo (int_ptr $ac_kw ip) { + return ip[0]; + } +int +main () +{ +int s[1]; + int * $ac_kw t = s; + t[0] = 0; + return foo(t) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +$as_echo "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) $as_echo "#define restrict /**/" >>confdefs.h + ;; + *) cat >>confdefs.h <<_ACEOF +#define restrict $ac_cv_c_restrict +_ACEOF + ;; + esac + # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 @@ -4694,7 +4740,7 @@ LIBS=$kpse_save_LIBS echo timestamp >config.force fi -LIBPNG_TREE=libpng-1.5.5 +LIBPNG_TREE=libpng-1.5.7 LIBPNG_DEFINES='-DPNG_CONFIGURE_LIBPNG -DPNG_NO_MMX_CODE' @@ -5245,7 +5291,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libpng for TeX Live $as_me 1.5.5, which was +This file was extended by libpng for TeX Live $as_me 1.5.7, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5311,7 +5357,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libpng for TeX Live config.status 1.5.5 +libpng for TeX Live config.status 1.5.7 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/Build/source/libs/libpng/configure.ac b/Build/source/libs/libpng/configure.ac index 828eac073ec..f4b42b85030 100644 --- a/Build/source/libs/libpng/configure.ac +++ b/Build/source/libs/libpng/configure.ac @@ -32,6 +32,7 @@ AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h]) AC_C_CONST AC_TYPE_SIZE_T AC_STRUCT_TM +AC_C_RESTRICT # Checks for library functions. AC_FUNC_STRTOD diff --git a/Build/source/libs/libpng/libpng-1.5.5-PATCHES/TL-Changes b/Build/source/libs/libpng/libpng-1.5.5-PATCHES/TL-Changes deleted file mode 100644 index 448e42ba672..00000000000 --- a/Build/source/libs/libpng/libpng-1.5.5-PATCHES/TL-Changes +++ /dev/null @@ -1,14 +0,0 @@ -Changes applied to the libpng-1.5.5/ tree as obtained from: - http://www.libpng.org/ libpng-1.5.5.tar.xz - -Copied: - scripts/pnglibconf.h.prebuilt -> pnglibconf.h - -Removed: - config.guess - config.sub - depcomp - install-sh - ltmain.sh - missing - diff --git a/Build/source/libs/libpng/libpng-1.5.5/ANNOUNCE b/Build/source/libs/libpng/libpng-1.5.5/ANNOUNCE deleted file mode 100644 index 9f3e677be14..00000000000 --- a/Build/source/libs/libpng/libpng-1.5.5/ANNOUNCE +++ /dev/null @@ -1,91 +0,0 @@ - -Libpng 1.5.5 - September 22, 2011 - -This is a public release of libpng, intended for use in production codes. - -Files available for download: - -Source files with LF line endings (for Unix/Linux) and with a -"configure" script - - libpng-1.5.5.tar.xz (LZMA-compressed, recommended) - libpng-1.5.5.tar.gz - libpng-1.5.5.tar.bz2 - -Source files with CRLF line endings (for Windows), without the -"configure" script - - lpng155.7z (LZMA-compressed, recommended) - lpng155.zip - -Other information: - - libpng-1.5.5-README.txt - libpng-1.5.5-LICENSE.txt - -Changes since the last public release (1.5.4): - - Fixed some typos and made other minor changes in the manual. - Updated contrib/pngminus/makefile.std (Samuli Souminen) - Revised Makefile.am and Makefile.in to look in the right directory for - pnglibconf.h.prebuilt - Enabled compilation with g++ compiler. This compiler does not recognize - the file extension, so it always compiles with C++ rules. Made minor - changes to pngrutil.c to cast results where C++ expects it but C does not. - Minor editing of libpng.3 and libpng-manual.txt. - Revised CMakeLists.txt (Clifford Yapp) - Updated commentary about the png_rgb_to_gray() default coefficients - in the manual and in pngrtran.c - Prevent unexpected API exports from non-libpng DLLs on Windows. The "_DLL" - is removed from the test of whether a DLL is being built (this erroneously - caused the libpng APIs to be marked as DLL exports in static builds under - Microsoft Visual Studio). Almost all of the libpng building configuration - is moved from pngconf.h to pngpriv.h, but PNG_DLL_EXPORT remains in - pngconf.h, though, so that it is colocated with the import definition (it - is no longer used anywhere in the installed headers). The VStudio project - definitions have been cleaned up: "_USRDLL" has been removed from the - static library builds (this was incorrect), and PNG_USE_DLL has been added - to pngvalid to test the functionality (pngtest does not supply it, - deliberately). The spurious "_EXPORTS" has been removed from the - libpng build (all these errors were a result of copy/paste between project - configurations.) - Added new types and internal functions for CIE RGB end point handling to - pngpriv.h (functions yet to be implemented). - Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set in CMakeLists.txt - (Clifford Yap) - Fixes to rgb_to_gray and cHRM XYZ APIs (John Bowler): - The rgb_to_gray code had errors when combined with gamma correction. - Some pixels were treated as true grey when they weren't and such pixels - and true grey ones were not gamma corrected (the original value of the - red component was used instead). APIs to get and set cHRM using color - space end points have been added and the rgb_to_gray code that defaults - based on cHRM, and the divide-by-zero bug in png_handle_cHRM (CERT - VU#477046, CVE-2011-3328, introduced in 1.5.4) have been corrected. - A considerable number of tests has been added to pngvalid for the - rgb_to_gray transform. - Arithmetic errors in rgb_to_gray whereby the calculated gray value was - truncated to the bit depth rather than rounded have been fixed except in - the 8-bit non-gamma-corrected case (where consistency seems more important - than correctness.) The code still has considerable inaccuracies in the - 8-bit case because 8-bit linear arithmetic is used. - Added "$(ARCH)" option to makefile.darwin - Added SunOS support to configure.ac and Makefile.am - Changed png_chunk_benign_error() to png_warning() in png.c, in - png_XYZ_from_xy_checked(). - Fixed 64-bit compilation errors (gcc). The errors fixed relate - to conditions where types that are 32 bits in the GCC 32-bit - world (uLong and png_size_t) become 64 bits in the 64-bit - world. This produces potential truncation errors that the - compiler correctly flags. - Constant changes for 64-bit compatibility (removal of L suffixes). The - 16-bit cases still use "L" as we don't have a 16-bit test system. - -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 -*/ } -#endif diff --git a/Build/source/libs/libpng/libpng-1.5.5/test-pngtest.sh b/Build/source/libs/libpng/libpng-1.5.5/test-pngtest.sh deleted file mode 100755 index 5d12f4acbd3..00000000000 --- a/Build/source/libs/libpng/libpng-1.5.5/test-pngtest.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -echo "Running tests. For details see pngtest-log.txt" - -echo "============ pngtest pngtest.png ==============" > pngtest-log.txt - -echo "Running test-pngtest.sh" -./pngtest ${srcdir}/pngtest.png >> pngtest-log.txt 2>&1 diff --git a/Build/source/libs/libpng/libpng-1.5.5-PATCHES/ChangeLog b/Build/source/libs/libpng/libpng-1.5.7-PATCHES/ChangeLog index 26311ea5079..26311ea5079 100644 --- a/Build/source/libs/libpng/libpng-1.5.5-PATCHES/ChangeLog +++ b/Build/source/libs/libpng/libpng-1.5.7-PATCHES/ChangeLog diff --git a/Build/source/libs/libpng/libpng-1.5.7-PATCHES/TL-Changes b/Build/source/libs/libpng/libpng-1.5.7-PATCHES/TL-Changes new file mode 100644 index 00000000000..fade0a73156 --- /dev/null +++ b/Build/source/libs/libpng/libpng-1.5.7-PATCHES/TL-Changes @@ -0,0 +1,17 @@ +Changes applied to the libpng-1.5.7/ tree as obtained from: + http://www.libpng.org/ libpng-1.5.7.tar.xz + +Copied: + scripts/pnglibconf.h.prebuilt -> pnglibconf.h + +Removed: + config.guess + config.sub + depcomp + install-sh + ltmain.sh + missing + +Removed empty dir: + projects/vstudio/pngstest + diff --git a/Build/source/libs/libpng/libpng-1.5.7/ANNOUNCE b/Build/source/libs/libpng/libpng-1.5.7/ANNOUNCE new file mode 100644 index 00000000000..d89d11d315c --- /dev/null +++ b/Build/source/libs/libpng/libpng-1.5.7/ANNOUNCE @@ -0,0 +1,98 @@ + +Libpng 1.5.7 - December 15, 2011 + +This is a public release of libpng, intended for use in production codes. + +Files available for download: + +Source files with LF line endings (for Unix/Linux) and with a +"configure" script + + libpng-1.5.7.tar.xz (LZMA-compressed, recommended) + libpng-1.5.7.tar.gz + libpng-1.5.7.tar.bz2 + +Source files with CRLF line endings (for Windows), without the +"configure" script + + lpng157.7z (LZMA-compressed, recommended) + lpng157.zip + +Other information: + + libpng-1.5.7-README.txt + libpng-1.5.7-LICENSE.txt + +Changes since the last public release (1.5.6): + Added support for ARM processor (Mans Rullgard) + Fixed bug in pngvalid on early allocation failure; fixed type cast in + pngmem.c; pngvalid would attempt to call png_error() if the allocation + of a png_struct or png_info failed. This would probably have led to a + crash. The pngmem.c implementation of png_malloc() included a cast + to png_size_t which would fail on large allocations on 16-bit systems. + Fix for the preprocessor of the Intel C compiler. The preprocessor + splits adjacent @ signs with a space; this changes the concatentation + token from @-@-@ to PNG_JOIN; that should work with all compiler + preprocessors. + Paeth filter speed improvements from work by Siarhei Siamashka. This + changes the 'Paeth' reconstruction function to improve the GCC code + generation on x86. The changes are only part of the suggested ones; + just the changes that definitely improve speed and remain simple. + The changes also slightly increase the clarity of the code. + Check compression_type parameter in png_get_iCCP and remove spurious + casts. The compression_type parameter is always assigned to, so must + be non-NULL. The cast of the profile length potentially truncated the + value unnecessarily on a 16-bit int system, so the cast of the (byte) + compression type to (int) is specified by ANSI-C anyway. + Fixed FP division by zero in pngvalid.c; the 'test_pixel' code left + the sBIT fields in the test pixel as 0, which resulted in a floating + point division by zero which was irrelevant but causes systems where + FP exceptions cause a crash. Added code to pngvalid to turn on FP + exceptions if the appropriate glibc support is there to ensure this is + tested in the future. + Added versioning to pnglibconf.h comments. + Installed more accurate linear to sRGB conversion tables. The slightly + modified tables reduce the number of 16-bit values that + convert to an off-by-one 8-bit value. The "makesRGB.c" code that was used + to generate the tables is now in a contrib/sRGBtables sub-directory. + Added run-time detection of NEON support. + Multiple transform bug fixes plus a work-round for double gamma correction. + libpng does not support more than one transform that requires linear data + at once - if this is tried typically the results is double gamma + correction. Since the simplified APIs can need rgb to gray combined with + a compose operation it is necessary to do one of these outside the main + libpng transform code. This check-in also contains fixes to various bugs + in compose and rgb to gray (on palette). + Fixes for C++ compilation using g++ When libpng source is compiled + using g++. The compiler imposes C++ rules on the C source; thus it + is desireable to make the source work with either C or C++ rules + without throwing away useful error information. This change adds + png_voidcast to allow C semantic (void*) cases or the corresponding + C++ static_cast operation, as appropriate. + Added --noexecstack to assembler file compilation. GCC does not set + this on assembler compilation, even though it does on C compilation. + This creates security issues if assembler code is enabled; the + work-around is to set it by default in the flags for $(CCAS) + Removed "zTXt" from warning in generic chunk decompression function. + Validate time settings passed to pngset() and png_convert_to_rfc1123() + (Frank Busse). + Added MINGW support to CMakeLists.txt + Reject invalid compression flag or method when reading the iTXt chunk. + Moved pngvalid.c into contrib/libtests + Rebuilt Makefile.in, configure, etc., with autoconf-2.68 + Replaced an "#if" with "#ifdef" in pngrtran.c + Revised #if PNG_DO_BC block in png.c (use #ifdef and add #else) + Revised pngconf.h to use " __declspec(restrict)" only when MSC_VER >= 1400, + as in libpng-1.5.4. + Put CRLF line endings in the owatcom project files. + Updated CMakeLists.txt to account for the relocation of pngvalid.c + Minor fixes to pngvalid.c for gcc 4.6.2 compatibility to remove warnings + reported by earlier versions. + +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/libpng-1.5.5/CHANGES b/Build/source/libs/libpng/libpng-1.5.7/CHANGES index dd31a96aee9..f7a68e9a51d 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/CHANGES +++ b/Build/source/libs/libpng/libpng-1.5.7/CHANGES @@ -196,7 +196,8 @@ Version 0.97 [January, 1998] Added more typecasts. 65536L becomes (png_uint_32)65536L, etc. (Glenn R-P) Minor corrections in libpng.txt Added simple sRGB support (Glenn R-P) - Easier conditional compiling, e.g. define PNG_READ/WRITE_NOT_FULLY_SUPPORTED; + Easier conditional compiling, e.g., + define PNG_READ/WRITE_NOT_FULLY_SUPPORTED; all configurable options can be selected from command-line instead of having to edit pngconf.h (Glenn R-P) Fixed memory leak in pngwrite.c (free info_ptr->text) (Glenn R-P) @@ -207,7 +208,8 @@ Version 0.97 [January, 1998] Tested NODIV support and made it default behavior (Greg Roelofs) Added "-m" option and PNGTEST_DEBUG_MEMORY to pngtest (John Bowler) Regularized version numbering scheme and bumped shared-library major - version number to 2 to avoid problems with libpng 0.89 apps (Greg Roelofs) + version number to 2 to avoid problems with libpng 0.89 apps + (Greg Roelofs) Version 0.98 [January, 1998] Cleaned up some typos in libpng.txt and in code documentation @@ -3444,7 +3446,7 @@ Version 1.5.3beta11 [June 11, 2011] Removed string/memory macros that are no longer used and are not necessarily fully supportable, particularly png_strncpy and png_snprintf. Added log option to pngvalid.c and attempted to improve gamma messages. - + Version 1.5.3 [omitted] People found the presence of a beta release following an rc release to be confusing; therefore we bump the version to libpng-1.5.4beta01 @@ -3575,18 +3577,205 @@ Version 1.5.5beta08 [September 10, 2011] Fixed 64-bit compilation errors (gcc). The errors fixed relate to conditions where types that are 32 bits in the GCC 32-bit world (uLong and png_size_t) become 64 bits in the 64-bit - world. This produces potential truncation errors that the + world. This produces potential truncation errors which the compiler correctly flags. Relocated new HAVE_SOLARIS_LD definition in configure.ac Constant changes for 64-bit compatibility (removal of L suffixes). The 16-bit cases still use "L" as we don't have a 16-bit test system. -Version 1.5.5rc01 [September 17, 2011] - Removed "L" suffixes from constants in pngpriv.h +Version 1.5.5rc01 [September 15, 2011] + Removed "L" suffixes in pngpriv.h Version 1.5.5 [September 22, 2011] No changes. +Version 1.5.6beta01 [September 22, 2011] + Fixed some 64-bit type conversion warnings in pngrtran.c + Moved row_info from png_struct to a local variable. + The various interlace mask arrays have been made into arrays of + bytes and made PNG_CONST and static (previously some arrays were + marked PNG_CONST and some weren't). + Additional checks have been added to the transform code to validate the + pixel depths after the transforms on both read and write. + Removed some redundant code from pngwrite.c, in png_destroy_write_struct(). + Changed chunk reading/writing code to use png_uint_32 instead of png_byte[4]. + This removes the need to allocate temporary strings for chunk names on + the stack in the read/write code. Unknown chunk handling still uses the + string form because this is exposed in the API. + +Version 1.5.6beta02 [September 26, 2011] + Added a note in the manual the png_read_update_info() must be called only + once with a particular info_ptr. + Fixed a typo in the definition of the new PNG_STRING_FROM_CHUNK(s,c) macro. + +Version 1.5.6beta03 [September 28, 2011] + Revised test-pngtest.sh to report FAIL when pngtest fails. + Added "--strict" option to pngtest, to report FAIL when the failure is + only because the resulting valid files are different. + Revised CMakeLists.txt to work with mingw and removed some material from + CMakeLists.txt that is no longer useful in libpng-1.5. + +Version 1.5.6beta04 [October 5, 2011] + Fixed typo in Makefile.in and Makefile.am ("-M Wl" should be "-M -Wl")." + +Version 1.5.6beta05 [October 12, 2011] + Speed up png_combine_row() for interlaced images. This reduces the generality + of the code, allowing it to be optimized for Adam7 interlace. The masks + passed to png_combine_row() are now generated internally, avoiding + some code duplication and localizing the interlace handling somewhat. + Align png_struct::row_buf - previously it was always unaligned, caused by + a bug in the code that attempted to align it; the code needs to subtract + one from the pointer to take account of the filter byte prepended to + each row. + Optimized png_combine_row() when rows are aligned. This gains a small + percentage for 16-bit and 32-bit pixels in the typical case where the + output row buffers are appropriately aligned. The optimization was not + previously possible because the png_struct buffer was always misaligned. + Fixed bug in png_write_chunk_header() debug print, introduced in 1.5.6beta01. + +Version 1.5.6beta06 [October 17, 2011] + Removed two redundant tests for unitialized row. + Fixed a relatively harmless memory overwrite in compressed text writing + with a 1 byte zlib buffer. + Add ability to call png_read_update_info multiple times to pngvalid.c. + Fixes for multiple calls to png_read_update_info. These fixes attend to + most of the errors revealed in pngvalid, however doing the gamma work + twice results in inaccuracies that can't be easily fixed. There is now + a warning in the code if this is going to happen. + Turned on multiple png_read_update_info in pngvalid transform tests. + Prevent libpng from overwriting unused bits at the end of the image when + it is not byte aligned, while reading. Prior to libpng-1.5.6 libpng would + overwrite the partial byte at the end of each row if the row width was not + an exact multiple of 8 bits and the image is not interlaced. + +Version 1.5.6beta07 [October 21, 2011] + Made png_ptr->prev_row an aligned pointer into png_ptr->big_prev_row + (Mans Rullgard). + +Version 1.5.6rc01 [October 26, 2011] + Changed misleading "Missing PLTE before cHRM" warning to "Out of place cHRM" + +Version 1.5.6rc02 [October 27, 2011] + Added LSR() macro to defend against buggy compilers that evaluate non-taken + code branches and complain about out-of-range shifts. + +Version 1.5.6rc03 [October 28, 2011] + Renamed the LSR() macro to PNG_LSR() and added PNG_LSL() macro. + Fixed compiler warnings with Intel and MSYS compilers. The logical shift + fix for Microsoft Visual C is required by other compilers, so this + enables that fix for all compilers when using compile-time constants. + Under MSYS 'byte' is a name declared in a system header file, so we + changed the name of a local variable to avoid the warnings that result. + Added #define PNG_ALIGN_TYPE PNG_ALIGN_NONE to contrib/pngminim/*/pngusr.h + +Version 1.5.6 [November 3, 2011] + No changes. + +Version 1.5.7beta01 [November 4, 2011] + Added support for ARM processor (Mans Rullgard) + Fixed bug in pngvalid on early allocation failure; fixed type cast in + pngmem.c; pngvalid would attempt to call png_error() if the allocation + of a png_struct or png_info failed. This would probably have led to a + crash. The pngmem.c implementation of png_malloc() included a cast + to png_size_t which would fail on large allocations on 16-bit systems. + Fix for the preprocessor of the Intel C compiler. The preprocessor + splits adjacent @ signs with a space; this changes the concatentation + token from @-@-@ to PNG_JOIN; that should work with all compiler + preprocessors. + Paeth filter speed improvements from work by Siarhei Siamashka. This + changes the 'Paeth' reconstruction function to improve the GCC code + generation on x86. The changes are only part of the suggested ones; + just the changes that definitely improve speed and remain simple. + The changes also slightly increase the clarity of the code. + +Version 1.5.7beta02 [November 11, 2011] + Check compression_type parameter in png_get_iCCP and remove spurious + casts. The compression_type parameter is always assigned to, so must + be non-NULL. The cast of the profile length potentially truncated the + value unnecessarily on a 16-bit int system, so the cast of the (byte) + compression type to (int) is specified by ANSI-C anyway. + Fixed FP division by zero in pngvalid.c; the 'test_pixel' code left + the sBIT fields in the test pixel as 0, which resulted in a floating + point division by zero which was irrelevant but causes systems where + FP exceptions cause a crash. Added code to pngvalid to turn on FP + exceptions if the appropriate glibc support is there to ensure this is + tested in the future. + Updated scripts/pnglibconf.mak and scripts/makefile.std to handle the + new PNG_JOIN macro. + Added versioning to pnglibconf.h comments. + Simplified read/write API initial version; basic read/write tested on + a variety of images, limited documentation (in the header file.) + Installed more accurate linear to sRGB conversion tables. The slightly + modified tables reduce the number of 16-bit values that + convert to an off-by-one 8-bit value. The "makesRGB.c" code that was used + to generate the tables is now in a contrib/sRGBtables sub-directory. + +Version 1.5.7beta03 [November 17, 2011] + Removed PNG_CONST from the sRGB table declarations in pngpriv.h and png.c + Added run-time detection of NEON support. + Added contrib/libtests; includes simplified API test and timing test and + a color conversion utility for rapid checking of failed 'pngstest' results. + Multiple transform bug fixes plus a work-round for double gamma correction. + libpng does not support more than one transform that requires linear data + at once - if this is tried typically the results is double gamma + correction. Since the simplified APIs can need rgb to gray combined with + a compose operation it is necessary to do one of these outside the main + libpng transform code. This check-in also contains fixes to various bugs + in the simplified APIs themselves and to some bugs in compose and rgb to + gray (on palette) itself. + Fixes for C++ compilation using g++ When libpng source is compiled + using g++. The compiler imposes C++ rules on the C source; thus it + is desireable to make the source work with either C or C++ rules + without throwing away useful error information. This change adds + png_voidcast to allow C semantic (void*) cases or the corresponding + C++ static_cast operation, as appropriate. + Added --noexecstack to assembler file compilation. GCC does not set + this on assembler compilation, even though it does on C compilation. + This creates security issues if assembler code is enabled; the + work-around is to set it by default in the flags for $(CCAS) + Work around compilers that don't support declaration of const data. Some + compilers fault 'extern const' data declarations (because the data is + not initialized); this turns on const-ness only for compilers where + this is known to work. + +Version 1.5.7beta04 [November 17, 2011] + Since the gcc driver does not recognize the --noexecstack flag, we must + use the -Wa prefix to have it passed through to the assembler. + Also removed a duplicate setting of this flag. + Added files that were omitted from the libpng-1.5.7beta03 zip distribution. + +Version 1.5.7beta05 [November 25, 2011] + Removed "zTXt" from warning in generic chunk decompression function. + Validate time settings passed to pngset() and png_convert_to_rfc1123() + (Frank Busse). + Added MINGW support to CMakeLists.txt + Reject invalid compression flag or method when reading the iTXt chunk. + Backed out 'simplified' API changes. The API seems too complex and there + is a lack of consensus or enthusiasm for the proposals. The API also + reveals significant bugs inside libpng (double gamma correction and the + known bug of being unable to retrieve a corrected palette). It seems + better to wait until the bugs, at least, are corrected. + Moved pngvalid.c into contrib/libtests + Rebuilt Makefile.in, configure, etc., with autoconf-2.68 + +Version 1.5.7rc01 [December 1, 2011] + Replaced an "#if" with "#ifdef" in pngrtran.c + Revised #if PNG_DO_BC block in png.c (use #ifdef and add #else) + +Version 1.5.7rc02 [December 5, 2011] + Revised project files and contrib/pngvalid/pngvalid.c to account for + the relocation of pngvalid into contrib/libtests. + Revised pngconf.h to use " __declspec(restrict)" only when MSC_VER >= 1400, + as in libpng-1.5.4. + Put CRLF line endings in the owatcom project files. + +Version 1.5.7rc03 [December 7, 2011] + Updated CMakeLists.txt to account for the relocation of pngvalid.c + +Version 1.5.7 [December 15, 2011] + Minor fixes to pngvalid.c for gcc 4.6.2 compatibility to remove warnings + reported by earlier versions. + Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement diff --git a/Build/source/libs/libpng/libpng-1.5.5/CMakeLists.txt b/Build/source/libs/libpng/libpng-1.5.7/CMakeLists.txt index 72e5269c226..87cb16de141 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/CMakeLists.txt +++ b/Build/source/libs/libpng/libpng-1.5.7/CMakeLists.txt @@ -35,7 +35,7 @@ enable_testing() set(PNGLIB_MAJOR 1) set(PNGLIB_MINOR 5) -set(PNGLIB_RELEASE 5) +set(PNGLIB_RELEASE 7) set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR}) set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) @@ -69,39 +69,11 @@ else() option(PNG_STATIC "Build static lib" ON) endif() -if(MINGW) - option(PNG_TESTS "Build pngtest" NO) -else() - option(PNG_TESTS "Build pngtest" YES) -endif() +option(PNG_TESTS "Build libpng tests" YES) -option(PNG_NO_CONSOLE_IO "FIXME" YES) -option(PNG_NO_STDIO "FIXME" YES) +# Many more configuration options could be added here option(PNG_DEBUG "Build with debug output" NO) -option(PNGARG "FIXME" YES) -#TODO: -# PNG_CONSOLE_IO_SUPPORTED - -# maybe needs improving, but currently I don't know when we can enable what :) -set(png_asm_tmp "OFF") -if(NOT WIN32) - find_program(uname_executable NAMES uname PATHS /bin /usr/bin /usr/local/bin) - if(uname_executable) - exec_program(${uname_executable} - ARGS --machine OUTPUT_VARIABLE uname_output) - if("uname_output" MATCHES "^.*i[1-9]86.*$") - set(png_asm_tmp "ON") - else("uname_output" MATCHES "^.*i[1-9]86.*$") - set(png_asm_tmp "OFF") - endif("uname_output" MATCHES "^.*i[1-9]86.*$") - endif(uname_executable) -else() - # this env var is normally only set on win64 - set(TEXT "ProgramFiles(x86)") - if("$ENV{${TEXT}}" STREQUAL "") - set(png_asm_tmp "ON") - endif("$ENV{${TEXT}}" STREQUAL "") -endif() +option(PNGARG "Disable ANSI-C prototypes" NO) # SET LIBNAME set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR}) @@ -110,6 +82,9 @@ set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR}) set(CMAKE_DEBUG_POSTFIX "d") # Use the prebuilt pnglibconf.h file from the scripts folder +# TODO: fix this by building with awk; without this no cmake build can be +# configured directly (to do so indirectly use your local awk to build a +# pnglibconf.h in the build directory.) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt ${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) @@ -145,39 +120,21 @@ set(libpng_sources set(pngtest_sources pngtest.c ) +set(pngvalid_sources + contrib/libtests/pngvalid.c +) # SOME NEEDED DEFINITIONS add_definitions(-DPNG_CONFIGURE_LIBPNG) if(MSVC) - add_definitions(-DPNG_NO_MODULEDEF -D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) endif(MSVC) -if(PNG_SHARED OR NOT MSVC) - #if building msvc static this has NOT to be defined - add_definitions(-DZLIB_DLL) -endif() - -if(PNG_CONSOLE_IO_SUPPORTED) - add_definitions(-DPNG_CONSOLE_IO_SUPPORTED) -endif() - -if(PNG_NO_CONSOLE_IO) - add_definitions(-DPNG_NO_CONSOLE_IO) -endif() - -if(PNG_NO_STDIO) - add_definitions(-DPNG_NO_STDIO) -endif() - if(PNG_DEBUG) add_definitions(-DPNG_DEBUG) endif() -if(NOT M_LIBRARY AND NOT WIN32) - add_definitions(-DPNG_NO_FLOATING_POINT_SUPPORTED) -endif() - # NOW BUILD OUR TARGET include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR}) @@ -211,6 +168,10 @@ if(PNG_TESTS AND PNG_SHARED) add_executable(pngtest ${pngtest_sources}) target_link_libraries(pngtest ${PNG_LIB_NAME}) add_test(pngtest ./pngtest ${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png) + # + add_executable(pngvalid ${pngvalid_sources}) + target_link_libraries(pngvalid ${PNG_LIB_NAME}) + add_test(pngvalid ./pngvalid) endif() # Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set @@ -227,7 +188,7 @@ ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) # copies if different. macro(CREATE_SYMLINK SRC_FILE DEST_FILE) FILE(REMOVE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE}) - if(WIN32 AND NOT CYGWIN) + if(WIN32 AND NOT CYGWIN AND NOT MINGW) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${DEST_FILE} COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${SRC_FILE} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE} @@ -235,17 +196,22 @@ macro(CREATE_SYMLINK SRC_FILE DEST_FILE) DEPENDS ${PNG_LIB_NAME} ${PNG_LIB_NAME_STATIC} ) ADD_CUSTOM_TARGET(${DEST_FILE}_COPY ALL DEPENDS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE}) - else(WIN32 AND NOT CYGWIN) + else(WIN32 AND NOT CYGWIN AND NOT MINGW) execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SRC_FILE} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SRC_FILE} ${DEST_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - endif(WIN32 AND NOT CYGWIN) + endif(WIN32 AND NOT CYGWIN AND NOT MINGW) endmacro() -# CREATE PKGCONFIG FILES -# we use the same files like ./configure, so we have to set its vars +# libpng is a library so default to 'lib' if(NOT DEFINED CMAKE_INSTALL_LIBDIR) set(CMAKE_INSTALL_LIBDIR lib) endif(NOT DEFINED CMAKE_INSTALL_LIBDIR) + +# CREATE PKGCONFIG FILES +# we use the same files like ./configure, so we have to set its vars +# Only do this on Windows for Cygwin - the files don't make much sense outside +# a UNIX look alike +if(NOT WIN32 OR CYGWIN OR MINGW) set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix ${CMAKE_INSTALL_PREFIX}) set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) @@ -258,11 +224,12 @@ CREATE_SYMLINK(${PNGLIB_NAME}.pc libpng.pc) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY) CREATE_SYMLINK(${PNGLIB_NAME}-config libpng-config) +endif(NOT WIN32 OR CYGWIN OR MINGW) # SET UP LINKS if(PNG_SHARED) set_target_properties(${PNG_LIB_NAME} PROPERTIES -# VERSION 15.${PNGLIB_RELEASE}.1.5.5 +# VERSION 15.${PNGLIB_RELEASE}.1.5.7 VERSION 15.${PNGLIB_RELEASE}.0 SOVERSION 15 CLEAN_DIRECT_OUTPUT 1) @@ -297,13 +264,13 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) # Create a symlink for libpng.dll.a => libpng15.dll.a on Cygwin - if(CYGWIN) + if(CYGWIN OR MINGW) get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME} LOCATION_${CMAKE_BUILD_TYPE}) get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME) CREATE_SYMLINK(${BUILD_TARGET_FILE} libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(CYGWIN) + endif(CYGWIN OR MINGW) if(NOT WIN32) get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME} LOCATION_${CMAKE_BUILD_TYPE}) @@ -319,13 +286,13 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) ${PNG_EXPORT_RULE} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - if(NOT WIN32 OR CYGWIN) + if(NOT WIN32 OR CYGWIN OR MINGW) get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME_STATIC} LOCATION_${CMAKE_BUILD_TYPE}) get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME) CREATE_SYMLINK(${BUILD_TARGET_FILE} libpng${CMAKE_STATIC_LIBRARY_SUFFIX}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(NOT WIN32 OR CYGWIN) + endif(NOT WIN32 OR CYGWIN OR MINGW) endif() endif() diff --git a/Build/source/libs/libpng/libpng-1.5.5/INSTALL b/Build/source/libs/libpng/libpng-1.5.7/INSTALL index 353bfff3268..e6979c6fb01 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/INSTALL +++ b/Build/source/libs/libpng/libpng-1.5.7/INSTALL @@ -133,3 +133,23 @@ run "make install". Further information can be found in the README and libpng-manual.txt files, in the individual makefiles, in png.h, and the manual pages libpng.3 and png.5. + +Using the ./configure script -- 16 December 2002. +================================================= + +The ./configure script should work compatibly with what scripts/makefile.* +did, however there are some options you might need to add to configure +explicitly, which previously was done semi-automatically (if you didn't edit +scripts/makefile.* yourself, that is) + +CFLAGS="-Wall -O -funroll-loops \ +-malign-loops=2 -malign-functions=2" ./configure --prefix=/usr/include \ +--with-pkgconfigdir=/usr/lib/pkgconfig --includedir=/usr/include + +You can alternatively specify --includedir=/usr/include, /usr/local/include, +/usr/include/libpng%NN%, or whatever. + +If you find that the configure script is out-of-date or is not supporting +your platform properly, try running autogen.sh to regenerate "configure", +"Makefile.in", and the other configuration files. Then try configure again. + diff --git a/Build/source/libs/libpng/libpng-1.5.5/LICENSE b/Build/source/libs/libpng/libpng-1.5.7/LICENSE index 5e932e10283..e23bca425c1 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/LICENSE +++ b/Build/source/libs/libpng/libpng-1.5.7/LICENSE @@ -10,7 +10,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.5.5, September 22, 2011, are +libpng versions 1.2.6, August 15, 2004, through 1.5.7, December 15, 2011, are Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.2.5 with the following individual added to the list of Contributing Authors @@ -108,4 +108,4 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -September 22, 2011 +December 15, 2011 diff --git a/Build/source/libs/libpng/libpng-1.5.5/Makefile.am b/Build/source/libs/libpng/libpng-1.5.7/Makefile.am index c80f0ce8989..def4bd11706 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/Makefile.am +++ b/Build/source/libs/libpng/libpng-1.5.7/Makefile.am @@ -12,13 +12,17 @@ PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ AUTOMAKE_OPTIONS = foreign # test programs - run on make check, make distcheck -check_PROGRAMS= pngtest pngvalid +TESTS_ENVIRONMENT= srcdir=$(srcdir) +check_PROGRAMS= pngtest pngtest_SOURCES = pngtest.c pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la -pngvalid_SOURCES = pngvalid.c +TESTS = test-pngtest.sh + +# Only do the following if the contrib directory is present. +check_PROGRAMS+= pngvalid +pngvalid_SOURCES = contrib/libtests/pngvalid.c pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la -TESTS = test-pngtest.sh test-pngvalid-simple.sh test-pngvalid-full.sh -TESTS_ENVIRONMENT= srcdir=$(srcdir) +TESTS += test-pngvalid-simple.sh test-pngvalid-full.sh # man pages dist_man_MANS= libpng.3 libpngpf.3 png.5 @@ -36,6 +40,10 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\ pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c\ png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h +if PNG_ARM_NEON +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/filter_neon.S +endif + nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS = @LIBPNG_DEFINES@ @@ -46,7 +54,7 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \ if HAVE_LD_VERSION_SCRIPT # Versioned symbols and restricted exports if HAVE_SOLARIS_LD - libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,-M Wl,libpng.vers + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,-M -Wl,libpng.vers else libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,--version-script=libpng.vers endif @@ -122,7 +130,7 @@ $(srcdir)/scripts/pnglibconf.h.prebuilt: # The following is necessary to ensure that the local pnglibconf.h is used, not # an installed one (this can happen immediately after on a clean system if # 'make test' is the first thing the user does.) -pngvalid.o pngtest.o: pnglibconf.h +contrib/libtests/pngvalid.o pngtest.o: pnglibconf.h # We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually # be built with PNG_USE_READ_MACROS; this prevents the read macros from @@ -138,17 +146,18 @@ SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\ echo '#include "$<"' >dfn.c $(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) @LIBPNG_DEFINES@\ $(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c > dfn1.out - $(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p'\ + $(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\ dfn1.out >dfn2.out - $(SED) -e 's| *@@@ *||g' -e 's| *$$||' dfn2.out >dfn3.out + $(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' dfn2.out >dfn3.out rm -f dfn.c dfn[12].out mv dfn3.out $@ # The .dfn file for pnglibconf.h is machine generated -pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk +pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h rm -f $@ dfn?.out - $(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out\ - ${srcdir}/scripts/pnglibconf.dfa $(DFA_XTRA) 1>&2 + $(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out version=search\ + ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\ + $(DFA_XTRA) 1>&2 $(AWK) -f ${srcdir}/scripts/options.awk out=dfn2.out dfn1.out 1>&2 rm dfn1.out mv dfn2.out $@ @@ -163,12 +172,13 @@ scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.ou # used on demand to regenerate the standard header, CPPFLAGS should # be empty - no non-standard defines -scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk +scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h rm -f $@ dfn?.out test -z "$(CPPFLAGS)" echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\ - $(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out\ - logunsupported=1 - ${srcdir}/scripts/pnglibconf.dfa 1>&2 + $(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out logunsupported=1 + version=search ${srcdir}/pngconf.h -\ + ${srcdir}/scripts/pnglibconf.dfa 1>&2 $(AWK) -f ${srcdir}/scripts/options.awk out=dfn2.out dfn1.out 1>&2 rm dfn1.out mv dfn2.out $@ diff --git a/Build/source/libs/libpng/libpng-1.5.5/Makefile.in b/Build/source/libs/libpng/libpng-1.5.7/Makefile.in index cd7b998009e..cc64277805a 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/Makefile.in +++ b/Build/source/libs/libpng/libpng-1.5.7/Makefile.in @@ -41,12 +41,13 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = pngtest$(EXEEXT) pngvalid$(EXEEXT) +@PNG_ARM_NEON_TRUE@am__append_1 = arm/filter_neon.S # Versioned symbols and restricted exports -@HAVE_LD_VERSION_SCRIPT_TRUE@@HAVE_SOLARIS_LD_TRUE@am__append_1 = -Wl,-M Wl,libpng.vers -@HAVE_LD_VERSION_SCRIPT_TRUE@@HAVE_SOLARIS_LD_FALSE@am__append_2 = -Wl,--version-script=libpng.vers +@HAVE_LD_VERSION_SCRIPT_TRUE@@HAVE_SOLARIS_LD_TRUE@am__append_2 = -Wl,-M -Wl,libpng.vers +@HAVE_LD_VERSION_SCRIPT_TRUE@@HAVE_SOLARIS_LD_FALSE@am__append_3 = -Wl,--version-script=libpng.vers # Only restricted exports when possible -@HAVE_LD_VERSION_SCRIPT_FALSE@am__append_3 = -export-symbols libpng.sym +@HAVE_LD_VERSION_SCRIPT_FALSE@am__append_4 = -export-symbols libpng.sym subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \ $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ @@ -91,6 +92,12 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(pkgincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD = +am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES_DIST = png.c \ + pngerror.c pngget.c pngmem.c pngpread.c pngread.c pngrio.c \ + pngrtran.c pngrutil.c pngset.c pngtrans.c pngwio.c pngwrite.c \ + pngwtran.c pngwutil.c png.h pngconf.h pngdebug.h pnginfo.h \ + pngpriv.h pngstruct.h arm/filter_neon.S +@PNG_ARM_NEON_TRUE@am__objects_1 = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.lo am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS = \ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-png.lo \ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngerror.lo \ @@ -106,7 +113,8 @@ am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS = \ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwio.lo \ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwrite.lo \ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwtran.lo \ - libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.lo + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.lo \ + $(am__objects_1) nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS = \ $(am_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) \ @@ -127,6 +135,11 @@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f +CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) +LTCPPASCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ @@ -139,7 +152,8 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ SOURCES = $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES) \ $(nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES) \ $(pngtest_SOURCES) $(pngvalid_SOURCES) -DIST_SOURCES = $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES) \ +DIST_SOURCES = \ + $(am__libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES_DIST) \ $(pngtest_SOURCES) $(pngvalid_SOURCES) man3dir = $(mandir)/man3 man5dir = $(mandir)/man5 @@ -167,6 +181,7 @@ distcleancheck_listfiles = find . -type f -print pkgincludedir = $(includedir)/$(PNGLIB_BASENAME) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_CCASFLAGS = @AM_CCASFLAGS@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -174,6 +189,9 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ @@ -309,12 +327,14 @@ PNGLIB_BASENAME = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ # to get red "FAIL" and green "PASS" notations during tests. # AUTOMAKE_OPTIONS = foreign color-tests AUTOMAKE_OPTIONS = foreign + +# test programs - run on make check, make distcheck +TESTS_ENVIRONMENT = srcdir=$(srcdir) pngtest_SOURCES = pngtest.c pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la -pngvalid_SOURCES = pngvalid.c -pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la TESTS = test-pngtest.sh test-pngvalid-simple.sh test-pngvalid-full.sh -TESTS_ENVIRONMENT = srcdir=$(srcdir) +pngvalid_SOURCES = contrib/libtests/pngvalid.c +pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la # man pages dist_man_MANS = libpng.3 libpngpf.3 png.5 @@ -324,17 +344,17 @@ bin_SCRIPTS = @binconfigs@ # rules to build libpng, only build the old library on request lib_LTLIBRARIES = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la # EXTRA_LTLIBRARIES= libpng.la -libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\ - pngget.c pngmem.c pngpread.c pngread.c pngrio.c pngrtran.c pngrutil.c\ - pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c\ - png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h - +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c \ + pngget.c pngmem.c pngpread.c pngread.c pngrio.c pngrtran.c \ + pngrutil.c pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c \ + pngwutil.c png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h \ + pngstruct.h $(am__append_1) nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS = @LIBPNG_DEFINES@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined \ -export-dynamic -version-number \ @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0 \ - $(am__append_1) $(am__append_2) $(am__append_3) + $(am__append_2) $(am__append_3) $(am__append_4) @HAVE_LD_VERSION_SCRIPT_FALSE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym @HAVE_LD_VERSION_SCRIPT_TRUE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.vers pkginclude_HEADERS = png.h pngconf.h @@ -372,7 +392,7 @@ all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -.SUFFIXES: .chk .dfn .out .c .lo .o .obj +.SUFFIXES: .chk .dfn .out .S .c .lo .o .obj am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @@ -517,6 +537,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-png.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngget.Plo@am__quote@ @@ -535,6 +556,34 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngtest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngvalid.Po@am__quote@ +.S.o: +@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCCAS_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ $< + +.S.obj: +@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCCAS_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.S.lo: +@am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCCAS_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(LTCPPASCOMPILE) -c -o $@ $< + +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.lo: arm/filter_neon.S +@am__fastdepCCAS_TRUE@ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.lo -MD -MP -MF $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.Tpo -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.lo `test -f 'arm/filter_neon.S' || echo '$(srcdir)/'`arm/filter_neon.S +@am__fastdepCCAS_TRUE@ $(am__mv) $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.Tpo $(DEPDIR)/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='arm/filter_neon.S' object='libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-filter_neon.lo `test -f 'arm/filter_neon.S' || echo '$(srcdir)/'`arm/filter_neon.S + .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @@ -661,6 +710,20 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.lo: pngwutil.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la-pngwutil.lo `test -f 'pngwutil.c' || echo '$(srcdir)/'`pngwutil.c +pngvalid.o: contrib/libtests/pngvalid.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngvalid.o -MD -MP -MF $(DEPDIR)/pngvalid.Tpo -c -o pngvalid.o `test -f 'contrib/libtests/pngvalid.c' || echo '$(srcdir)/'`contrib/libtests/pngvalid.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pngvalid.Tpo $(DEPDIR)/pngvalid.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='contrib/libtests/pngvalid.c' object='pngvalid.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngvalid.o `test -f 'contrib/libtests/pngvalid.c' || echo '$(srcdir)/'`contrib/libtests/pngvalid.c + +pngvalid.obj: contrib/libtests/pngvalid.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngvalid.obj -MD -MP -MF $(DEPDIR)/pngvalid.Tpo -c -o pngvalid.obj `if test -f 'contrib/libtests/pngvalid.c'; then $(CYGPATH_W) 'contrib/libtests/pngvalid.c'; else $(CYGPATH_W) '$(srcdir)/contrib/libtests/pngvalid.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pngvalid.Tpo $(DEPDIR)/pngvalid.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='contrib/libtests/pngvalid.c' object='pngvalid.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngvalid.obj `if test -f 'contrib/libtests/pngvalid.c'; then $(CYGPATH_W) 'contrib/libtests/pngvalid.c'; else $(CYGPATH_W) '$(srcdir)/contrib/libtests/pngvalid.c'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -1286,7 +1349,7 @@ $(srcdir)/scripts/pnglibconf.h.prebuilt: # The following is necessary to ensure that the local pnglibconf.h is used, not # an installed one (this can happen immediately after on a clean system if # 'make test' is the first thing the user does.) -pngvalid.o pngtest.o: pnglibconf.h +contrib/libtests/pngvalid.o pngtest.o: pnglibconf.h .dfn.out: rm -f $@ dfn.c dfn?.out @@ -1294,17 +1357,18 @@ pngvalid.o pngtest.o: pnglibconf.h echo '#include "$<"' >dfn.c $(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) @LIBPNG_DEFINES@\ $(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c > dfn1.out - $(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p'\ + $(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\ dfn1.out >dfn2.out - $(SED) -e 's| *@@@ *||g' -e 's| *$$||' dfn2.out >dfn3.out + $(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' dfn2.out >dfn3.out rm -f dfn.c dfn[12].out mv dfn3.out $@ # The .dfn file for pnglibconf.h is machine generated -pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk +pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h rm -f $@ dfn?.out - $(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out\ - ${srcdir}/scripts/pnglibconf.dfa $(DFA_XTRA) 1>&2 + $(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out version=search\ + ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\ + $(DFA_XTRA) 1>&2 $(AWK) -f ${srcdir}/scripts/options.awk out=dfn2.out dfn1.out 1>&2 rm dfn1.out mv dfn2.out $@ @@ -1319,12 +1383,13 @@ scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.ou # used on demand to regenerate the standard header, CPPFLAGS should # be empty - no non-standard defines -scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk +scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h rm -f $@ dfn?.out test -z "$(CPPFLAGS)" echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\ - $(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out\ - logunsupported=1 - ${srcdir}/scripts/pnglibconf.dfa 1>&2 + $(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out logunsupported=1 + version=search ${srcdir}/pngconf.h -\ + ${srcdir}/scripts/pnglibconf.dfa 1>&2 $(AWK) -f ${srcdir}/scripts/options.awk out=dfn2.out dfn1.out 1>&2 rm dfn1.out mv dfn2.out $@ diff --git a/Build/source/libs/libpng/libpng-1.5.5/README b/Build/source/libs/libpng/libpng-1.5.7/README index a540e83cac1..ec6a6a23273 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/README +++ b/Build/source/libs/libpng/libpng-1.5.7/README @@ -1,4 +1,4 @@ -README for libpng version 1.5.5 - September 22, 2011 (shared library 15.0) +README for libpng version 1.5.7 - December 15, 2011 (shared library 15.0) See the note about version numbers near the top of png.h See INSTALL for instructions on how to install libpng. diff --git a/Build/source/libs/libpng/libpng-1.5.5/TODO b/Build/source/libs/libpng/libpng-1.5.7/TODO index 6e1f028bd75..6e1f028bd75 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/TODO +++ b/Build/source/libs/libpng/libpng-1.5.7/TODO diff --git a/Build/source/libs/libpng/libpng-1.5.5/aclocal.m4 b/Build/source/libs/libpng/libpng-1.5.7/aclocal.m4 index e788a89596e..ff7616aeeab 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/aclocal.m4 +++ b/Build/source/libs/libpng/libpng-1.5.7/aclocal.m4 @@ -22,8 +22,8 @@ To do so, use the procedure documented by the package, typically `autoreconf'.]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -32,8 +32,8 @@ To do so, use the procedure documented by the package, typically `autoreconf'.]) m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -167,6 +167,8 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -652,7 +654,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -816,6 +818,7 @@ AC_DEFUN([LT_LANG], m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], @@ -837,6 +840,29 @@ m4_defun([_LT_LANG], ])# _LT_LANG +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], @@ -867,6 +893,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ], m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) @@ -969,7 +999,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -977,6 +1013,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ rm -rf libconftest.dylib* rm -f conftest.* fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -988,6 +1025,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF @@ -1005,7 +1043,9 @@ _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1050,8 +1090,8 @@ _LT_EOF ]) -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ @@ -1062,6 +1102,8 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi @@ -1345,14 +1387,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -1429,13 +1484,13 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -1615,6 +1670,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -1654,7 +1714,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do @@ -2200,7 +2260,7 @@ need_version=unknown case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -2209,7 +2269,7 @@ aix3*) ;; aix[[4-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -2274,7 +2334,7 @@ beos*) ;; bsdi[[45]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -2413,7 +2473,7 @@ m4_if([$1], [],[ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -2421,10 +2481,6 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -2432,7 +2488,7 @@ freebsd* | dragonfly*) objformat=`/usr/bin/objformat` else case $host_os in - freebsd[[123]]*) objformat=aout ;; + freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -2450,7 +2506,7 @@ freebsd* | dragonfly*) esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) @@ -2470,17 +2526,18 @@ freebsd* | dragonfly*) ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -2541,7 +2598,7 @@ hpux9* | hpux10* | hpux11*) ;; interix[[3-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -2557,7 +2614,7 @@ irix5* | irix6* | nonstopux*) nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -2594,9 +2651,9 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2659,7 +2716,7 @@ netbsd*) ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -2728,7 +2785,7 @@ rdos*) ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2753,7 +2810,7 @@ sunos4*) ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2777,7 +2834,7 @@ sysv4 | sysv4.3*) sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -2808,7 +2865,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2818,7 +2875,7 @@ tpf*) ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -3240,7 +3297,7 @@ irix5* | irix6* | nonstopux*) lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3660,6 +3717,7 @@ for ac_symprfx in "" "_"; do # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -4244,7 +4302,9 @@ m4_if([$1], [CXX], [ case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi ;; esac else @@ -4336,18 +4396,33 @@ m4_if([$1], [CXX], [ ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; esac ;; esac @@ -4507,7 +4582,9 @@ m4_if([$1], [CXX], [ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) ;; + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] @@ -4532,7 +4609,6 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -4783,8 +4859,7 @@ _LT_EOF xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ @@ -5079,6 +5154,7 @@ _LT_EOF # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' @@ -5125,10 +5201,6 @@ _LT_EOF _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; - freebsd1*) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -5141,7 +5213,7 @@ _LT_EOF ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -5180,7 +5252,6 @@ _LT_EOF fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes @@ -5622,9 +5693,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1], _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], @@ -5778,7 +5846,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -6148,7 +6215,7 @@ if test "$_lt_caught_CXX_error" != yes; then esac ;; - freebsd[[12]]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no @@ -6909,12 +6976,18 @@ public class foo { } }; _LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary @@ -7111,7 +7184,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7244,7 +7316,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7427,6 +7498,73 @@ CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler @@ -7496,6 +7634,13 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], @@ -8160,9 +8305,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) @@ -8334,15 +8494,15 @@ m4_define([lt_dict_filter], # @configure_input@ -# serial 3293 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4]) -m4_define([LT_PACKAGE_REVISION], [1.3293]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4' -macro_revision='1.3293' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) @@ -8482,6 +8642,28 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +# Figure out how to run the assembler. -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_PROG_AS +# ---------- +AC_DEFUN([AM_PROG_AS], +[# By default we simply use the C compiler to build assembly code. +AC_REQUIRE([AC_PROG_CC]) +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS +AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) +AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl +]) + # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. diff --git a/Build/source/libs/libpng/libpng-1.5.7/arm/filter_neon.S b/Build/source/libs/libpng/libpng-1.5.7/arm/filter_neon.S new file mode 100644 index 00000000000..63a5d8c17ff --- /dev/null +++ b/Build/source/libs/libpng/libpng-1.5.7/arm/filter_neon.S @@ -0,0 +1,225 @@ + +/* filter_neon.S - NEON optimised filter functions + * + * Copyright (c) 2011 Glenn Randers-Pehrson + * Written by Mans Rullgard, 2011. + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */ +#endif + +#ifdef __ELF__ +# define ELF +#else +# define ELF @ +#endif + + .arch armv7-a + .fpu neon + +.macro func name, export=0 + .macro endfunc +ELF .size \name, . - \name + .endfunc + .purgem endfunc + .endm + .text + .if \export + .global \name + .endif +ELF .type \name, STT_FUNC + .func \name +\name: +.endm + +func png_read_filter_row_sub4_neon, export=1 + ldr r3, [r0, #4] @ rowbytes + vmov.i8 d3, #0 +1: + vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128] + vadd.u8 d0, d3, d4 + vadd.u8 d1, d0, d5 + vadd.u8 d2, d1, d6 + vadd.u8 d3, d2, d7 + vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]! + subs r3, r3, #16 + bgt 1b + + bx lr +endfunc + +func png_read_filter_row_sub3_neon, export=1 + ldr r3, [r0, #4] @ rowbytes + vmov.i8 d3, #0 + mov r0, r1 + mov r2, #3 + mov r12, #12 + vld1.8 {q11}, [r0], r12 +1: + vext.8 d5, d22, d23, #3 + vadd.u8 d0, d3, d22 + vext.8 d6, d22, d23, #6 + vadd.u8 d1, d0, d5 + vext.8 d7, d23, d23, #1 + vld1.8 {q11}, [r0], r12 + vst1.32 {d0[0]}, [r1,:32], r2 + vadd.u8 d2, d1, d6 + vst1.32 {d1[0]}, [r1], r2 + vadd.u8 d3, d2, d7 + vst1.32 {d2[0]}, [r1], r2 + vst1.32 {d3[0]}, [r1], r2 + subs r3, r3, #12 + bgt 1b + + bx lr +endfunc + +func png_read_filter_row_up_neon, export=1 + ldr r3, [r0, #4] @ rowbytes +1: + vld1.8 {q0}, [r1,:128] + vld1.8 {q1}, [r2,:128]! + vadd.u8 q0, q0, q1 + vst1.8 {q0}, [r1,:128]! + subs r3, r3, #16 + bgt 1b + + bx lr +endfunc + +func png_read_filter_row_avg4_neon, export=1 + ldr r12, [r0, #4] @ rowbytes + vmov.i8 d3, #0 +1: + vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128] + vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]! + vhadd.u8 d0, d3, d16 + vadd.u8 d0, d0, d4 + vhadd.u8 d1, d0, d17 + vadd.u8 d1, d1, d5 + vhadd.u8 d2, d1, d18 + vadd.u8 d2, d2, d6 + vhadd.u8 d3, d2, d19 + vadd.u8 d3, d3, d7 + vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]! + subs r12, r12, #16 + bgt 1b + + bx lr +endfunc + +func png_read_filter_row_avg3_neon, export=1 + push {r4,lr} + ldr r12, [r0, #4] @ rowbytes + vmov.i8 d3, #0 + mov r0, r1 + mov r4, #3 + mov lr, #12 + vld1.8 {q11}, [r0], lr +1: + vld1.8 {q10}, [r2], lr + vext.8 d5, d22, d23, #3 + vhadd.u8 d0, d3, d20 + vext.8 d17, d20, d21, #3 + vadd.u8 d0, d0, d22 + vext.8 d6, d22, d23, #6 + vhadd.u8 d1, d0, d17 + vext.8 d18, d20, d21, #6 + vadd.u8 d1, d1, d5 + vext.8 d7, d23, d23, #1 + vld1.8 {q11}, [r0], lr + vst1.32 {d0[0]}, [r1,:32], r4 + vhadd.u8 d2, d1, d18 + vst1.32 {d1[0]}, [r1], r4 + vext.8 d19, d21, d21, #1 + vadd.u8 d2, d2, d6 + vhadd.u8 d3, d2, d19 + vst1.32 {d2[0]}, [r1], r4 + vadd.u8 d3, d3, d7 + vst1.32 {d3[0]}, [r1], r4 + subs r12, r12, #12 + bgt 1b + + pop {r4,pc} +endfunc + +.macro paeth rx, ra, rb, rc + vaddl.u8 q12, \ra, \rb @ a + b + vaddl.u8 q15, \rc, \rc @ 2*c + vabdl.u8 q13, \rb, \rc @ pa + vabdl.u8 q14, \ra, \rc @ pb + vabd.u16 q15, q12, q15 @ pc + vcle.u16 q12, q13, q14 @ pa <= pb + vcle.u16 q13, q13, q15 @ pa <= pc + vcle.u16 q14, q14, q15 @ pb <= pc + vand q12, q12, q13 @ pa <= pb && pa <= pc + vmovn.u16 d28, q14 + vmovn.u16 \rx, q12 + vbsl d28, \rb, \rc + vbsl \rx, \ra, d28 +.endm + +func png_read_filter_row_paeth4_neon, export=1 + ldr r12, [r0, #4] @ rowbytes + vmov.i8 d3, #0 + vmov.i8 d20, #0 +1: + vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128] + vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]! + paeth d0, d3, d16, d20 + vadd.u8 d0, d0, d4 + paeth d1, d0, d17, d16 + vadd.u8 d1, d1, d5 + paeth d2, d1, d18, d17 + vadd.u8 d2, d2, d6 + paeth d3, d2, d19, d18 + vmov d20, d19 + vadd.u8 d3, d3, d7 + vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]! + subs r12, r12, #16 + bgt 1b + + bx lr +endfunc + +func png_read_filter_row_paeth3_neon, export=1 + push {r4,lr} + ldr r12, [r0, #4] @ rowbytes + vmov.i8 d3, #0 + vmov.i8 d4, #0 + mov r0, r1 + mov r4, #3 + mov lr, #12 + vld1.8 {q11}, [r0], lr +1: + vld1.8 {q10}, [r2], lr + paeth d0, d3, d20, d4 + vext.8 d5, d22, d23, #3 + vadd.u8 d0, d0, d22 + vext.8 d17, d20, d21, #3 + paeth d1, d0, d17, d20 + vst1.32 {d0[0]}, [r1,:32], r4 + vext.8 d6, d22, d23, #6 + vadd.u8 d1, d1, d5 + vext.8 d18, d20, d21, #6 + paeth d2, d1, d18, d17 + vext.8 d7, d23, d23, #1 + vld1.8 {q11}, [r0], lr + vst1.32 {d1[0]}, [r1], r4 + vadd.u8 d2, d2, d6 + vext.8 d19, d21, d21, #1 + paeth d3, d2, d19, d18 + vst1.32 {d2[0]}, [r1], r4 + vmov d4, d19 + vadd.u8 d3, d3, d7 + vst1.32 {d3[0]}, [r1], r4 + subs r12, r12, #12 + bgt 1b + + pop {r4,pc} +endfunc diff --git a/Build/source/libs/libpng/libpng-1.5.5/autogen.sh b/Build/source/libs/libpng/libpng-1.5.7/autogen.sh index 5be104eb1d9..5be104eb1d9 100755 --- a/Build/source/libs/libpng/libpng-1.5.5/autogen.sh +++ b/Build/source/libs/libpng/libpng-1.5.7/autogen.sh diff --git a/Build/source/libs/libpng/libpng-1.5.5/config.h.in b/Build/source/libs/libpng/libpng-1.5.7/config.h.in index fb2349568cd..d1547427384 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/config.h.in +++ b/Build/source/libs/libpng/libpng-1.5.7/config.h.in @@ -3,6 +3,9 @@ /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the `feenableexcept' function. */ +#undef HAVE_FEENABLEEXCEPT + /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H @@ -70,6 +73,12 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* Align row buffers */ +#undef PNG_ALIGNED_MEMORY_SUPPORTED + +/* Enable ARM NEON optimizations */ +#undef PNG_ARM_NEON + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -82,5 +91,19 @@ /* Define to empty if `const' does not conform to ANSI C. */ #undef const +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif + /* Define to `unsigned int' if <sys/types.h> does not define. */ #undef size_t diff --git a/Build/source/libs/libpng/libpng-1.5.5/configure b/Build/source/libs/libpng/libpng-1.5.7/configure index d078444dc9a..0eb468b9d65 100755 --- a/Build/source/libs/libpng/libpng-1.5.5/configure +++ b/Build/source/libs/libpng/libpng-1.5.7/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for libpng 1.5.5. +# Generated by GNU Autoconf 2.68 for libpng 1.5.7. # # Report bugs to <png-mng-implement@lists.sourceforge.net>. # @@ -570,8 +570,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libpng' PACKAGE_TARNAME='libpng' -PACKAGE_VERSION='1.5.5' -PACKAGE_STRING='libpng 1.5.5' +PACKAGE_VERSION='1.5.7' +PACKAGE_STRING='libpng 1.5.7' PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net' PACKAGE_URL='' @@ -615,6 +615,9 @@ ac_includes_default="\ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS +PNG_ARM_NEON_FALSE +PNG_ARM_NEON_TRUE +AM_CCASFLAGS binconfigs pkgconfigdir PNGLIB_RELEASE @@ -661,6 +664,11 @@ build_os build_vendor build_cpu build +am__fastdepCCAS_FALSE +am__fastdepCCAS_TRUE +CCASDEPMODE +CCASFLAGS +CCAS am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -756,6 +764,7 @@ enable_libtool_lock with_zlib_prefix with_pkgconfigdir with_binconfigs +enable_arm_neon ' ac_precious_vars='build_alias host_alias @@ -765,7 +774,10 @@ CFLAGS LDFLAGS LIBS CPPFLAGS -CPP' +CCAS +CCASFLAGS +CPP +CPPFLAGS' # Initialize some variables set by options. @@ -1308,7 +1320,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libpng 1.5.5 to adapt to many kinds of systems. +\`configure' configures libpng 1.5.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1378,7 +1390,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libpng 1.5.5:";; + short | recursive ) echo "Configuration of libpng 1.5.7:";; esac cat <<\_ACEOF @@ -1395,12 +1407,13 @@ Optional Features: --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --enable-arm-neon Enable ARM NEON optimizations Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-pic try to use only PIC/non-PIC objects [default=use + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). @@ -1418,6 +1431,8 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> + CCAS assembler compiler command (defaults to CC) + CCASFLAGS assembler compiler flags (defaults to CFLAGS) CPP C preprocessor Use these variables to override the choices made by `configure' or to help @@ -1486,7 +1501,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libpng configure 1.5.5 +libpng configure 1.5.7 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1909,7 +1924,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libpng $as_me 1.5.5, which was +It was created by libpng $as_me 1.5.7, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2724,7 +2739,7 @@ fi # Define the identity of the package. PACKAGE='libpng' - VERSION='1.5.5' + VERSION='1.5.7' cat >>confdefs.h <<_ACEOF @@ -2788,10 +2803,10 @@ fi -PNGLIB_VERSION=1.5.5 +PNGLIB_VERSION=1.5.7 PNGLIB_MAJOR=1 PNGLIB_MINOR=5 -PNGLIB_RELEASE=5 +PNGLIB_RELEASE=7 @@ -3784,6 +3799,138 @@ else fi +# By default we simply use the C compiler to build assembly code. + +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS + + + +depcc="$CCAS" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CCAS_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CCAS_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CCAS_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CCAS_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } +CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then + am__fastdepCCAS_TRUE= + am__fastdepCCAS_FALSE='#' +else + am__fastdepCCAS_TRUE='#' + am__fastdepCCAS_FALSE= +fi + + # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 @@ -4689,8 +4836,8 @@ esac -macro_version='2.4' -macro_revision='1.3293' +macro_version='2.4.2' +macro_revision='1.3337' @@ -4991,6 +5138,11 @@ else lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -5030,7 +5182,7 @@ else # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do @@ -5456,7 +5608,7 @@ irix5* | irix6* | nonstopux*) lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -6094,13 +6246,13 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -6247,6 +6399,7 @@ for ac_symprfx in "" "_"; do # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -6635,7 +6788,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -6646,7 +6799,20 @@ sparc*-*solaris*) case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -7286,7 +7452,13 @@ else $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -7297,6 +7469,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : @@ -7329,6 +7502,7 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : @@ -7350,7 +7524,9 @@ _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 @@ -7916,7 +8092,22 @@ fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : - withval=$with_pic; pic_mode="$withval" + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else pic_mode=default fi @@ -7994,6 +8185,10 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + test -z "$LN_S" && LN_S="ln -s" @@ -8449,7 +8644,9 @@ lt_prog_compiler_static= case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' - lt_prog_compiler_pic='-Xcompiler -fPIC' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi ;; esac else @@ -8540,18 +8737,33 @@ lt_prog_compiler_static= ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; esac ;; esac @@ -8913,7 +9125,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported @@ -9163,8 +9374,7 @@ _LT_EOF xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld='-rpath $libdir' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ @@ -9543,6 +9753,7 @@ fi # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' @@ -9588,6 +9799,7 @@ fi hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else whole_archive_flag_spec='' fi @@ -9616,10 +9828,6 @@ fi hardcode_shlibpath_var=no ;; - freebsd1*) - ld_shlibs=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -9632,7 +9840,7 @@ fi ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes @@ -9671,7 +9879,6 @@ fi fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes @@ -10295,11 +10502,6 @@ esac - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } @@ -10389,7 +10591,7 @@ need_version=unknown case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -10398,7 +10600,7 @@ aix3*) ;; aix[4-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -10463,7 +10665,7 @@ beos*) ;; bsdi[45]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -10602,7 +10804,7 @@ darwin* | rhapsody*) ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -10610,10 +10812,6 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -10621,7 +10819,7 @@ freebsd* | dragonfly*) objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -10639,7 +10837,7 @@ freebsd* | dragonfly*) esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -10659,17 +10857,18 @@ freebsd* | dragonfly*) ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -10730,7 +10929,7 @@ hpux9* | hpux10* | hpux11*) ;; interix[3-9]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -10746,7 +10945,7 @@ irix5* | irix6* | nonstopux*) nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -10783,9 +10982,9 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10867,7 +11066,7 @@ netbsd*) ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -10936,7 +11135,7 @@ rdos*) ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -10961,7 +11160,7 @@ sunos4*) ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -10985,7 +11184,7 @@ sysv4 | sysv4.3*) sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -11016,7 +11215,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -11026,7 +11225,7 @@ tpf*) ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -11808,6 +12007,8 @@ CC="$lt_save_CC" + + ac_config_commands="$ac_config_commands libtool" @@ -12111,6 +12312,52 @@ $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +$as_echo_n "checking for C/C++ restrict keyword... " >&6; } +if ${ac_cv_c_restrict+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int * int_ptr; + int foo (int_ptr $ac_kw ip) { + return ip[0]; + } +int +main () +{ +int s[1]; + int * $ac_kw t = s; + t[0] = 0; + return foo(t) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +$as_echo "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) $as_echo "#define restrict /**/" >>confdefs.h + ;; + *) cat >>confdefs.h <<_ACEOF +#define restrict $ac_cv_c_restrict +_ACEOF + ;; + esac + # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 @@ -12402,6 +12649,65 @@ fi fi +# The following is for pngvalid, to ensure it catches FP errors even on +# platforms that don't enable FP exceptions, the function appears in the math +# library (typically), it's not an error if it is not found. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for feenableexcept in -lm" >&5 +$as_echo_n "checking for feenableexcept in -lm... " >&6; } +if ${ac_cv_lib_m_feenableexcept+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char feenableexcept (); +int +main () +{ +return feenableexcept (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_feenableexcept=yes +else + ac_cv_lib_m_feenableexcept=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_feenableexcept" >&5 +$as_echo "$ac_cv_lib_m_feenableexcept" >&6; } +if test "x$ac_cv_lib_m_feenableexcept" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +fi + +for ac_func in feenableexcept +do : + ac_fn_c_check_func "$LINENO" "feenableexcept" "ac_cv_func_feenableexcept" +if test "x$ac_cv_func_feenableexcept" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FEENABLEEXCEPT 1 +_ACEOF + +fi +done + LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG LIBPNG_DEFINES=$LIBPNG_DEFINES @@ -12521,6 +12827,33 @@ fi +# Because GCC by default assembles code with an executable stack, even though it +# compiles C code with a non-executable stack, it is necessary to do a fixup +# here (this may by GCC specific) +AM_CCASFLAGS=-Wa,--noexecstack + + +# Check whether --enable-arm-neon was given. +if test "${enable_arm_neon+set}" = set; then : + enableval=$enable_arm_neon; if test "${enableval}" = yes; then + +$as_echo "#define PNG_ARM_NEON 1" >>confdefs.h + + +$as_echo "#define PNG_ALIGNED_MEMORY_SUPPORTED 1" >>confdefs.h + + fi +fi + + if test "${enable_arm_neon:-no}" = yes; then + PNG_ARM_NEON_TRUE= + PNG_ARM_NEON_FALSE='#' +else + PNG_ARM_NEON_TRUE='#' + PNG_ARM_NEON_FALSE= +fi + + # Config files, substituting as above ac_config_files="$ac_config_files Makefile libpng.pc:libpng.pc.in" @@ -12656,6 +12989,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_SOLARIS_LD_TRUE}" && test -z "${HAVE_SOLARIS_LD_FALSE}"; then as_fn_error $? "conditional \"HAVE_SOLARIS_LD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -12664,6 +13001,10 @@ if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT as_fn_error $? "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${PNG_ARM_NEON_TRUE}" && test -z "${PNG_ARM_NEON_FALSE}"; then + as_fn_error $? "conditional \"PNG_ARM_NEON\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -13073,7 +13414,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libpng $as_me 1.5.5, which was +This file was extended by libpng $as_me 1.5.7, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13139,7 +13480,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libpng config.status 1.5.5 +libpng config.status 1.5.7 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -13285,6 +13626,7 @@ enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' @@ -13359,7 +13701,6 @@ with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' @@ -13423,6 +13764,7 @@ LD \ AS \ DLLTOOL \ OBJDUMP \ +PATH_SEPARATOR \ NM \ LN_S \ lt_SP2NL \ @@ -13466,7 +13808,6 @@ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ -hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ @@ -14264,8 +14605,8 @@ $as_echo X"$file" | # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -14343,6 +14684,9 @@ pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + # The host system. host_alias=$host_alias host=$host @@ -14623,10 +14967,6 @@ no_undefined_flag=$lt_no_undefined_flag # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator diff --git a/Build/source/libs/libpng/libpng-1.5.5/configure.ac b/Build/source/libs/libpng/libpng-1.5.7/configure.ac index 18f62c1abd6..550553ed893 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/configure.ac +++ b/Build/source/libs/libpng/libpng-1.5.7/configure.ac @@ -18,15 +18,15 @@ AC_PREREQ(2.59) dnl Version number stuff here: -AC_INIT([libpng], [1.5.5], [png-mng-implement@lists.sourceforge.net]) +AC_INIT([libpng], [1.5.7], [png-mng-implement@lists.sourceforge.net]) AM_INIT_AUTOMAKE dnl stop configure from automagically running automake AM_MAINTAINER_MODE -PNGLIB_VERSION=1.5.5 +PNGLIB_VERSION=1.5.7 PNGLIB_MAJOR=1 PNGLIB_MINOR=5 -PNGLIB_RELEASE=5 +PNGLIB_RELEASE=7 dnl End of version number stuff @@ -36,6 +36,7 @@ AM_CONFIG_HEADER(config.h) # Checks for programs. AC_LANG([C]) AC_PROG_CC +AM_PROG_AS AC_PROG_LD AC_PROG_CPP AC_CHECK_TOOL(SED, sed, :) @@ -75,6 +76,7 @@ AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h]) AC_C_CONST AC_TYPE_SIZE_T AC_STRUCT_TM +AC_C_RESTRICT # Checks for library functions. AC_FUNC_STRTOD @@ -89,6 +91,11 @@ AC_CHECK_LIB(z, zlibVersion, , AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, , AC_ERROR([zlib not installed]))) +# The following is for pngvalid, to ensure it catches FP errors even on +# platforms that don't enable FP exceptions, the function appears in the math +# library (typically), it's not an error if it is not found. +AC_CHECK_LIB([m], [feenableexcept]) +AC_CHECK_FUNCS([feenableexcept]) LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG LIBPNG_DEFINES=$LIBPNG_DEFINES @@ -177,6 +184,19 @@ AC_ARG_WITH(binconfigs, [binconfigs='${binconfigs}']) AC_SUBST([binconfigs]) +# Because GCC by default assembles code with an executable stack, even though it +# compiles C code with a non-executable stack, it is necessary to do a fixup +# here (this may by GCC specific) +AC_SUBST([AM_CCASFLAGS], [-Wa,--noexecstack]) + +AC_ARG_ENABLE([arm-neon], + AC_HELP_STRING([--enable-arm-neon], [Enable ARM NEON optimizations]), + [if test "${enableval}" = yes; then + AC_DEFINE([PNG_ARM_NEON], [1], [Enable ARM NEON optimizations]) + AC_DEFINE([PNG_ALIGNED_MEMORY_SUPPORTED], [1], [Align row buffers]) + fi]) +AM_CONDITIONAL([PNG_ARM_NEON], [test "${enable_arm_neon:-no}" = yes]) + # Config files, substituting as above AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in]) AC_CONFIG_FILES([libpng-config:libpng-config.in], diff --git a/Build/source/libs/libpng/libpng-1.5.7/contrib/README.txt b/Build/source/libs/libpng/libpng-1.5.7/contrib/README.txt new file mode 100644 index 00000000000..bcd433d3523 --- /dev/null +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/README.txt @@ -0,0 +1,4 @@ + +This "contrib" directory contains contributions which are not necessarily under +the libpng license, although all are open source. They are not part of +libpng proper and are not used for building the library. diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/COPYING b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/COPYING index a3e97747969..a3e97747969 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/COPYING +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/COPYING diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/LICENSE b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/LICENSE index d9567178cb6..d9567178cb6 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/LICENSE +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/LICENSE diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.mingw32 b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/Makefile.mingw32 index e70a59aef2b..e70a59aef2b 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.mingw32 +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/Makefile.mingw32 diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.sgi b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/Makefile.sgi index 91623acf068..91623acf068 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.sgi +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/Makefile.sgi diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.unx b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/Makefile.unx index b52d8b6aa65..b52d8b6aa65 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.unx +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/Makefile.unx diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.w32 b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/Makefile.w32 index 41cfb231a2c..41cfb231a2c 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.w32 +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/Makefile.w32 diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/README b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/README index 7b1f6a3ea62..7b1f6a3ea62 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/README +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/README diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/makevms.com b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/makevms.com index f32bcaba7f9..f32bcaba7f9 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/makevms.com +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/makevms.com diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readpng.c index df42c301b3c..df42c301b3c 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readpng.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng.h b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readpng.h index fad9fe3b4c5..fad9fe3b4c5 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng.h +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readpng.h diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng2.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readpng2.c index b9746b75608..b9746b75608 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng2.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readpng2.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng2.h b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readpng2.h index 6b3660d7c17..6b3660d7c17 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng2.h +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readpng2.h diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readppm.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readppm.c index be9a56d95fd..be9a56d95fd 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readppm.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/readppm.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng-win.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/rpng-win.c index f53ddc8ece6..f53ddc8ece6 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng-win.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/rpng-win.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng-x.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/rpng-x.c index 6d10e1b84ed..6d10e1b84ed 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng-x.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/rpng-x.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng2-win.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/rpng2-win.c index fbdacb59bc4..223e737409a 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng2-win.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/rpng2-win.c @@ -590,7 +590,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) "(unexpectedly) while reading PNG image file\n"); exit(3); } else /* if (error) */ { - // will print error message below + /* will print error message below */ } break; } diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng2-x.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/rpng2-x.c index b04c5c6b69a..7f24b632be0 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng2-x.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/rpng2-x.c @@ -591,7 +591,7 @@ int main(int argc, char **argv) "(unexpectedly) while reading PNG image file\n"); exit(3); } else /* if (error) */ { - // will print error message below + /* will print error message below */ } break; } diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/toucan.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/toucan.png Binary files differindex 03960d49399..03960d49399 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/toucan.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/toucan.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/wpng.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/wpng.c index a06e3529ecb..a06e3529ecb 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/wpng.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/wpng.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/writepng.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/writepng.c index f07f4a8a02d..f07f4a8a02d 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/writepng.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/writepng.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/writepng.h b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/writepng.h index 78b966b5874..78b966b5874 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/writepng.h +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/gregbook/writepng.h diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngvalid.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/libtests/pngvalid.c index a3626b279b1..36f0b4d8904 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngvalid.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/libtests/pngvalid.c @@ -1,7 +1,7 @@ /* pngvalid.c - validate libpng by constructing then reading png files. * - * Last changed in libpng 1.5.5 [September 22, 2011] + * Last changed in libpng 1.5.7 [%RDATE%] * Copyright (c) 2011 Glenn Randers-Pehrson * Written by John Cunningham Bowler * @@ -20,10 +20,23 @@ */ #define _POSIX_SOURCE 1 +#define _ISOC99_SOURCE 1 /* For floating point */ +#define _GNU_SOURCE 1 /* For the floating point exception extension */ + +#include <signal.h> + +#ifdef HAVE_CONFIG_H +# include "../../config.h" +#endif + +#ifdef HAVE_FEENABLEEXCEPT +# include <fenv.h> +#endif + +#include "../../png.h" -#include "png.h" #if PNG_LIBPNG_VER < 10500 -/* This delibarately lacks the PNG_CONST. */ +/* This deliberately lacks the PNG_CONST. */ typedef png_byte *png_const_bytep; /* This is copied from 1.5.1 png.h: */ @@ -77,7 +90,7 @@ typedef png_byte *png_const_bytep; #endif /***************************** EXCEPTION HANDLING *****************************/ -#include "contrib/visupng/cexcept.h" +#include "../visupng/cexcept.h" #ifdef __cplusplus # define this not_the_cpp_this @@ -433,12 +446,35 @@ pixel_copy(png_bytep toBuffer, png_uint_32 toIndex, memmove(toBuffer+(toIndex>>3), fromBuffer+(fromIndex>>3), pixelSize>>3); } +/* Copy a complete row of pixels, taking into account potential partial + * bytes at the end. + */ +static void +row_copy(png_bytep toBuffer, png_const_bytep fromBuffer, unsigned int bitWidth) +{ + memcpy(toBuffer, fromBuffer, bitWidth >> 3); + + if ((bitWidth & 7) != 0) + { + unsigned int mask; + + toBuffer += bitWidth >> 3; + fromBuffer += bitWidth >> 3; + /* The remaining bits are in the top of the byte, the mask is the bits to + * retain. + */ + mask = 0xff >> (bitWidth & 7); + *toBuffer = (png_byte)((*toBuffer & mask) | (*fromBuffer & ~mask)); + } +} + /* Compare pixels - they are assumed to start at the first byte in the * given buffers. */ static int pixel_cmp(png_const_bytep pa, png_const_bytep pb, png_uint_32 bit_width) { +#if PNG_LIBPNG_VER < 10506 if (memcmp(pa, pb, bit_width>>3) == 0) { png_uint_32 p; @@ -459,8 +495,21 @@ pixel_cmp(png_const_bytep pa, png_const_bytep pb, png_uint_32 bit_width) if (p == 0) return 0; } +#else + /* From libpng-1.5.6 the overwrite should be fixed, so compare the trailing + * bits too: + */ + if (memcmp(pa, pb, (bit_width+7)>>3) == 0) + return 0; +#endif + + /* Return the index of the changed byte. */ + { + png_uint_32 where = 0; - return 1; /* Different */ + while (pa[where] == pb[where]) ++where; + return 1+where; + } } /*************************** BASIC PNG FILE WRITING ***************************/ @@ -795,6 +844,19 @@ store_log(png_store* ps, png_structp pp, png_const_charp message, int is_error) store_verbose(ps, pp, is_error ? "error: " : "warning: ", message); } +/* Internal error function, called with a png_store but no libpng stuff. */ +static void +internal_error(png_store *ps, png_const_charp message) +{ + store_log(ps, NULL, message, 1 /* error */); + + /* And finally throw an exception. */ + { + struct exception_context *the_exception_context = &ps->exception_context; + Throw ps; + } +} + /* Functions to use as PNG callbacks. */ static void store_error(png_structp pp, png_const_charp message) /* PNG_NORETURN */ @@ -902,11 +964,13 @@ store_ensure_image(png_store *ps, png_structp pp, int nImages, png_size_t cbRow, ps->cb_row = cbRow; ps->image_h = cRows; - /* For error checking, the whole buffer is set to '1' - this matches what - * happens with the 'size' test images on write and also matches the unused - * bits in the test rows. + /* For error checking, the whole buffer is set to 10110010 (0xb2 - 178). + * This deliberately doesn't match the bits in the size test image which are + * outside the image; these are set to 0xff (all 1). To make the row + * comparison work in the 'size' test case the size rows are pre-initialized + * to the same value prior to calling 'standard_row'. */ - memset(ps->image, 0xff, cb); + memset(ps->image, 178, cb); /* Then put in the marks. */ while (--nImages >= 0) @@ -1294,7 +1358,21 @@ store_malloc(png_structp pp, png_alloc_size_t cb) } else - store_pool_error(pool->store, pp, "out of memory"); + { + /* NOTE: the PNG user malloc function cannot use the png_ptr it is passed + * other than to retrieve the allocation pointer! libpng calls the + * store_malloc callback in two basic cases: + * + * 1) From png_malloc; png_malloc will do a png_error itself if NULL is + * returned. + * 2) From png_struct or png_info structure creation; png_malloc is + * to return so cleanup can be performed. + * + * To handle this store_malloc can log a message, but can't do anything + * else. + */ + store_log(pool->store, pp, "out of memory", 1 /* is_error */); + } return new; } @@ -1305,6 +1383,14 @@ store_free(png_structp pp, png_voidp memory) store_pool *pool = voidcast(store_pool*, png_get_mem_ptr(pp)); store_memory *this = voidcast(store_memory*, memory), **test; + /* Because libpng calls store_free with a dummy png_struct when deleting + * png_struct or png_info via png_destroy_struct_2 it is necessary to check + * the passed in png_structp to ensure it is valid, and not pass it to + * png_error if it is not. + */ + if (pp != pool->store->pread && pp != pool->store->pwrite) + pp = NULL; + /* First check that this 'memory' really is valid memory - it must be in the * pool list. If it is, use the shared memory_free function to free it. */ @@ -1709,6 +1795,11 @@ typedef struct png_modifier double error_indexed; /* Flags: */ + /* Whether to call png_read_update_info, not png_read_start_image, and how + * many times to call it. + */ + int use_update_info; + /* Whether or not to interlace. */ int interlace_type :9; /* int, but must store '1' */ @@ -1792,6 +1883,7 @@ modifier_init(png_modifier *pm) pm->error_gray_2 = pm->error_gray_4 = pm->error_gray_8 = 0; pm->error_gray_16 = pm->error_color_8 = pm->error_color_16 = 0; pm->error_indexed = 0; + pm->use_update_info = 0; pm->interlace_type = PNG_INTERLACE_NONE; pm->test_standard = 0; pm->test_size = 0; @@ -3613,9 +3705,11 @@ static PNG_CONST struct }; static void -make_error(png_store* volatile ps, png_byte PNG_CONST colour_type, +make_error(png_store* volatile psIn, png_byte PNG_CONST colour_type, png_byte bit_depth, int interlace_type, int test, png_const_charp name) { + png_store * volatile ps = psIn; + context(ps, fault); Try @@ -3878,6 +3972,7 @@ typedef struct standard_display int do_interlace; /* Do interlacing internally */ int is_transparent; /* Transparency information was present. */ int speed; /* Doing a speed test */ + int use_update_info;/* Call update_info, not start_image */ struct { png_uint_16 red; @@ -3891,13 +3986,15 @@ typedef struct standard_display static void standard_display_init(standard_display *dp, png_store* ps, png_uint_32 id, - int do_interlace) + int do_interlace, int use_update_info) { memset(dp, 0, sizeof *dp); dp->ps = ps; dp->colour_type = COL_FROM_ID(id); dp->bit_depth = DEPTH_FROM_ID(id); + if (dp->bit_depth < 1 || dp->bit_depth > 16) + internal_error(ps, "internal: bad bit depth"); if (dp->colour_type == 3) dp->red_sBIT = dp->blue_sBIT = dp->green_sBIT = dp->alpha_sBIT = 8; else @@ -3915,6 +4012,7 @@ standard_display_init(standard_display *dp, png_store* ps, png_uint_32 id, dp->do_interlace = do_interlace; dp->is_transparent = 0; dp->speed = ps->speed; + dp->use_update_info = use_update_info; dp->npalette = 0; /* Preset the transparent color to black: */ memset(&dp->transparent, 0, sizeof dp->transparent); @@ -3993,7 +4091,7 @@ read_palette(store_palette palette, int *npalette, png_structp pp, png_infop pi) png_error(pp, "validate: invalid PLTE result"); /* But there is no palette, so record this: */ *npalette = 0; - memset(palette, 113, sizeof palette); + memset(palette, 113, sizeof (store_palette)); } trans_alpha = 0; @@ -4272,7 +4370,16 @@ standard_info_imp(standard_display *dp, png_structp pp, png_infop pi, /* And the info callback has to call this (or png_read_update_info - see * below in the png_modifier code for that variant. */ - png_start_read_image(pp); + if (dp->use_update_info) + { + /* For debugging the effect of multiple calls: */ + int i = dp->use_update_info; + while (i-- > 0) + png_read_update_info(pp, pi); + } + + else + png_start_read_image(pp); /* Validate the height, width and rowbytes plus ensure that sufficient buffer * exists for decoding the image. @@ -4330,13 +4437,14 @@ progressive_row(png_structp pp, png_bytep new_row, png_uint_32 y, int pass) row = store_image_row(dp->ps, pp, 0, y); +#ifdef PNG_READ_INTERLACING_SUPPORTED /* Combine the new row into the old: */ if (dp->do_interlace) { if (dp->interlace_type == PNG_INTERLACE_ADAM7) deinterlace_row(row, new_row, dp->pixel_size, dp->w, pass); else - memcpy(row, new_row, dp->cbRow); + row_copy(row, new_row, dp->pixel_size * dp->w); } else png_progressive_combine_row(pp, row, new_row); @@ -4344,6 +4452,7 @@ progressive_row(png_structp pp, png_bytep new_row, png_uint_32 y, int pass) PNG_ROW_IN_INTERLACE_PASS(y, pass) && PNG_PASS_COLS(dp->w, pass) > 0) png_error(pp, "missing row in progressive de-interlacing"); +#endif /* PNG_READ_INTERLACING_SUPPORTED */ } static void @@ -4379,10 +4488,12 @@ sequential_row(standard_display *dp, png_structp pp, png_infop pi, /* The following aids (to some extent) error detection - we can * see where png_read_row wrote. Use opposite values in row and - * display to make this easier. + * display to make this easier. Don't use 0xff (which is used in + * the image write code to fill unused bits) or 0 (which is a + * likely value to overwrite unused bits with). */ - memset(row, 0xff, sizeof row); - memset(display, 0, sizeof display); + memset(row, 0xc5, sizeof row); + memset(display, 0x5c, sizeof display); png_read_row(pp, row, display); @@ -4412,39 +4523,54 @@ static void standard_row_validate(standard_display *dp, png_structp pp, int iImage, int iDisplay, png_uint_32 y) { + int where; png_byte std[STANDARD_ROWMAX]; - memset(std, 0xff, sizeof std); + /* The row must be pre-initialized to the magic number here for the size + * tests to pass: + */ + memset(std, 178, sizeof std); standard_row(pp, std, dp->id, y); /* At the end both the 'row' and 'display' arrays should end up identical. * In earlier passes 'row' will be partially filled in, with only the pixels * that have been read so far, but 'display' will have those pixels * replicated to fill the unread pixels while reading an interlaced image. +#if PNG_LIBPNG_VER < 10506 * The side effect inside the libpng sequential reader is that the 'row' * array retains the correct values for unwritten pixels within the row * bytes, while the 'display' array gets bits off the end of the image (in * the last byte) trashed. Unfortunately in the progressive reader the * row bytes are always trashed, so we always do a pixel_cmp here even though * a memcmp of all cbRow bytes will succeed for the sequential reader. +#endif */ - if (iImage >= 0 && pixel_cmp(std, store_image_row(dp->ps, pp, iImage, y), - dp->bit_width) != 0) + if (iImage >= 0 && + (where = pixel_cmp(std, store_image_row(dp->ps, pp, iImage, y), + dp->bit_width)) != 0) { char msg[64]; - sprintf(msg, "PNG image row %d changed", y); + sprintf(msg, "PNG image row[%d][%d] changed from %.2x to %.2x", y, + where-1, std[where-1], + store_image_row(dp->ps, pp, iImage, y)[where-1]); png_error(pp, msg); } +#if PNG_LIBPNG_VER < 10506 /* In this case use pixel_cmp because we need to compare a partial * byte at the end of the row if the row is not an exact multiple - * of 8 bits wide. + * of 8 bits wide. (This is fixed in libpng-1.5.6 and pixel_cmp is + * changed to match!) */ - if (iDisplay >= 0 && pixel_cmp(std, store_image_row(dp->ps, pp, iDisplay, y), - dp->bit_width) != 0) +#endif + if (iDisplay >= 0 && + (where = pixel_cmp(std, store_image_row(dp->ps, pp, iDisplay, y), + dp->bit_width)) != 0) { char msg[64]; - sprintf(msg, "display row %d changed", y); + sprintf(msg, "display row[%d][%d] changed from %.2x to %.2x", y, + where-1, std[where-1], + store_image_row(dp->ps, pp, iDisplay, y)[where-1]); png_error(pp, msg); } } @@ -4485,7 +4611,7 @@ standard_end(png_structp pp, png_infop pi) /* A single test run checking the standard image to ensure it is not damaged. */ static void standard_test(png_store* PNG_CONST psIn, png_uint_32 PNG_CONST id, - int do_interlace) + int do_interlace, int use_update_info) { standard_display d; context(psIn, fault); @@ -4493,7 +4619,7 @@ standard_test(png_store* PNG_CONST psIn, png_uint_32 PNG_CONST id, /* Set up the display (stack frame) variables from the arguments to the * function and initialize the locals that are filled in later. */ - standard_display_init(&d, psIn, id, do_interlace); + standard_display_init(&d, psIn, id, do_interlace, use_update_info); /* Everything is protected by a Try/Catch. The functions called also * typically have local Try/Catch blocks. @@ -4549,6 +4675,8 @@ standard_test(png_store* PNG_CONST psIn, png_uint_32 PNG_CONST id, */ if (!d.speed) standard_image_validate(&d, pp, 0, 1); + else + d.ps->validated = 1; } } @@ -4578,7 +4706,7 @@ test_standard(png_modifier* PNG_CONST pm, png_byte PNG_CONST colour_type, interlace_type < PNG_INTERLACE_LAST; ++interlace_type) { standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, - interlace_type, 0, 0, 0), 0/*do_interlace*/); + interlace_type, 0, 0, 0), 0/*do_interlace*/, pm->use_update_info); if (fail(pm)) return 0; @@ -4637,25 +4765,29 @@ test_size(png_modifier* PNG_CONST pm, png_byte PNG_CONST colour_type, * to validate. */ standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, - PNG_INTERLACE_NONE, w, h, 0), 0/*do_interlace*/); + PNG_INTERLACE_NONE, w, h, 0), 0/*do_interlace*/, + pm->use_update_info); if (fail(pm)) return 0; standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, - PNG_INTERLACE_NONE, w, h, 1), 0/*do_interlace*/); + PNG_INTERLACE_NONE, w, h, 1), 0/*do_interlace*/, + pm->use_update_info); if (fail(pm)) return 0; standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, - PNG_INTERLACE_ADAM7, w, h, 0), 0/*do_interlace*/); + PNG_INTERLACE_ADAM7, w, h, 0), 0/*do_interlace*/, + pm->use_update_info); if (fail(pm)) return 0; standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, - PNG_INTERLACE_ADAM7, w, h, 1), 0/*do_interlace*/); + PNG_INTERLACE_ADAM7, w, h, 1), 0/*do_interlace*/, + pm->use_update_info); if (fail(pm)) return 0; @@ -4665,13 +4797,15 @@ test_size(png_modifier* PNG_CONST pm, png_byte PNG_CONST colour_type, * to the code used in the non-interlaced case too. */ standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, - PNG_INTERLACE_NONE, w, h, 0), 1/*do_interlace*/); + PNG_INTERLACE_NONE, w, h, 0), 1/*do_interlace*/, + pm->use_update_info); if (fail(pm)) return 0; standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/, - PNG_INTERLACE_ADAM7, w, h, 0), 1/*do_interlace*/); + PNG_INTERLACE_ADAM7, w, h, 0), 1/*do_interlace*/, + pm->use_update_info); if (fail(pm)) return 0; @@ -5143,10 +5277,11 @@ static void transform_display_init(transform_display *dp, png_modifier *pm, png_uint_32 id, PNG_CONST image_transform *transform_list) { - memset(dp, 0, sizeof dp); + memset(dp, 0, sizeof *dp); /* Standard fields */ - standard_display_init(&dp->this, &pm->this, id, 0/*do_interlace*/); + standard_display_init(&dp->this, &pm->this, id, 0/*do_interlace*/, + pm->use_update_info); /* Parameter fields */ dp->pm = pm; @@ -5167,7 +5302,13 @@ transform_info_imp(transform_display *dp, png_structp pp, png_infop pi) dp->transform_list->set(dp->transform_list, dp, pp, pi); /* Update the info structure for these transforms: */ - png_read_update_info(pp, pi); + { + int i = dp->this.use_update_info; + /* Always do one call, even if use_update_info is 0. */ + do + png_read_update_info(pp, pi); + while (--i > 0); + } /* And get the output information into the standard_display */ standard_info_part2(&dp->this, pp, pi, 1/*images*/); @@ -5222,8 +5363,12 @@ transform_info_imp(transform_display *dp, png_structp pp, png_infop pi) test_pixel.sample_depth = 8; else test_pixel.sample_depth = test_pixel.bit_depth; - /* Don't need sBIT here */ + /* Don't need sBIT here, but it must be set to non-zero to avoid + * arithmetic overflows. + */ test_pixel.have_tRNS = dp->this.is_transparent; + test_pixel.red_sBIT = test_pixel.green_sBIT = test_pixel.blue_sBIT = + test_pixel.alpha_sBIT = test_pixel.sample_depth; dp->transform_list->mod(dp->transform_list, &test_pixel, pp, dp); @@ -5488,7 +5633,10 @@ transform_end(png_structp pp, png_infop pi) transform_display *dp = voidcast(transform_display*, png_get_progressive_ptr(pp)); - transform_image_validate(dp, pp, pi); + if (!dp->this.speed) + transform_image_validate(dp, pp, pi); + else + dp->this.ps->validated = 1; } /* A single test run. */ @@ -5561,6 +5709,8 @@ transform_test(png_modifier *pmIn, PNG_CONST png_uint_32 idIn, if (!d.this.speed) transform_image_validate(&d, pp, pi); + else + d.this.ps->validated = 1; } modifier_reset(d.pm); @@ -6994,7 +7144,8 @@ gamma_display_init(gamma_display *dp, png_modifier *pm, png_uint_32 id, double background_gamma) { /* Standard fields */ - standard_display_init(&dp->this, &pm->this, id, 0/*do_interlace*/); + standard_display_init(&dp->this, &pm->this, id, 0/*do_interlace*/, + pm->use_update_info); /* Parameter fields */ dp->pm = pm; @@ -7123,7 +7274,13 @@ gamma_info_imp(gamma_display *dp, png_structp pp, png_infop pi) } } - png_read_update_info(pp, pi); + { + int i = dp->this.use_update_info; + /* Always do one call, even if use_update_info is 0. */ + do + png_read_update_info(pp, pi); + while (--i > 0); + } /* Now we may get a different cbRow: */ standard_info_part2(&dp->this, pp, pi, 1 /*images*/); @@ -7730,7 +7887,7 @@ gamma_component_validate(PNG_CONST char *name, PNG_CONST validate_info *vi, case ALPHA_MODE_OFFSET + PNG_ALPHA_BROKEN: case ALPHA_MODE_OFFSET + PNG_ALPHA_OPTIMIZED: # endif /* ALPHA_MODE_SUPPORTED */ - do_compose = (alpha >= 0 && alpha < 1); + do_compose = (alpha > 0 && alpha < 1); use_input = (alpha != 0); break; @@ -8080,6 +8237,8 @@ gamma_end(png_structp pp, png_infop pi) if (!dp->this.speed) gamma_image_validate(dp, pp, pi); + else + dp->this.ps->validated = 1; } /* A single test run checking a gamma transformation. @@ -8161,6 +8320,8 @@ gamma_test(png_modifier *pmIn, PNG_CONST png_byte colour_typeIn, if (!d.this.speed) gamma_image_validate(&d, pp, pi); + else + d.this.ps->validated = 1; } modifier_reset(d.pm); @@ -9140,6 +9301,72 @@ static PNG_CONST color_encoding test_encodings[] = /*blue: */ { 0.146774385252705, 0.016589442011321, 0.773892783545073} }, }; +/* signal handler + * + * This attempts to trap signals and escape without crashing. It needs a + * context pointer so that it can throw an exception (call longjmp) to recover + * from the condition; this is handled by making the png_modifier used by 'main' + * into a global variable. + */ +static png_modifier pm; + +static void signal_handler(int signum) +{ + + size_t pos = 0; + char msg[64]; + + pos = safecat(msg, sizeof msg, pos, "caught signal: "); + + switch (signum) + { + case SIGABRT: + pos = safecat(msg, sizeof msg, pos, "abort"); + break; + + case SIGFPE: + pos = safecat(msg, sizeof msg, pos, "floating point exception"); + break; + + case SIGILL: + pos = safecat(msg, sizeof msg, pos, "illegal instruction"); + break; + + case SIGINT: + pos = safecat(msg, sizeof msg, pos, "interrupt"); + break; + + case SIGSEGV: + pos = safecat(msg, sizeof msg, pos, "invalid memory access"); + break; + + case SIGTERM: + pos = safecat(msg, sizeof msg, pos, "termination request"); + break; + + default: + pos = safecat(msg, sizeof msg, pos, "unknown "); + pos = safecatn(msg, sizeof msg, pos, signum); + break; + } + + store_log(&pm.this, NULL/*png_structp*/, msg, 1/*error*/); + + /* And finally throw an exception so we can keep going, unless this is + * SIGTERM in which case stop now. + */ + if (signum != SIGTERM) + { + struct exception_context *the_exception_context = + &pm.this.exception_context; + + Throw &pm.this; + } + + else + exit(1); +} + /* main program */ int main(int argc, PNG_CONST char **argv) { @@ -9161,8 +9388,23 @@ int main(int argc, PNG_CONST char **argv) size_t cp = 0; char command[1024]; - png_modifier pm; - context(&pm.this, fault); + anon_context(&pm.this); + + /* Add appropriate signal handlers, just the ANSI specified ones: */ + signal(SIGABRT, signal_handler); + signal(SIGFPE, signal_handler); + signal(SIGILL, signal_handler); + signal(SIGINT, signal_handler); + signal(SIGSEGV, signal_handler); + signal(SIGTERM, signal_handler); + +#ifdef HAVE_FEENABLEEXCEPT + /* Only required to enable FP exceptions on platforms where they start off + * disabled; this is not necessary but if it is not done pngvalid will likely + * end up ignoring FP conditions that other platforms fault. + */ + feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); +#endif modifier_init(&pm); @@ -9350,6 +9592,9 @@ int main(int argc, PNG_CONST char **argv) else if (strcmp(*argv, "--progressive-read") == 0) pm.this.progressive = 1; + else if (strcmp(*argv, "--use-update-info") == 0) + ++pm.use_update_info; /* Can call multiple times */ + else if (strcmp(*argv, "--interlace") == 0) pm.interlace_type = PNG_INTERLACE_ADAM7; @@ -9505,7 +9750,7 @@ int main(int argc, PNG_CONST char **argv) #endif } - Catch(fault) + Catch_anonymous { fprintf(stderr, "pngvalid: test aborted (probably failed in cleanup)\n"); if (!pm.this.verbose) diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/README b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/README index 51d5a3c2305..51d5a3c2305 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/README +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/README diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/README b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/decoder/README index fa979fcb727..fa979fcb727 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/README +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/decoder/README diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/makefile b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/decoder/makefile index e10e1225d65..e10e1225d65 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/makefile +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/decoder/makefile diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/pngusr.dfa b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/decoder/pngusr.dfa index 70d528bc9f9..70d528bc9f9 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/pngusr.dfa +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/decoder/pngusr.dfa diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/pngusr.h b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/decoder/pngusr.h index ce855375289..9d9c50c4078 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/pngusr.h +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/decoder/pngusr.h @@ -19,5 +19,6 @@ */ #define PNG_NO_WARNINGS +#define PNG_ALIGN_TYPE PNG_ALIGN_NONE #endif /* MINRDPNGCONF_H */ diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/README b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/encoder/README index ff9aa4597a9..ff9aa4597a9 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/README +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/encoder/README diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/makefile b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/encoder/makefile index d6f39e2ea06..d6f39e2ea06 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/makefile +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/encoder/makefile diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/pngusr.dfa b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/encoder/pngusr.dfa index ee88443c9dd..ee88443c9dd 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/pngusr.dfa +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/encoder/pngusr.dfa diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/pngusr.h b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/encoder/pngusr.h index fb35245ee5d..2033aadb200 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/pngusr.h +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/encoder/pngusr.h @@ -19,5 +19,6 @@ */ #define PNG_NO_WARNINGS +#define PNG_ALIGN_TYPE PNG_ALIGN_NONE #endif /* MINWRPNGCONF_H */ diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/README b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/preader/README index faa83560a72..faa83560a72 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/README +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/preader/README diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/makefile b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/preader/makefile index f4b0ccdc8a9..f4b0ccdc8a9 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/makefile +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/preader/makefile diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/pngusr.dfa b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/preader/pngusr.dfa index 216c421ca66..216c421ca66 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/pngusr.dfa +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/preader/pngusr.dfa diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/pngusr.h b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/preader/pngusr.h index b40cc46ce69..73cfecfbf06 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/pngusr.h +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminim/preader/pngusr.h @@ -19,5 +19,6 @@ */ #define PNG_NO_WARNINGS +#define PNG_ALIGN_TYPE PNG_ALIGN_NONE #endif /* MINPRDPNGCONF_H */ diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/README b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/README index bbe7407ecce..bbe7407ecce 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/README +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/README diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makefile.std b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/makefile.std index fa7b5909fcc..fa7b5909fcc 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makefile.std +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/makefile.std diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makefile.tc3 b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/makefile.tc3 index 404f18d5b15..404f18d5b15 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makefile.tc3 +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/makefile.tc3 diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makevms.com b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/makevms.com index 00561bcd0d7..00561bcd0d7 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makevms.com +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/makevms.com diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.bat b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/png2pnm.bat index 449cf36750b..449cf36750b 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.bat +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/png2pnm.bat diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/png2pnm.c index 2281429435d..2281429435d 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/png2pnm.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.sh b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/png2pnm.sh index b1c05370dff..b1c05370dff 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.sh +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/png2pnm.sh diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pngminus.bat b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pngminus.bat index 911bb8dff9e..911bb8dff9e 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pngminus.bat +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pngminus.bat diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pngminus.sh b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pngminus.sh index 2a0a9d8fbba..2a0a9d8fbba 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pngminus.sh +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pngminus.sh diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.bat b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pnm2png.bat index f756cb84de4..f756cb84de4 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.bat +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pnm2png.bat diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pnm2png.c index 4cdfad83132..4cdfad83132 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pnm2png.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.sh b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pnm2png.sh index d79df2fae08..d79df2fae08 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.sh +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngminus/pnm2png.sh diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/README b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/README index b2b1537db8e..b2b1537db8e 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/README +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/README diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g01.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g01.png Binary files differindex e31e1c7a635..e31e1c7a635 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g01.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g01.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g02.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g02.png Binary files differindex 68809dd8fc0..68809dd8fc0 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g02.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g02.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g04.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g04.png Binary files differindex 6fa089cb8a4..6fa089cb8a4 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g04.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g04.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g08.png Binary files differindex bf522eef001..bf522eef001 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g16.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g16.png Binary files differindex 318ebcadf4f..318ebcadf4f 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g16.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn0g16.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn2c08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn2c08.png Binary files differindex 21d2f91a868..21d2f91a868 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn2c08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn2c08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn2c16.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn2c16.png Binary files differindex 1bd4a4d0e2c..1bd4a4d0e2c 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn2c16.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn2c16.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p01.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn3p01.png Binary files differindex a21db597746..a21db597746 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p01.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn3p01.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p02.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn3p02.png Binary files differindex 1d0ab6197cc..1d0ab6197cc 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p02.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn3p02.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p04.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn3p04.png Binary files differindex 6dc6eac83f3..6dc6eac83f3 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p04.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn3p04.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn3p08.png Binary files differindex 0e07f483c0e..0e07f483c0e 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn4a08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn4a08.png Binary files differindex 3bb0dd06b51..3bb0dd06b51 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn4a08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn4a08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn4a16.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn4a16.png Binary files differindex 6dbee9fbdb9..6dbee9fbdb9 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn4a16.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn4a16.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn6a08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn6a08.png Binary files differindex 61062308548..61062308548 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn6a08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn6a08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn6a16.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn6a16.png Binary files differindex a9bf3cb4612..a9bf3cb4612 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn6a16.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/basn6a16.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn1g04.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbbn1g04.png Binary files differindex 39a7050d27a..39a7050d27a 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn1g04.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbbn1g04.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn2c16.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbbn2c16.png Binary files differindex dd3168e5c86..dd3168e5c86 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn2c16.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbbn2c16.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn3p08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbbn3p08.png Binary files differindex 0ede3574db0..0ede3574db0 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbbn3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbgn2c16.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbgn2c16.png Binary files differindex 85cec395c01..85cec395c01 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbgn2c16.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbgn2c16.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbgn3p08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbgn3p08.png Binary files differindex 8cf2e6fb6aa..8cf2e6fb6aa 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbgn3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbgn3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbrn2c08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbrn2c08.png Binary files differindex 5cca0d62104..5cca0d62104 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbrn2c08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbrn2c08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbwn1g16.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbwn1g16.png Binary files differindex 99bdeed2b3b..99bdeed2b3b 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbwn1g16.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbwn1g16.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbwn3p08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbwn3p08.png Binary files differindex eacab7a144c..eacab7a144c 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbwn3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbwn3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbyn3p08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbyn3p08.png Binary files differindex 656db0989ad..656db0989ad 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbyn3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftbyn3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n1g08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftp0n1g08.png Binary files differindex 333465fcdc9..333465fcdc9 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n1g08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftp0n1g08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n2c08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftp0n2c08.png Binary files differindex fc6e42cb420..fc6e42cb420 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n2c08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftp0n2c08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n3p08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftp0n3p08.png Binary files differindex 69a69e58722..69a69e58722 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftp0n3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp1n3p08.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftp1n3p08.png Binary files differindex a6c9f35a862..a6c9f35a862 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp1n3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/pngsuite/ftp1n3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/PngFile.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/PngFile.c index ef0984e4dfc..ef0984e4dfc 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/PngFile.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/PngFile.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/PngFile.h b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/PngFile.h index 32181a4eacc..32181a4eacc 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/PngFile.h +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/PngFile.h diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/README.txt b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/README.txt index 72c5cba1790..72c5cba1790 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/README.txt +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/README.txt diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.c b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.c index 009f120e356..009f120e356 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.c +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.dsp b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.dsp index 741ef6ce76f..741ef6ce76f 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.dsp +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.dsp diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.dsw b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.dsw index a30e1cc1cdb..a30e1cc1cdb 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.dsw +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.dsw diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.ico b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.ico Binary files differindex 68aa3719fb5..68aa3719fb5 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.ico +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.ico diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.png b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.png Binary files differindex c6aa80a9bfa..c6aa80a9bfa 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.png +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.rc b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.rc index 6e0623a73cf..6e0623a73cf 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.rc +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/VisualPng.rc diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/cexcept.h b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/cexcept.h index 5f45d769758..5f45d769758 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/cexcept.h +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/cexcept.h diff --git a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/resource.h b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/resource.h index b62176d1dca..b62176d1dca 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/resource.h +++ b/Build/source/libs/libpng/libpng-1.5.7/contrib/visupng/resource.h diff --git a/Build/source/libs/libpng/libpng-1.5.5/example.c b/Build/source/libs/libpng/libpng-1.5.7/example.c index c0d27f48735..ec53a8cdee3 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/example.c +++ b/Build/source/libs/libpng/libpng-1.5.7/example.c @@ -2,11 +2,10 @@ #if 0 /* in case someone actually tries to compile this */ /* example.c - an example of using libpng - * Last changed in libpng 1.5.4 [July 7, 2011] - * This file has been placed in the public domain by the authors. + * Last changed in libpng 1.5.7 [December 15, 2011] * Maintained 1998-2011 Glenn Randers-Pehrson - * Maintained 1996, 1997 Andreas Dilger) - * Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * 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. @@ -14,6 +13,8 @@ * read it, do so first. This was designed to be a starting point of an * implementation. This is not officially part of libpng, is hereby placed * in the public domain, and therefore does not require a copyright notice. + * To the extent possible under law, the authors have waived all copyright and + * related or neighboring rights to this file. * * This file does not currently compile, because it is missing certain * parts, like allocating memory to hold an image. You will have to @@ -341,11 +342,16 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */ /* Add filler (or alpha) byte (before/after each RGB triplet) */ png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); +#ifdef PNG_READ_INTERLACING_SUPPORTED /* Turn on interlace handling. REQUIRED if you are not using * png_read_image(). To see how to handle interlacing passes, * see the png_read_row() method below: */ number_passes = png_set_interlace_handling(png_ptr); +#else + number_passes = 1; +#endif /* PNG_READ_INTERLACING_SUPPORTED */ + /* Optional call to gamma correct and add the background to the palette * and update info structure. REQUIRED if you are expecting libpng to @@ -527,6 +533,7 @@ row_callback(png_structp png_ptr, png_bytep new_row, */ png_bytep old_row = ((png_bytep *)our_data)[row_num]; +#ifdef PNG_READ_INTERLACING_SUPPORTED /* If both rows are allocated then copy the new row * data to the corresponding row data. */ @@ -555,6 +562,7 @@ row_callback(png_structp png_ptr, png_bytep new_row, * to pass the current row as new_row, and the function will combine * the old row and the new row. */ +#endif /* PNG_READ_INTERLACING_SUPPORTED */ } end_callback(png_structp png_ptr, png_infop info) diff --git a/Build/source/libs/libpng/libpng-1.5.5/libpng-config.in b/Build/source/libs/libpng/libpng-1.5.7/libpng-config.in index 69bf8e33f0b..69bf8e33f0b 100755 --- a/Build/source/libs/libpng/libpng-1.5.5/libpng-config.in +++ b/Build/source/libs/libpng/libpng-1.5.7/libpng-config.in diff --git a/Build/source/libs/libpng/libpng-1.5.5/libpng-manual.txt b/Build/source/libs/libpng/libpng-1.5.7/libpng-manual.txt index eb6bacb86ad..59690d25514 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/libpng-manual.txt +++ b/Build/source/libs/libpng/libpng-1.5.7/libpng-manual.txt @@ -1,6 +1,6 @@ libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.5.5 - September 22, 2011 + libpng version 1.5.7 - December 15, 2011 Updated and distributed by Glenn Randers-Pehrson <glennrp at users.sourceforge.net> Copyright (c) 1998-2011 Glenn Randers-Pehrson @@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.5.5 - September 22, 2011 + libpng versions 0.97, January 1998, through 1.5.7 - December 15, 2011 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2011 Glenn Randers-Pehrson @@ -1265,10 +1265,13 @@ pointer into the info_ptr is returned for any complex types. (empty string for unknown). Note that the itxt_length, lang, and lang_key - members of the text_ptr structure only exist - when the library is built with iTXt chunk support. - Prior to libpng-1.4.0, the default build was - without iTXt chunk support. + members of the text_ptr structure only exist when the + library is built with iTXt chunk support. Prior to + libpng-1.4.0 the library was built by default without + iTXt support. Also note that when iTXt is supported, + they contain NULL pointers when the "compression" + field contains PNG_TEXT_COMPRESSION_NONE or + PNG_TEXT_COMPRESSION_zTXt. num_text - number of comments (same as num_comments; you can put NULL here @@ -1899,13 +1902,16 @@ of the interlaced image. After setting the transformations, libpng can update your png_info structure to reflect any transformations you've requested with this -call. This is most useful to update the info structure's rowbytes -field so you can use it to allocate your image memory. This function -will also update your palette with the correct screen_gamma and -background if these have been given with the calls above. +call. png_read_update_info(png_ptr, info_ptr); +This is most useful to update the info structure's rowbytes +field so you can use it to allocate your image memory. This function +will also update your palette with the correct screen_gamma and +background if these have been given with the calls above. You may +only call png_read_update_info() once with a particular info_ptr. + After you call png_read_update_info(), you can allocate any memory you need to hold the image. The row data is simply raw byte data for all forms of images. As the actual allocation @@ -1914,7 +1920,7 @@ are allocating one large chunk, you will need to build an array of pointers to each row, as it will be needed for some of the functions below. -Remember: Before you call png_read_update_info(), the png_get_ +Remember: Before you call png_read_update_info(), the png_get_*() functions return the values corresponding to the original PNG image. After you call png_read_update_info the values refer to the image that libpng will output. Consequently you must call all the png_set_ @@ -2846,11 +2852,15 @@ width, height, bit_depth, and color_type must be the same in each call. empty for unknown). text_ptr[i].translated_keyword - keyword in UTF-8 (NULL or empty for unknown). + Note that the itxt_length, lang, and lang_key - members of the text_ptr structure only exist - when the library is built with iTXt chunk support. - Prior to libpng-1.4.0 the library was built by default - without iTXt support. + members of the text_ptr structure only exist when the + library is built with iTXt chunk support. Prior to + libpng-1.4.0 the library was built by default without + iTXt support. Also note that when iTXt is supported, + they contain NULL pointers when the "compression" + field contains PNG_TEXT_COMPRESSION_NONE or + PNG_TEXT_COMPRESSION_zTXt. num_text - number of comments @@ -4552,6 +4562,9 @@ left parenthesis that follows it: We prefer #ifdef and #ifndef to #if defined() and if !defined() when there is only one macro being tested. +We prefer to express integers that are used as bit masks in hex format, +with an even number of lower-case hex digits (e.g., 0x00, 0xff, 0x0100). + We do not use the TAB character for indentation in the C sources. Lines do not exceed 80 characters. @@ -4560,13 +4573,13 @@ Other rules can be inferred by inspecting the libpng source. XIV. Y2K Compliance in libpng -September 22, 2011 +December 15, 2011 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.5.5 are Y2K compliant. It is my belief that earlier +upward through 1.5.7 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/libpng-1.5.5/libpng.3 b/Build/source/libs/libpng/libpng-1.5.7/libpng.3 index 571be914826..0d227628b4f 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/libpng.3 +++ b/Build/source/libs/libpng/libpng-1.5.7/libpng.3 @@ -1,6 +1,6 @@ -.TH LIBPNG 3 "September 22, 2011" +.TH LIBPNG 3 "December 15, 2011" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.5.5 +libpng \- Portable Network Graphics (PNG) Reference Library 1.5.7 .SH SYNOPSIS \fI\fB @@ -977,7 +977,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng. .SH LIBPNG.TXT libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.5.5 - September 22, 2011 + libpng version 1.5.7 - December 15, 2011 Updated and distributed by Glenn Randers-Pehrson <glennrp at users.sourceforge.net> Copyright (c) 1998-2011 Glenn Randers-Pehrson @@ -988,7 +988,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.5.5 - September 22, 2011 + libpng versions 0.97, January 1998, through 1.5.7 - December 15, 2011 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2011 Glenn Randers-Pehrson @@ -2242,10 +2242,13 @@ pointer into the info_ptr is returned for any complex types. (empty string for unknown). Note that the itxt_length, lang, and lang_key - members of the text_ptr structure only exist - when the library is built with iTXt chunk support. - Prior to libpng-1.4.0, the default build was - without iTXt chunk support. + members of the text_ptr structure only exist when the + library is built with iTXt chunk support. Prior to + libpng-1.4.0 the library was built by default without + iTXt support. Also note that when iTXt is supported, + they contain NULL pointers when the "compression" + field contains PNG_TEXT_COMPRESSION_NONE or + PNG_TEXT_COMPRESSION_zTXt. num_text - number of comments (same as num_comments; you can put NULL here @@ -2876,13 +2879,16 @@ of the interlaced image. After setting the transformations, libpng can update your png_info structure to reflect any transformations you've requested with this -call. This is most useful to update the info structure's rowbytes -field so you can use it to allocate your image memory. This function -will also update your palette with the correct screen_gamma and -background if these have been given with the calls above. +call. png_read_update_info(png_ptr, info_ptr); +This is most useful to update the info structure's rowbytes +field so you can use it to allocate your image memory. This function +will also update your palette with the correct screen_gamma and +background if these have been given with the calls above. You may +only call png_read_update_info() once with a particular info_ptr. + After you call png_read_update_info(), you can allocate any memory you need to hold the image. The row data is simply raw byte data for all forms of images. As the actual allocation @@ -2891,7 +2897,7 @@ are allocating one large chunk, you will need to build an array of pointers to each row, as it will be needed for some of the functions below. -Remember: Before you call png_read_update_info(), the png_get_ +Remember: Before you call png_read_update_info(), the png_get_*() functions return the values corresponding to the original PNG image. After you call png_read_update_info the values refer to the image that libpng will output. Consequently you must call all the png_set_ @@ -3823,11 +3829,15 @@ width, height, bit_depth, and color_type must be the same in each call. empty for unknown). text_ptr[i].translated_keyword - keyword in UTF-8 (NULL or empty for unknown). + Note that the itxt_length, lang, and lang_key - members of the text_ptr structure only exist - when the library is built with iTXt chunk support. - Prior to libpng-1.4.0 the library was built by default - without iTXt support. + members of the text_ptr structure only exist when the + library is built with iTXt chunk support. Prior to + libpng-1.4.0 the library was built by default without + iTXt support. Also note that when iTXt is supported, + they contain NULL pointers when the "compression" + field contains PNG_TEXT_COMPRESSION_NONE or + PNG_TEXT_COMPRESSION_zTXt. num_text - number of comments @@ -5530,6 +5540,9 @@ left parenthesis that follows it: We prefer #ifdef and #ifndef to #if defined() and if !defined() when there is only one macro being tested. +We prefer to express integers that are used as bit masks in hex format, +with an even number of lower-case hex digits (e.g., 0x00, 0xff, 0x0100). + We do not use the TAB character for indentation in the C sources. Lines do not exceed 80 characters. @@ -5538,13 +5551,13 @@ Other rules can be inferred by inspecting the libpng source. .SH XIV. Y2K Compliance in libpng -September 22, 2011 +December 15, 2011 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.5.5 are Y2K compliant. It is my belief that earlier +upward through 1.5.7 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 @@ -5743,6 +5756,12 @@ the first widely used release: 1.5.5beta01-08 15 10505 15.so.15.5[.0] 1.5.5rc01 15 10505 15.so.15.5[.0] 1.5.5 15 10505 15.so.15.5[.0] + 1.5.6beta01-07 15 10506 15.so.15.6[.0] + 1.5.6rc01-03 15 10506 15.so.15.6[.0] + 1.5.6 15 10506 15.so.15.6[.0] + 1.5.7beta01-05 15 10507 15.so.15.7[.0] + 1.5.7rc01-03 15 10507 15.so.15.7[.0] + 1.5.7 15 10507 15.so.15.7[.0] Henceforth the source version will match the shared-library minor and patch numbers; the shared-library major version number will be @@ -5799,7 +5818,7 @@ possible without all of you. Thanks to Frank J. T. Wojcik for helping with the documentation. -Libpng version 1.5.5 - September 22, 2011: +Libpng version 1.5.7 - December 15, 2011: Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). @@ -5822,7 +5841,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.5.5, September 22, 2011, are +libpng versions 1.2.6, August 15, 2004, through 1.5.7, December 15, 2011, are Copyright (c) 2004,2006-2007 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 @@ -5921,7 +5940,7 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -September 22, 2011 +December 15, 2011 .\" end of man page diff --git a/Build/source/libs/libpng/libpng-1.5.5/libpng.pc.in b/Build/source/libs/libpng/libpng-1.5.7/libpng.pc.in index 3e7e2c58a7e..3e7e2c58a7e 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/libpng.pc.in +++ b/Build/source/libs/libpng/libpng-1.5.7/libpng.pc.in diff --git a/Build/source/libs/libpng/libpng-1.5.5/libpngpf.3 b/Build/source/libs/libpng/libpng-1.5.7/libpngpf.3 index b1bce64912c..12a1677baf5 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/libpngpf.3 +++ b/Build/source/libs/libpng/libpng-1.5.7/libpngpf.3 @@ -1,6 +1,6 @@ -.TH LIBPNGPF 3 "September 22, 2011" +.TH LIBPNGPF 3 "December 15, 2011" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.5.5 +libpng \- Portable Network Graphics (PNG) Reference Library 1.5.7 (private functions) .SH SYNOPSIS \fB#include \fI"pngpriv.h" diff --git a/Build/source/libs/libpng/libpng-1.5.5/png.5 b/Build/source/libs/libpng/libpng-1.5.7/png.5 index 6f5089793bc..7d1c12b1cb5 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/png.5 +++ b/Build/source/libs/libpng/libpng-1.5.7/png.5 @@ -1,4 +1,4 @@ -.TH PNG 5 "September 22, 2011" +.TH PNG 5 "December 15, 2011" .SH NAME png \- Portable Network Graphics (PNG) format .SH DESCRIPTION diff --git a/Build/source/libs/libpng/libpng-1.5.5/png.c b/Build/source/libs/libpng/libpng-1.5.7/png.c index c521ad261be..08074485b86 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/png.c +++ b/Build/source/libs/libpng/libpng-1.5.7/png.c @@ -1,7 +1,7 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.5.5 [September 22, 2011] + * Last changed in libpng 1.5.7 [December 15, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -14,7 +14,7 @@ #include "pngpriv.h" /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_5_5 Your_png_h_is_not_version_1_5_5; +typedef png_libpng_version_1_5_7 Your_png_h_is_not_version_1_5_7; /* Tells libpng that we have already handled the first "num_bytes" bytes * of the PNG file signature. If the PNG data is embedded into another @@ -121,14 +121,14 @@ png_calculate_crc(png_structp png_ptr, png_const_bytep ptr, png_size_t length) { int need_crc = 1; - if (png_ptr->chunk_name[0] & 0x20) /* ancillary */ + if (PNG_CHUNK_ANCILLIARY(png_ptr->chunk_name)) { if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) == (PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN)) need_crc = 0; } - else /* critical */ + else /* critical */ { if (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) need_crc = 0; @@ -599,9 +599,19 @@ png_convert_to_rfc1123(png_structp png_ptr, png_const_timep ptime) if (png_ptr == NULL) return (NULL); + if (ptime->year > 9999 /* RFC1123 limitation */ || + ptime->month == 0 || ptime->month > 12 || + ptime->day == 0 || ptime->day > 31 || + ptime->hour > 23 || ptime->minute > 59 || + ptime->second > 60) + { + png_warning(png_ptr, "Ignoring invalid time value"); + return (NULL); + } + { size_t pos = 0; - char number_buf[5]; /* enough for a four digit year */ + char number_buf[5]; /* enough for a four-digit year */ # define APPEND_STRING(string)\ pos = png_safecat(png_ptr->time_buffer, sizeof png_ptr->time_buffer,\ @@ -612,17 +622,17 @@ png_convert_to_rfc1123(png_structp png_ptr, png_const_timep ptime) if (pos < (sizeof png_ptr->time_buffer)-1)\ png_ptr->time_buffer[pos++] = (ch) - APPEND_NUMBER(PNG_NUMBER_FORMAT_u, (unsigned)ptime->day % 32); + APPEND_NUMBER(PNG_NUMBER_FORMAT_u, (unsigned)ptime->day); APPEND(' '); - APPEND_STRING(short_months[(ptime->month - 1) % 12]); + APPEND_STRING(short_months[(ptime->month - 1)]); APPEND(' '); APPEND_NUMBER(PNG_NUMBER_FORMAT_u, ptime->year); APPEND(' '); - APPEND_NUMBER(PNG_NUMBER_FORMAT_02u, (unsigned)ptime->hour % 24); + APPEND_NUMBER(PNG_NUMBER_FORMAT_02u, (unsigned)ptime->hour); APPEND(':'); - APPEND_NUMBER(PNG_NUMBER_FORMAT_02u, (unsigned)ptime->minute % 60); + APPEND_NUMBER(PNG_NUMBER_FORMAT_02u, (unsigned)ptime->minute); APPEND(':'); - APPEND_NUMBER(PNG_NUMBER_FORMAT_02u, (unsigned)ptime->second % 61); + APPEND_NUMBER(PNG_NUMBER_FORMAT_02u, (unsigned)ptime->second); APPEND_STRING(" +0000"); /* This reliably terminates the buffer */ # undef APPEND @@ -645,13 +655,13 @@ png_get_copyright(png_const_structp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.5.5 - September 22, 2011" PNG_STRING_NEWLINE \ + "libpng version 1.5.7 - December 15, 2011" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2011 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ PNG_STRING_NEWLINE; # else - return "libpng version 1.5.5 - September 22, 2011\ + return "libpng version 1.5.7 - December 15, 2011\ Copyright (c) 1998-2011 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; @@ -698,25 +708,43 @@ png_get_header_version(png_const_structp png_ptr) #endif } -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) -# ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED int PNGAPI png_handle_as_unknown(png_structp png_ptr, png_const_bytep chunk_name) { /* Check chunk_name and return "keep" value if it's on the list, else 0 */ - int i; - png_bytep p; - if (png_ptr == NULL || chunk_name == NULL || png_ptr->num_chunk_list<=0) - return 0; + png_const_bytep p, p_end; - p = png_ptr->chunk_list + png_ptr->num_chunk_list*5 - 5; - for (i = png_ptr->num_chunk_list; i; i--, p -= 5) + if (png_ptr == NULL || chunk_name == NULL || png_ptr->num_chunk_list <= 0) + return PNG_HANDLE_CHUNK_AS_DEFAULT; + + p_end = png_ptr->chunk_list; + p = p_end + png_ptr->num_chunk_list*5; /* beyond end */ + + /* The code is the fifth byte after each four byte string. Historically this + * code was always searched from the end of the list, so it should continue + * to do so in case there are duplicated entries. + */ + do /* num_chunk_list > 0, so at least one */ + { + p -= 5; if (!png_memcmp(chunk_name, p, 4)) - return ((int)*(p + 4)); - return 0; + return p[4]; + } + while (p > p_end); + + return PNG_HANDLE_CHUNK_AS_DEFAULT; } -# endif -#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ + +int /* PRIVATE */ +png_chunk_unknown_handling(png_structp png_ptr, png_uint_32 chunk_name) +{ + png_byte chunk_string[5]; + + PNG_CSTRING_FROM_CHUNK(chunk_string, chunk_name); + return png_handle_as_unknown(png_ptr, chunk_string); +} +#endif #ifdef PNG_READ_SUPPORTED /* This function, added to libpng-1.0.6g, is untested. */ @@ -2146,9 +2174,9 @@ png_64bit_product (long v1, long v2, unsigned long *hi_product, static png_uint_32 png_8bit_l2[128] = { -# if PNG_DO_BC +# ifdef PNG_DO_BC for (i=128;i<256;++i) { .5 - l(i/255)/l(2)*65536*65536; } -# endif +# else 4270715492U, 4222494797U, 4174646467U, 4127164793U, 4080044201U, 4033279239U, 3986864580U, 3940795015U, 3895065449U, 3849670902U, 3804606499U, 3759867474U, 3715449162U, 3671346997U, 3627556511U, 3584073329U, 3540893168U, 3498011834U, @@ -2171,6 +2199,8 @@ png_8bit_l2[128] = 324227938U, 298676034U, 273229066U, 247886176U, 222646516U, 197509248U, 172473545U, 147538590U, 122703574U, 97967701U, 73330182U, 48790236U, 24347096U, 0U +# endif + #if 0 /* The following are the values for 16-bit tables - these work fine for the * 8-bit conversions but produce very slightly larger errors in the 16-bit @@ -2305,7 +2335,7 @@ png_log16bit(png_uint_32 x) * integer bits (the top 4) simply determine a shift. * * The worst case is the 16-bit distinction between 65535 and 65534, this - * requires perhaps spurious accuracty in the decoding of the logarithm to + * requires perhaps spurious accuracy in the decoding of the logarithm to * distinguish log2(65535/65534.5) - 10^-5 or 17 bits. There is little chance * of getting this accuracy in practice. * @@ -2316,17 +2346,18 @@ png_log16bit(png_uint_32 x) static png_uint_32 png_32bit_exp[16] = { -# if PNG_DO_BC +# ifdef PNG_DO_BC for (i=0;i<16;++i) { .5 + e(-i/16*l(2))*2^32; } -# endif +# else /* NOTE: the first entry is deliberately set to the maximum 32-bit value. */ 4294967295U, 4112874773U, 3938502376U, 3771522796U, 3611622603U, 3458501653U, 3311872529U, 3171459999U, 3037000500U, 2908241642U, 2784941738U, 2666869345U, 2553802834U, 2445529972U, 2341847524U, 2242560872U +# endif }; /* Adjustment table; provided to explain the numbers in the code below. */ -#if PNG_DO_BC +#ifdef PNG_DO_BC for (i=11;i>=0;--i){ print i, " ", (1 - e(-(2^i)/65536*l(2))) * 2^(32-i), "\n"} 11 44937.64284865548751208448 10 45180.98734845585101160448 @@ -2489,7 +2520,7 @@ png_gamma_significant(png_fixed_point gamma_val) } /* Internal function to build a single 16-bit table - the table consists of - * 'num' 256 entry subtables, where 'num' is determined by 'shift' - the amount + * 'num' 256-entry subtables, where 'num' is determined by 'shift' - the amount * to shift the input values right (or 16-number_of_signifiant_bits). * * The caller is responsible for ensuring that the table gets cleaned up on @@ -2576,9 +2607,9 @@ png_build_16to8_table(png_structp png_ptr, png_uint_16pp *ptable, png_uint_16pp table = *ptable = (png_uint_16pp)png_calloc(png_ptr, num * png_sizeof(png_uint_16p)); - /* 'num' is the number of tables and also the number of low bits of low - * bits of the input 16-bit value used to select a table. Each table is - * itself index by the high 8 bits of the value. + /* 'num' is the number of tables and also the number of low bits of the + * input 16-bit value used to select a table. Each table is itself indexed + * by the high 8 bits of the value. */ for (i = 0; i < num; i++) table[i] = (png_uint_16p)png_malloc(png_ptr, @@ -2629,7 +2660,7 @@ png_build_16to8_table(png_structp png_ptr, png_uint_16pp *ptable, /* Build a single 8-bit table: same as the 16-bit case but much simpler (and * typically much faster). Note that libpng currently does no sBIT processing - * (apparently contrary to the spec) so a 256 entry table is always generated. + * (apparently contrary to the spec) so a 256-entry table is always generated. */ static void png_build_8bit_table(png_structp png_ptr, png_bytepp ptable, @@ -2645,6 +2676,60 @@ png_build_8bit_table(png_structp png_ptr, png_bytepp ptable, table[i] = (png_byte)i; } +/* Used from png_read_destroy and below to release the memory used by the gamma + * tables. + */ +void /* PRIVATE */ +png_destroy_gamma_table(png_structp png_ptr) +{ + png_free(png_ptr, png_ptr->gamma_table); + png_ptr->gamma_table = NULL; + + if (png_ptr->gamma_16_table != NULL) + { + int i; + int istop = (1 << (8 - png_ptr->gamma_shift)); + for (i = 0; i < istop; i++) + { + png_free(png_ptr, png_ptr->gamma_16_table[i]); + } + png_free(png_ptr, png_ptr->gamma_16_table); + png_ptr->gamma_16_table = NULL; + } + +#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ + defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \ + defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) + png_free(png_ptr, png_ptr->gamma_from_1); + png_ptr->gamma_from_1 = NULL; + png_free(png_ptr, png_ptr->gamma_to_1); + png_ptr->gamma_to_1 = NULL; + + if (png_ptr->gamma_16_from_1 != NULL) + { + int i; + int istop = (1 << (8 - png_ptr->gamma_shift)); + for (i = 0; i < istop; i++) + { + png_free(png_ptr, png_ptr->gamma_16_from_1[i]); + } + png_free(png_ptr, png_ptr->gamma_16_from_1); + png_ptr->gamma_16_from_1 = NULL; + } + if (png_ptr->gamma_16_to_1 != NULL) + { + int i; + int istop = (1 << (8 - png_ptr->gamma_shift)); + for (i = 0; i < istop; i++) + { + png_free(png_ptr, png_ptr->gamma_16_to_1[i]); + } + png_free(png_ptr, png_ptr->gamma_16_to_1); + png_ptr->gamma_16_to_1 = NULL; + } +#endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */ +} + /* 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 * the future. Note also how the gamma_16 tables are segmented so that @@ -2655,6 +2740,18 @@ png_build_gamma_table(png_structp png_ptr, int bit_depth) { png_debug(1, "in png_build_gamma_table"); + /* Remove any existing table; this copes with multiple calls to + * png_read_update_info. The warning is because building the gamma tables + * multiple times is a performance hit - it's harmless but the ability to call + * png_read_update_info() multiple times is new in 1.5.6 so it seems sensible + * to warn if the app introduces such a hit. + */ + if (png_ptr->gamma_table != NULL || png_ptr->gamma_16_table != NULL) + { + png_warning(png_ptr, "gamma table being rebuilt"); + png_destroy_gamma_table(png_ptr); + } + if (bit_depth <= 8) { png_build_8bit_table(png_ptr, &png_ptr->gamma_table, @@ -2699,7 +2796,7 @@ png_build_gamma_table(png_structp png_ptr, int bit_depth) * Where 'iv' is the input color value and 'ov' is the output value - * pow(iv, gamma). * - * Thus the gamma table consists of up to 256 256 entry tables. The table + * Thus the gamma table consists of up to 256 256-entry tables. The table * is selected by the (8-gamma_shift) most significant of the low 8 bits of * the color value then indexed by the upper 8 bits: * diff --git a/Build/source/libs/libpng/libpng-1.5.5/png.h b/Build/source/libs/libpng/libpng-1.5.7/png.h index 7c8a9c2431c..e22ec5c5dfc 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/png.h +++ b/Build/source/libs/libpng/libpng-1.5.7/png.h @@ -1,7 +1,7 @@ /* png.h - header file for PNG reference library * - * libpng version 1.5.5 - September 22, 2011 + * libpng version 1.5.7 - December 15, 2011 * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -11,7 +11,7 @@ * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.5.5 - September 22, 2011: Glenn + * libpng versions 0.97, January 1998, through 1.5.7 - December 15, 2011: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: @@ -160,6 +160,12 @@ * 1.5.5beta01-08 15 10505 15.so.15.5[.0] * 1.5.5rc01 15 10505 15.so.15.5[.0] * 1.5.5 15 10505 15.so.15.5[.0] + * 1.5.6beta01-07 15 10506 15.so.15.6[.0] + * 1.5.6rc01-03 15 10506 15.so.15.6[.0] + * 1.5.6 15 10506 15.so.15.6[.0] + * 1.5.7beta01-05 15 10507 15.so.15.7[.0] + * 1.5.7rc01-03 15 10507 15.so.15.7[.0] + * 1.5.7 15 10507 15.so.15.7[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be @@ -191,7 +197,7 @@ * * This code is released under the libpng license. * - * libpng versions 1.2.6, August 15, 2004, through 1.5.5, September 22, 2011, are + * libpng versions 1.2.6, August 15, 2004, through 1.5.7, December 15, 2011, are * Copyright (c) 2004, 2006-2011 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: @@ -303,13 +309,13 @@ * Y2K compliance in libpng: * ========================= * - * September 22, 2011 + * December 15, 2011 * * 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.5.5 are Y2K compliant. It is my belief that + * upward through 1.5.7 are Y2K compliant. It is my belief that * earlier versions were also Y2K compliant. * * Libpng only has two year fields. One is a 2-byte unsigned integer @@ -361,12 +367,15 @@ * describes how to use libpng, and the file example.c summarizes it * with some code on which to build. This file is useful for looking * at the actual function definitions and structure components. + * + * If you just need to read a PNG file and don't want to read the documentation + * skip to the end of this file and read the section entitled 'simplified API'. */ /* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.5.5" +#define PNG_LIBPNG_VER_STRING "1.5.7" #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.5.5 - September 22, 2011\n" + " libpng version 1.5.7 - December 15, 2011\n" #define PNG_LIBPNG_VER_SONUM 15 #define PNG_LIBPNG_VER_DLLNUM 15 @@ -374,7 +383,8 @@ /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MINOR 5 -#define PNG_LIBPNG_VER_RELEASE 5 +#define PNG_LIBPNG_VER_RELEASE 7 + /* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ @@ -404,7 +414,7 @@ * version 1.0.0 was mis-numbered 100 instead of 10000). From * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ -#define PNG_LIBPNG_VER 10505 /* 1.5.5 */ +#define PNG_LIBPNG_VER 10507 /* 1.5.7 */ /* Library configuration: these options cannot be changed after * the library has been built. @@ -526,7 +536,7 @@ extern "C" { /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ -typedef char* png_libpng_version_1_5_5; +typedef char* png_libpng_version_1_5_7; /* Three color definitions. The order of the red, green, and blue, (and the * exact size) is not important, although the size of the fields need to @@ -601,11 +611,20 @@ typedef png_sPLT_t FAR * FAR * png_sPLT_tpp; #ifdef PNG_TEXT_SUPPORTED /* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file, * and whether that contents is compressed or not. The "key" field - * points to a regular zero-terminated C string. The "text", "lang", and - * "lang_key" fields can be regular C strings, empty strings, or NULL pointers. + * points to a regular zero-terminated C string. The "text" fields can be a + * regular C string, an empty string, or a NULL pointer. * However, the structure returned by png_get_text() will always contain - * regular zero-terminated C strings (possibly empty), never NULL pointers, - * so they can be safely used in printf() and other string-handling functions. + * the "text" field as a regular zero-terminated C string (possibly + * empty), never a NULL pointer, so it can be safely used in printf() and + * other string-handling functions. Note that the "itxt_length", "lang", and + * "lang_key" members of the structure only exist when the library is built + * with iTXt chunk support. Prior to libpng-1.4.0 the library was built by + * default without iTXt support. Also note that when iTXt *is* supported, + * the "lang" and "lang_key" fields contain NULL pointers when the + * "compression" field contains * PNG_TEXT_COMPRESSION_NONE or + * PNG_TEXT_COMPRESSION_zTXt. Note that the "compression value" is not the + * same as what appears in the PNG tEXt/zTXt/iTXt chunk's "compression flag" + * which is always 0 or 1, or its "compression method" which is always 0. */ typedef struct png_text_struct { @@ -1120,6 +1139,11 @@ PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structp png_ptr)); #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED /* Reduce RGB to grayscale. */ +#define PNG_ERROR_ACTION_NONE 1 +#define PNG_ERROR_ACTION_WARN 2 +#define PNG_ERROR_ACTION_ERROR 3 +#define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/ + PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structp png_ptr, int error_action, double red, double green)); PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structp png_ptr, @@ -1830,6 +1854,7 @@ PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structp, int save)); */ PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structp)); +#ifdef PNG_READ_INTERLACING_SUPPORTED /* Function that combines rows. 'new_row' is a flag that should come from * the callback and be non-NULL if anything needs to be done; the library * stores its own version of the new data internally and ignores the passed @@ -1837,6 +1862,7 @@ PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structp)); */ PNG_EXPORT(93, void, png_progressive_combine_row, (png_structp png_ptr, png_bytep old_row, png_const_bytep new_row)); +#endif /* PNG_READ_INTERLACING_SUPPORTED */ #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ PNG_EXPORTA(94, png_voidp, png_malloc, @@ -2305,15 +2331,21 @@ PNG_EXPORT(171, void, png_set_sCAL_s, /* Provide a list of chunks and how they are to be handled, if the built-in handling or default unknown chunk handling is not desired. Any chunks not listed will be handled in the default manner. The IHDR and IEND chunks - must not be listed. - keep = 0: follow default behavior - = 1: do not keep - = 2: keep only if safe-to-copy - = 3: keep even if unsafe-to-copy + must not be listed. Because this turns off the default handling for chunks + that would otherwise be recognized the behavior of libpng transformations may + well become incorrect! + keep = 0: PNG_HANDLE_CHUNK_AS_DEFAULT: follow default behavior + = 1: PNG_HANDLE_CHUNK_NEVER: do not keep + = 2: PNG_HANDLE_CHUNK_IF_SAFE: keep only if safe-to-copy + = 3: PNG_HANDLE_CHUNK_ALWAYS: keep even if unsafe-to-copy */ PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structp png_ptr, int keep, png_const_bytep chunk_list, int num_chunks)); + +/* The handling code is returned; the result is therefore true (non-zero) if + * special handling is required, false for the default handling. + */ PNG_EXPORT(173, int, png_handle_as_unknown, (png_structp png_ptr, png_const_bytep chunk_name)); #endif @@ -2453,8 +2485,16 @@ PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, * full, image which appears in a given pass. 'pass' is in the range 0 * to 6 and the result is in the range 0 to 7. */ -#define PNG_PASS_START_ROW(pass) (((1U&~(pass))<<(3-((pass)>>1)))&7) -#define PNG_PASS_START_COL(pass) (((1U& (pass))<<(3-(((pass)+1)>>1)))&7) +#define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7) +#define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7) + +/* A macro to return the offset between pixels in the output row for a pair of + * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that + * follows. Note that ROW_OFFSET is the offset from one row to the next whereas + * COL_OFFSET is from one column to the next, within a row. + */ +#define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8) +#define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1)) /* Two macros to help evaluate the number of rows or columns in each * pass. This is expressed as a shift - effectively log2 of the number or @@ -2489,8 +2529,8 @@ PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, * the tile. */ #define PNG_PASS_MASK(pass,off) ( \ - ((0x110145AFU>>(((7-(off))-(pass))<<2)) & 0xFU) | \ - ((0x01145AF0U>>(((7-(off))-(pass))<<2)) & 0xF0U)) + ((0x110145AF>>(((7-(off))-(pass))<<2)) & 0xF) | \ + ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0)) #define PNG_ROW_IN_INTERLACE_PASS(y, pass) \ ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1) diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngbar.jpg b/Build/source/libs/libpng/libpng-1.5.7/pngbar.jpg Binary files differindex 70ba8d817ce..70ba8d817ce 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngbar.jpg +++ b/Build/source/libs/libpng/libpng-1.5.7/pngbar.jpg diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngbar.png b/Build/source/libs/libpng/libpng-1.5.7/pngbar.png Binary files differindex 49798c8ed95..49798c8ed95 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngbar.png +++ b/Build/source/libs/libpng/libpng-1.5.7/pngbar.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngconf.h b/Build/source/libs/libpng/libpng-1.5.7/pngconf.h index 05dd2928f52..d07054de285 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngconf.h +++ b/Build/source/libs/libpng/libpng-1.5.7/pngconf.h @@ -1,7 +1,7 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.5.5 - September 22, 2011 + * libpng version 1.5.7 - December 15, 2011 * * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) @@ -366,10 +366,10 @@ # define PNG_USE_RESULT /* not supported */ # endif # ifndef PNG_NORETURN -# define PNG_NORETURN __declspec(noreturn) +# define PNG_NORETURN __declspec(noreturn) # endif # ifndef PNG_ALLOCATED -# if defined(_MSC_VER) && (_MSC_VER >= 1300) +# if (_MSC_VER >= 1400) # define PNG_ALLOCATED __declspec(restrict) # endif # endif diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngdebug.h b/Build/source/libs/libpng/libpng-1.5.7/pngdebug.h index 16f81fdd141..16f81fdd141 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngdebug.h +++ b/Build/source/libs/libpng/libpng-1.5.7/pngdebug.h diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngerror.c b/Build/source/libs/libpng/libpng-1.5.7/pngerror.c index 4d4cebafa94..7604bddf183 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngerror.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngerror.c @@ -1,7 +1,7 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.7 [December 15, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -374,11 +374,14 @@ static void /* PRIVATE */ png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp error_message) { - int iout = 0, iin = 0; + png_uint_32 chunk_name = png_ptr->chunk_name; + int iout = 0, ishift = 24; - while (iin < 4) + while (ishift >= 0) { - int c = png_ptr->chunk_name[iin++]; + int c = (int)(chunk_name >> ishift) & 0xff; + + ishift -= 8; if (isnonalpha(c)) { buffer[iout++] = PNG_LITERAL_LEFT_SQUARE_BRACKET; @@ -389,7 +392,7 @@ png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp else { - buffer[iout++] = (png_byte)c; + buffer[iout++] = (char)c; } } @@ -398,10 +401,11 @@ png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp else { + int iin = 0; + buffer[iout++] = ':'; buffer[iout++] = ' '; - iin = 0; while (iin < PNG_MAX_ERROR_TEXT-1 && error_message[iin] != '\0') buffer[iout++] = error_message[iin++]; diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngget.c b/Build/source/libs/libpng/libpng-1.5.7/pngget.c index 3c1b4091aaf..43400cda7e8 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngget.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngget.c @@ -1,7 +1,7 @@ /* pngget.c - retrieval of values from info struct * - * Last changed in libpng 1.5.5 [September 22, 2011] + * Last changed in libpng 1.5.7 [December 15, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -682,15 +682,16 @@ png_get_iCCP(png_const_structp png_ptr, png_const_infop info_ptr, png_debug1(1, "in %s retrieval function", "iCCP"); if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP) - && name != NULL && profile != NULL && proflen != NULL) + && name != NULL && compression_type != NULL && profile != NULL && + proflen != NULL) { *name = info_ptr->iccp_name; *profile = info_ptr->iccp_profile; /* Compression_type is a dummy so the API won't have to change * if we introduce multiple compression types later. */ - *proflen = (int)info_ptr->iccp_proflen; - *compression_type = (int)info_ptr->iccp_compression; + *proflen = info_ptr->iccp_proflen; + *compression_type = info_ptr->iccp_compression; return (PNG_INFO_iCCP); } @@ -950,9 +951,8 @@ png_get_text(png_const_structp png_ptr, png_const_infop info_ptr, { if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0) { - png_debug1(1, "in %s retrieval function", - (png_ptr->chunk_name[0] == '\0' ? "text" : - (png_const_charp)png_ptr->chunk_name)); + png_debug1(1, "in 0x%lx retrieval function", + (unsigned long)png_ptr->chunk_name); if (text_ptr != NULL) *text_ptr = info_ptr->text; @@ -1069,7 +1069,6 @@ png_get_compression_buffer_size(png_const_structp png_ptr) return (png_ptr ? png_ptr->zbuf_size : 0); } - #ifdef PNG_SET_USER_LIMITS_SUPPORTED /* These functions were added to libpng 1.2.6 and were enabled * by default in libpng-1.4.0 */ @@ -1111,16 +1110,14 @@ png_get_io_state (png_structp png_ptr) png_uint_32 PNGAPI png_get_io_chunk_type (png_const_structp png_ptr) { - return ((png_ptr->chunk_name[0] << 24) + - (png_ptr->chunk_name[1] << 16) + - (png_ptr->chunk_name[2] << 8) + - (png_ptr->chunk_name[3])); + return png_ptr->chunk_name; } png_const_bytep PNGAPI png_get_io_chunk_name (png_structp png_ptr) { - return png_ptr->chunk_name; + PNG_CSTRING_FROM_CHUNK(png_ptr->io_chunk_string, png_ptr->chunk_name); + return png_ptr->io_chunk_string; } #endif /* ?PNG_IO_STATE_SUPPORTED */ diff --git a/Build/source/libs/libpng/libpng-1.5.5/pnginfo.h b/Build/source/libs/libpng/libpng-1.5.7/pnginfo.h index a33bfab06de..a33bfab06de 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pnginfo.h +++ b/Build/source/libs/libpng/libpng-1.5.7/pnginfo.h diff --git a/Build/source/libs/libpng/libpng-1.5.5/pnglibconf.h b/Build/source/libs/libpng/libpng-1.5.7/pnglibconf.h index 8022a5a8814..0a799915f85 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pnglibconf.h +++ b/Build/source/libs/libpng/libpng-1.5.7/pnglibconf.h @@ -3,7 +3,7 @@ /* pnglibconf.h - library build configuration */ -/* libpng version 1.5.4 - last changed on June 22, 2011 */ +/* Libpng 1.5.7 - December 15, 2011 */ /* Copyright (c) 1998-2011 Glenn Randers-Pehrson */ @@ -54,6 +54,8 @@ #define PNG_FIXED_POINT_SUPPORTED #define PNG_FLOATING_ARITHMETIC_SUPPORTED #define PNG_FLOATING_POINT_SUPPORTED +#define PNG_FORMAT_AFIRST_SUPPORTED +#define PNG_FORMAT_BGR_SUPPORTED #define PNG_gAMA_SUPPORTED #define PNG_HANDLE_AS_UNKNOWN_SUPPORTED #define PNG_hIST_SUPPORTED diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngmem.c b/Build/source/libs/libpng/libpng-1.5.7/pngmem.c index ea606d6a624..bf5ff037dad 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngmem.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngmem.c @@ -1,7 +1,7 @@ /* pngmem.c - stub functions for memory allocation * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.7 [December 15, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -56,9 +56,9 @@ png_create_struct_2,(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr), if (malloc_fn != NULL) { png_struct dummy_struct; - png_structp png_ptr = &dummy_struct; - png_ptr->mem_ptr=mem_ptr; - struct_ptr = (*(malloc_fn))(png_ptr, (png_uint_32)size); + memset(&dummy_struct, 0, sizeof dummy_struct); + dummy_struct.mem_ptr=mem_ptr; + struct_ptr = (*(malloc_fn))(&dummy_struct, (png_alloc_size_t)size); } else @@ -90,9 +90,9 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn, if (free_fn != NULL) { png_struct dummy_struct; - png_structp png_ptr = &dummy_struct; - png_ptr->mem_ptr=mem_ptr; - (*(free_fn))(png_ptr, struct_ptr); + memset(&dummy_struct, 0, sizeof dummy_struct); + dummy_struct.mem_ptr=mem_ptr; + (*(free_fn))(&dummy_struct, struct_ptr); return; } @@ -143,7 +143,7 @@ png_malloc,(png_structp png_ptr, png_alloc_size_t size),PNG_ALLOCATED) # ifdef PNG_USER_MEM_SUPPORTED if (png_ptr->malloc_fn != NULL) - ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size)); + ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, size)); else ret = (png_malloc_default(png_ptr, size)); diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngnow.png b/Build/source/libs/libpng/libpng-1.5.7/pngnow.png Binary files differindex 82793ebddb7..82793ebddb7 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngnow.png +++ b/Build/source/libs/libpng/libpng-1.5.7/pngnow.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngpread.c b/Build/source/libs/libpng/libpng-1.5.7/pngpread.c index a50292a76ad..20d3f236e12 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngpread.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngpread.c @@ -1,7 +1,7 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.5.2 [March 31, 2011] + * Last changed in libpng 1.5.7 [December 15, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -208,61 +208,7 @@ png_push_read_sig(png_structp png_ptr, png_infop info_ptr) void /* PRIVATE */ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) { - PNG_IHDR; - PNG_IDAT; - PNG_IEND; - PNG_PLTE; -#ifdef PNG_READ_bKGD_SUPPORTED - PNG_bKGD; -#endif -#ifdef PNG_READ_cHRM_SUPPORTED - PNG_cHRM; -#endif -#ifdef PNG_READ_gAMA_SUPPORTED - PNG_gAMA; -#endif -#ifdef PNG_READ_hIST_SUPPORTED - PNG_hIST; -#endif -#ifdef PNG_READ_iCCP_SUPPORTED - PNG_iCCP; -#endif -#ifdef PNG_READ_iTXt_SUPPORTED - PNG_iTXt; -#endif -#ifdef PNG_READ_oFFs_SUPPORTED - PNG_oFFs; -#endif -#ifdef PNG_READ_pCAL_SUPPORTED - PNG_pCAL; -#endif -#ifdef PNG_READ_pHYs_SUPPORTED - PNG_pHYs; -#endif -#ifdef PNG_READ_sBIT_SUPPORTED - PNG_sBIT; -#endif -#ifdef PNG_READ_sCAL_SUPPORTED - PNG_sCAL; -#endif -#ifdef PNG_READ_sRGB_SUPPORTED - PNG_sRGB; -#endif -#ifdef PNG_READ_sPLT_SUPPORTED - PNG_sPLT; -#endif -#ifdef PNG_READ_tEXt_SUPPORTED - PNG_tEXt; -#endif -#ifdef PNG_READ_tIME_SUPPORTED - PNG_tIME; -#endif -#ifdef PNG_READ_tRNS_SUPPORTED - PNG_tRNS; -#endif -#ifdef PNG_READ_zTXt_SUPPORTED - PNG_zTXt; -#endif + png_uint_32 chunk_name; /* First we make sure we have enough data for the 4 byte chunk name * and the 4 byte chunk length before proceeding with decoding the @@ -273,6 +219,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER)) { png_byte chunk_length[4]; + png_byte chunk_tag[4]; if (png_ptr->buffer_size < 8) { @@ -283,16 +230,27 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) png_push_fill_buffer(png_ptr, chunk_length, 4); png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length); png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); + png_crc_read(png_ptr, chunk_tag, 4); + png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag); png_check_chunk_name(png_ptr, png_ptr->chunk_name); png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; } - if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) + chunk_name = png_ptr->chunk_name; + + if (chunk_name == png_IDAT) + { + /* This is here above the if/else case statement below because if the + * unknown handling marks 'IDAT' as unknown then the IDAT handling case is + * completely skipped. + * + * TODO: there must be a better way of doing this. + */ 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 (chunk_name == png_IHDR) { if (png_ptr->push_length != 13) png_error(png_ptr, "Invalid IHDR length"); @@ -306,7 +264,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length); } - else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) + else if (chunk_name == png_IEND) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -321,7 +279,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) } #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name)) + else if (png_chunk_unknown_handling(png_ptr, chunk_name)) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -329,15 +287,15 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) return; } - if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) + if (chunk_name == png_IDAT) png_ptr->mode |= PNG_HAVE_IDAT; png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length); - if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) + if (chunk_name == png_PLTE) png_ptr->mode |= PNG_HAVE_PLTE; - else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) + else if (chunk_name == png_IDAT) { if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before IDAT"); @@ -349,7 +307,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) } #endif - else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) + else if (chunk_name == png_PLTE) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -359,7 +317,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length); } - else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) + else if (chunk_name == png_IDAT) { /* If we reach an IDAT chunk, this means we have read all of the * header chunks, and we can start reading the image (or if this @@ -395,7 +353,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) } #ifdef PNG_READ_gAMA_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_gAMA, 4)) + else if (png_ptr->chunk_name == png_gAMA) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -408,7 +366,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_sBIT_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_sBIT, 4)) + else if (png_ptr->chunk_name == png_sBIT) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -421,7 +379,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_cHRM_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_cHRM, 4)) + else if (png_ptr->chunk_name == png_cHRM) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -434,7 +392,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_sRGB_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_sRGB, 4)) + else if (chunk_name == png_sRGB) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -447,7 +405,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_iCCP_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_iCCP, 4)) + else if (png_ptr->chunk_name == png_iCCP) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -460,7 +418,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_sPLT_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_sPLT, 4)) + else if (chunk_name == png_sPLT) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -473,7 +431,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_tRNS_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_tRNS, 4)) + else if (chunk_name == png_tRNS) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -486,7 +444,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_bKGD_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_bKGD, 4)) + else if (chunk_name == png_bKGD) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -499,7 +457,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_hIST_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_hIST, 4)) + else if (chunk_name == png_hIST) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -512,7 +470,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_pHYs_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_pHYs, 4)) + else if (chunk_name == png_pHYs) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -525,7 +483,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_oFFs_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_oFFs, 4)) + else if (chunk_name == png_oFFs) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -538,7 +496,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_pCAL_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_pCAL, 4)) + else if (chunk_name == png_pCAL) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -551,7 +509,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_sCAL_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_sCAL, 4)) + else if (chunk_name == png_sCAL) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -564,7 +522,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_tIME_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4)) + else if (chunk_name == png_tIME) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -577,7 +535,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_tEXt_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4)) + else if (chunk_name == png_tEXt) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -590,7 +548,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_zTXt_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4)) + else if (chunk_name == png_zTXt) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -603,7 +561,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) #endif #ifdef PNG_READ_iTXt_SUPPORTED - else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4)) + else if (chunk_name == png_iTXt) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) { @@ -809,11 +767,12 @@ png_push_restore_buffer(png_structp png_ptr, png_bytep buffer, void /* PRIVATE */ png_push_read_IDAT(png_structp png_ptr) { - PNG_IDAT; if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER)) { png_byte chunk_length[4]; + png_byte chunk_tag[4]; + /* TODO: this code can be commoned up with the same code in push_read */ if (png_ptr->buffer_size < 8) { png_push_save_buffer(png_ptr); @@ -823,10 +782,11 @@ png_push_read_IDAT(png_structp png_ptr) png_push_fill_buffer(png_ptr, chunk_length, 4); png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length); png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); + png_crc_read(png_ptr, chunk_tag, 4); + png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag); png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; - if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) + if (png_ptr->chunk_name != png_IDAT) { png_ptr->process_mode = PNG_READ_CHUNK_MODE; @@ -838,6 +798,7 @@ png_push_read_IDAT(png_structp png_ptr) png_ptr->idat_size = png_ptr->push_length; } + if (png_ptr->idat_size && png_ptr->save_buffer_size) { png_size_t save_size = png_ptr->save_buffer_size; @@ -1011,36 +972,56 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer, void /* PRIVATE */ png_push_process_row(png_structp png_ptr) { - png_ptr->row_info.color_type = png_ptr->color_type; - png_ptr->row_info.width = png_ptr->iwidth; - png_ptr->row_info.channels = png_ptr->channels; - png_ptr->row_info.bit_depth = png_ptr->bit_depth; - png_ptr->row_info.pixel_depth = png_ptr->pixel_depth; + /* 1.5.6: row_info moved out of png_struct to a local here. */ + png_row_info row_info; - png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->row_info.width); + row_info.width = png_ptr->iwidth; /* NOTE: width of current interlaced row */ + row_info.color_type = png_ptr->color_type; + row_info.bit_depth = png_ptr->bit_depth; + row_info.channels = png_ptr->channels; + row_info.pixel_depth = png_ptr->pixel_depth; + row_info.rowbytes = PNG_ROWBYTES(row_info.pixel_depth, row_info.width); - png_read_filter_row(png_ptr, &(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->prev_row + 1, - (int)(png_ptr->row_buf[0])); + if (png_ptr->row_buf[0] > PNG_FILTER_VALUE_NONE) + { + if (png_ptr->row_buf[0] < PNG_FILTER_VALUE_LAST) + png_read_filter_row(png_ptr, &row_info, png_ptr->row_buf + 1, + png_ptr->prev_row + 1, png_ptr->row_buf[0]); + else + png_error(png_ptr, "bad adaptive filter value"); + } - png_memcpy(png_ptr->prev_row, png_ptr->row_buf, png_ptr->rowbytes + 1); + /* libpng 1.5.6: the following line was copying png_ptr->rowbytes before + * 1.5.6, while the buffer really is this big in current versions of libpng + * it may not be in the future, so this was changed just to copy the + * interlaced row count: + */ + png_memcpy(png_ptr->prev_row, png_ptr->row_buf, row_info.rowbytes + 1); #ifdef PNG_READ_TRANSFORMS_SUPPORTED if (png_ptr->transformations) - png_do_read_transformations(png_ptr); + png_do_read_transformations(png_ptr, &row_info); #endif + /* The transformed pixel depth should match the depth now in row_info. */ + if (png_ptr->transformed_pixel_depth == 0) + { + png_ptr->transformed_pixel_depth = row_info.pixel_depth; + if (row_info.pixel_depth > png_ptr->maximum_pixel_depth) + png_error(png_ptr, "progressive row overflow"); + } + + else if (png_ptr->transformed_pixel_depth != row_info.pixel_depth) + png_error(png_ptr, "internal progressive row size calculation error"); + + #ifdef PNG_READ_INTERLACING_SUPPORTED /* Blow up interlaced rows to full size */ if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE)) { if (png_ptr->pass < 6) -/* old interface (pre-1.0.9): - png_do_read_interlace(&(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations); - */ - png_do_read_interlace(png_ptr); + png_do_read_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass, + png_ptr->transformations); switch (png_ptr->pass) { @@ -1223,20 +1204,20 @@ png_read_push_finish_row(png_structp png_ptr) /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ - PNG_CONST int FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; + static PNG_CONST png_byte FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; /* Offset to next interlace block */ - PNG_CONST int FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; + static PNG_CONST png_byte FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; /* Start of interlace block in the y direction */ - PNG_CONST int FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; + static PNG_CONST png_byte FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; /* Offset to next interlace block in the y direction */ - PNG_CONST int FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; + static PNG_CONST png_byte FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; /* Height of interlace block. This is not currently used - if you need * it, uncomment it here and in png.h - PNG_CONST int FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1}; + static PNG_CONST png_byte FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1}; */ png_ptr->row_number++; @@ -1714,11 +1695,12 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) { png_uint_32 skip = 0; + png_uint_32 chunk_name = png_ptr->chunk_name; - if (!(png_ptr->chunk_name[0] & 0x20)) + if (PNG_CHUNK_CRITICAL(chunk_name)) { #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED - if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != + if (png_chunk_unknown_handling(png_ptr, chunk_name) != PNG_HANDLE_CHUNK_ALWAYS #ifdef PNG_READ_USER_CHUNKS_SUPPORTED && png_ptr->read_user_chunk_fn == NULL @@ -1731,22 +1713,26 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 } #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED + /* TODO: the code below is apparently just using the + * png_struct::unknown_chunk member as a temporarily variable, it should be + * possible to eliminate both it and the temporary buffer. + */ if (png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS) { #ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) + if (length > 65535) { png_warning(png_ptr, "unknown chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; + skip = length - 65535; + length = 65535; } #endif - png_memcpy((png_charp)png_ptr->unknown_chunk.name, - (png_charp)png_ptr->chunk_name, - png_sizeof(png_ptr->unknown_chunk.name)); - png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name) - 1] - = '\0'; + /* This is just a record for the user; libpng doesn't use the character + * form of the name. + */ + PNG_CSTRING_FROM_CHUNK(png_ptr->unknown_chunk.name, png_ptr->chunk_name); + /* The following cast should be safe because of the check above. */ png_ptr->unknown_chunk.size = (png_size_t)length; if (length == 0) @@ -1755,8 +1741,9 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 else { png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr, - (png_size_t)length); - png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length); + png_ptr->unknown_chunk.size); + png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, + png_ptr->unknown_chunk.size); } #ifdef PNG_READ_USER_CHUNKS_SUPPORTED @@ -1772,8 +1759,8 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 if (ret == 0) { - if (!(png_ptr->chunk_name[0] & 0x20)) - if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != + if (PNG_CHUNK_CRITICAL(png_ptr->chunk_name)) + if (png_chunk_unknown_handling(png_ptr, chunk_name) != PNG_HANDLE_CHUNK_ALWAYS) png_chunk_error(png_ptr, "unknown critical chunk"); png_set_unknown_chunks(png_ptr, info_ptr, @@ -1816,19 +1803,22 @@ png_push_have_row(png_structp png_ptr, png_bytep row) (int)png_ptr->pass); } +#ifdef PNG_READ_INTERLACING_SUPPORTED void PNGAPI png_progressive_combine_row (png_structp png_ptr, png_bytep old_row, png_const_bytep new_row) { - PNG_CONST int FARDATA png_pass_dsp_mask[7] = - {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; - if (png_ptr == NULL) return; - if (new_row != NULL) /* new_row must == png_ptr->row_buf here. */ - png_combine_row(png_ptr, old_row, png_pass_dsp_mask[png_ptr->pass]); + /* new_row is a flag here - if it is NULL then the app callback was called + * from an empty row (see the calls to png_struct::row_fn below), otherwise + * it must be png_ptr->row_buf+1 + */ + if (new_row != NULL) + png_combine_row(png_ptr, old_row, 1/*display*/); } +#endif /* PNG_READ_INTERLACING_SUPPORTED */ void PNGAPI png_set_progressive_read_fn(png_structp png_ptr, png_voidp progressive_ptr, diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngpriv.h b/Build/source/libs/libpng/libpng-1.5.7/pngpriv.h index dad2837aa71..67e486c577f 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngpriv.h +++ b/Build/source/libs/libpng/libpng-1.5.7/pngpriv.h @@ -6,7 +6,7 @@ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * - * Last changed in libpng 1.5.5 [September 22, 2011] + * Last changed in libpng 1.5.7 [December 15, 2011] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -44,6 +44,9 @@ */ #include <stdlib.h> +/* This is used to find 'offsetof', used below for alignment tests. */ +#include <stddef.h> + #define PNGLIB_BUILD /*libpng is being built, not used*/ #ifdef PNG_USER_CONFIG @@ -193,6 +196,23 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp; # define PNG_STATIC static #endif +/* C99 restrict is used where possible, to do this 'restrict' is defined as + * empty if we can't be sure it is supported. configure builds have already + * done this work. + */ +#ifdef PNG_CONFIGURE_LIBPNG +# define PNG_RESTRICT restrict +#else + /* Modern compilers support restrict, but assume not for anything not + * recognized here: + */ +# if defined __GNUC__ || defined _MSC_VER || defined __WATCOMC__ +# define PNG_RESTRICT restrict +# else +# define PNG_RESTRICT +# endif +#endif + /* If warnings or errors are turned off the code is disabled or redirected here. * From 1.5.4 functions have been added to allow very limited formatting of * error and warning messages - this code will also be disabled here. @@ -214,15 +234,28 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp; # define png_fixed_error(s1,s2) png_err(s1) #endif +/* C allows up-casts from (void*) to any pointer and (const void*) to any + * pointer to a const object. C++ regards this as a type error and requires an + * explicit, static, cast and provides the static_cast<> rune to ensure that + * const is not cast away. + */ +#ifdef __cplusplus +# define png_voidcast(type, value) static_cast<type>(value) +#else +# define png_voidcast(type, value) (value) +#endif /* __cplusplus */ + #ifndef PNG_EXTERN /* The functions exported by PNG_EXTERN are internal functions, which * aren't usually used outside the library (as far as I know), so it is * debatable if they should be exported at all. In the future, when it * is possible to have run-time registry of chunk-handling functions, * some of these might be made available again. -# define PNG_EXTERN extern + * + * 1.5.7: turned the use of 'extern' back on, since it is localized to pngpriv.h + * it should be safe now (it is unclear why it was turned off.) */ -# define PNG_EXTERN +# define PNG_EXTERN extern #endif /* Some fixed point APIs are still required even if not exported because @@ -321,6 +354,52 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp; # define png_memset memset # endif #endif + +/* These macros may need to be architecture dependent. */ +#define PNG_ALIGN_NONE 0 /* do not use data alignment */ +#define PNG_ALIGN_ALWAYS 1 /* assume unaligned accesses are OK */ +#ifdef offsetof +# define PNG_ALIGN_OFFSET 2 /* use offsetof to determine alignment */ +#else +# define PNG_ALIGN_OFFSET -1 /* prevent the use of this */ +#endif +#define PNG_ALIGN_SIZE 3 /* use sizeof to determine alignment */ + +#ifndef PNG_ALIGN_TYPE + /* Default to using aligned access optimizations and requiring alignment to a + * multiple of the data type size. Override in a compiler specific fashion + * if necessary by inserting tests here: + */ +# define PNG_ALIGN_TYPE PNG_ALIGN_SIZE +#endif + +#if PNG_ALIGN_TYPE == PNG_ALIGN_SIZE + /* This is used because in some compiler implementations non-aligned + * structure members are supported, so the offsetof approach below fails. + * Set PNG_ALIGN_TO_SIZE=0 for compiler combinations where unaligned access + * is good for performance. Do not do this unless you have tested the result + * and understand it. + */ +# define png_alignof(type) (sizeof (type)) +#else +# if PNG_ALIGN_TYPE == PNG_ALIGN_OFFSET +# define png_alignof(type) offsetof(struct{char c; type t;}, t) +# else +# if PNG_ALIGN_TYPE == PNG_ALIGN_ALWAYS +# define png_alignof(type) (1) +# endif + /* Else leave png_alignof undefined to prevent use thereof */ +# endif +#endif + +/* This implicitly assumes alignment is always to a power of 2. */ +#ifdef png_alignof +# define png_isaligned(ptr, type)\ + ((((const char*)ptr-(const char*)0) & (png_alignof(type)-1)) == 0) +#else +# define png_isaligned(ptr, type) 0 +#endif + /* End of memory model/platform independent support */ /* End of 1.5.0beta36 move from pngconf.h */ @@ -502,32 +581,70 @@ PNG_EXTERN png_fixed_point png_fixed PNGARG((png_structp png_ptr, double fp, #endif #endif -/* Constant strings for known chunk types. If you need to add a chunk, - * define the name here, and add an invocation of the macro wherever it's - * needed. +/* Constants for known chunk types. If you need to add a chunk, define the name + * here. For historical reasons these constants have the form png_<name>; i.e. + * the prefix is lower case. Please use decimal values as the parameters to + * match the ISO PNG specification and to avoid relying on the C locale + * interpretation of character values. + * + * Prior to 1.5.6 these constants were strings, as of 1.5.6 png_uint_32 values + * are computed and a new macro (PNG_STRING_FROM_CHUNK) added to allow a string + * to be generated if required. + * + * PNG_32b correctly produces a value shifted by up to 24 bits, even on + * architectures where (int) is only 16 bits. + */ +#define PNG_32b(b,s) ((png_uint_32)(b) << (s)) +#define PNG_CHUNK(b1,b2,b3,b4) \ + (PNG_32b(b1,24) | PNG_32b(b2,16) | PNG_32b(b3,8) | PNG_32b(b4,0)) + +#define png_IHDR PNG_CHUNK( 73, 72, 68, 82) +#define png_IDAT PNG_CHUNK( 73, 68, 65, 84) +#define png_IEND PNG_CHUNK( 73, 69, 78, 68) +#define png_PLTE PNG_CHUNK( 80, 76, 84, 69) +#define png_bKGD PNG_CHUNK( 98, 75, 71, 68) +#define png_cHRM PNG_CHUNK( 99, 72, 82, 77) +#define png_gAMA PNG_CHUNK(103, 65, 77, 65) +#define png_hIST PNG_CHUNK(104, 73, 83, 84) +#define png_iCCP PNG_CHUNK(105, 67, 67, 80) +#define png_iTXt PNG_CHUNK(105, 84, 88, 116) +#define png_oFFs PNG_CHUNK(111, 70, 70, 115) +#define png_pCAL PNG_CHUNK(112, 67, 65, 76) +#define png_sCAL PNG_CHUNK(115, 67, 65, 76) +#define png_pHYs PNG_CHUNK(112, 72, 89, 115) +#define png_sBIT PNG_CHUNK(115, 66, 73, 84) +#define png_sPLT PNG_CHUNK(115, 80, 76, 84) +#define png_sRGB PNG_CHUNK(115, 82, 71, 66) +#define png_sTER PNG_CHUNK(115, 84, 69, 82) +#define png_tEXt PNG_CHUNK(116, 69, 88, 116) +#define png_tIME PNG_CHUNK(116, 73, 77, 69) +#define png_tRNS PNG_CHUNK(116, 82, 78, 83) +#define png_zTXt PNG_CHUNK(122, 84, 88, 116) + +/* The following will work on (signed char*) strings, whereas the get_uint_32 + * macro will fail on top-bit-set values because of the sign extension. + */ +#define PNG_CHUNK_FROM_STRING(s)\ + PNG_CHUNK(0xff&(s)[0], 0xff&(s)[1], 0xff&(s)[2], 0xff&(s)[3]) + +/* This uses (char), not (png_byte) to avoid warnings on systems where (char) is + * signed and the argument is a (char[]) This macro will fail miserably on + * systems where (char) is more than 8 bits. */ -#define PNG_IHDR PNG_CONST png_byte png_IHDR[5] = { 73, 72, 68, 82, '\0'} -#define PNG_IDAT PNG_CONST png_byte png_IDAT[5] = { 73, 68, 65, 84, '\0'} -#define PNG_IEND PNG_CONST png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'} -#define PNG_PLTE PNG_CONST png_byte png_PLTE[5] = { 80, 76, 84, 69, '\0'} -#define PNG_bKGD PNG_CONST png_byte png_bKGD[5] = { 98, 75, 71, 68, '\0'} -#define PNG_cHRM PNG_CONST png_byte png_cHRM[5] = { 99, 72, 82, 77, '\0'} -#define PNG_gAMA PNG_CONST png_byte png_gAMA[5] = {103, 65, 77, 65, '\0'} -#define PNG_hIST PNG_CONST png_byte png_hIST[5] = {104, 73, 83, 84, '\0'} -#define PNG_iCCP PNG_CONST png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'} -#define PNG_iTXt PNG_CONST png_byte png_iTXt[5] = {105, 84, 88, 116, '\0'} -#define PNG_oFFs PNG_CONST png_byte png_oFFs[5] = {111, 70, 70, 115, '\0'} -#define PNG_pCAL PNG_CONST png_byte png_pCAL[5] = {112, 67, 65, 76, '\0'} -#define PNG_sCAL PNG_CONST png_byte png_sCAL[5] = {115, 67, 65, 76, '\0'} -#define PNG_pHYs PNG_CONST png_byte png_pHYs[5] = {112, 72, 89, 115, '\0'} -#define PNG_sBIT PNG_CONST png_byte png_sBIT[5] = {115, 66, 73, 84, '\0'} -#define PNG_sPLT PNG_CONST png_byte png_sPLT[5] = {115, 80, 76, 84, '\0'} -#define PNG_sRGB PNG_CONST png_byte png_sRGB[5] = {115, 82, 71, 66, '\0'} -#define PNG_sTER PNG_CONST png_byte png_sTER[5] = {115, 84, 69, 82, '\0'} -#define PNG_tEXt PNG_CONST png_byte png_tEXt[5] = {116, 69, 88, 116, '\0'} -#define PNG_tIME PNG_CONST png_byte png_tIME[5] = {116, 73, 77, 69, '\0'} -#define PNG_tRNS PNG_CONST png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'} -#define PNG_zTXt PNG_CONST png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'} +#define PNG_STRING_FROM_CHUNK(s,c)\ + (void)(((char*)(s))[0]=(char)((c)>>24), ((char*)(s))[1]=(char)((c)>>16),\ + ((char*)(s))[2]=(char)((c)>>8), ((char*)(s))[3]=(char)((c))) + +/* Do the same but terminate with a null character. */ +#define PNG_CSTRING_FROM_CHUNK(s,c)\ + (void)(PNG_STRING_FROM_CHUNK(s,c), ((char*)(s))[4] = 0) + +/* Test on flag values as defined in the spec (section 5.4): */ +#define PNG_CHUNK_ANCILLIARY(c) (1 & ((c) >> 29)) +#define PNG_CHUNK_CRITICAL(c) (!PNG_CHUNK_ANCILLIARY(c)) +#define PNG_CHUNK_PRIVATE(c) (1 & ((c) >> 21)) +#define PNG_CHUNK_RESERVED(c) (1 & ((c) >> 13)) +#define PNG_CHUNK_SAFE_TO_COPY(c) (1 & ((c) >> 5)) /* Gamma values (new at libpng-1.5.4): */ #define PNG_GAMMA_MAC_OLD 151724 /* Assume '1.8' is really 2.2/1.45! */ @@ -784,17 +901,44 @@ PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)); /* Internal use only. Called before first row of data */ PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr)); -/* Combine a row of data, dealing with alpha, etc. if requested */ +/* Combine a row of data, dealing with alpha, etc. if requested. 'row' is an + * array of png_ptr->width pixels. If the image is not interlaced or this + * is the final pass this just does a png_memcpy, otherwise the "display" flag + * is used to determine whether to copy pixels that are not in the current pass. + * + * Because 'png_do_read_interlace' (below) replicates pixels this allows this + * function to achieve the documented 'blocky' appearance during interlaced read + * if display is 1 and the 'sparkle' appearance, where existing pixels in 'row' + * are not changed if they are not in the current pass, when display is 0. + * + * 'display' must be 0 or 1, otherwise the memcpy will be done regardless. + * + * The API always reads from the png_struct row buffer and always assumes that + * it is full width (png_do_read_interlace has already been called.) + * + * This function is only ever used to write to row buffers provided by the + * caller of the relevant libpng API and the row must have already been + * transformed by the read transformations. + * + * The PNG_USE_COMPILE_TIME_MASKS option causes generation of pre-computed + * bitmasks for use within the code, otherwise runtime generated masks are used. + * The default is compile time masks. + */ +#ifndef PNG_USE_COMPILE_TIME_MASKS +# define PNG_USE_COMPILE_TIME_MASKS 1 +#endif PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row, - int mask)); + int display)); #ifdef PNG_READ_INTERLACING_SUPPORTED -/* Expand an interlaced row */ -/* OLD pre-1.0.9 interface: +/* Expand an interlaced row: the 'row_info' describes the pass data that has + * been read in and must correspond to the pixels in 'row', the pixels are + * expanded (moved apart) in 'row' to match the final layout, when doing this + * the pixels are *replicated* to the intervening space. This is essential for + * the correct operation of png_combine_row, above. + */ PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info, png_bytep row, int pass, png_uint_32 transformations)); - */ -PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr)); #endif /* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */ @@ -805,10 +949,26 @@ PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info, png_bytep row, int pass)); #endif -/* Unfilter a row */ -PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr, - png_row_infop row_info, png_bytep row, png_const_bytep prev_row, - int filter)); +/* Unfilter a row: check the filter value before calling this, there is no point + * calling it for PNG_FILTER_VALUE_NONE. + */ +PNG_EXTERN void png_read_filter_row PNGARG((png_structp pp, png_row_infop row_info, + png_bytep row, png_const_bytep prev_row, int filter)); + +PNG_EXTERN void png_read_filter_row_up_neon PNGARG((png_row_infop row_info, + png_bytep row, png_const_bytep prev_row)); +PNG_EXTERN void png_read_filter_row_sub3_neon PNGARG((png_row_infop row_info, + png_bytep row, png_const_bytep prev_row)); +PNG_EXTERN void png_read_filter_row_sub4_neon PNGARG((png_row_infop row_info, + png_bytep row, png_const_bytep prev_row)); +PNG_EXTERN void png_read_filter_row_avg3_neon PNGARG((png_row_infop row_info, + png_bytep row, png_const_bytep prev_row)); +PNG_EXTERN void png_read_filter_row_avg4_neon PNGARG((png_row_infop row_info, + png_bytep row, png_const_bytep prev_row)); +PNG_EXTERN void png_read_filter_row_paeth3_neon PNGARG((png_row_infop row_info, + png_bytep row, png_const_bytep prev_row)); +PNG_EXTERN void png_read_filter_row_paeth4_neon PNGARG((png_row_infop row_info, + png_bytep row, png_const_bytep prev_row)); /* Choose the best filter to use and filter the row data */ PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr, @@ -1058,18 +1218,30 @@ PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr, png_uint_32 length)); #endif +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr, png_infop info_ptr, png_uint_32 length)); +#endif PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr, - png_const_bytep chunk_name)); + png_uint_32 chunk_name)); + +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED +/* Exactly as png_handle_as_unknown() except that the argument is a 32-bit chunk + * name, not a string. + */ +PNG_EXTERN int png_chunk_unknown_handling PNGARG((png_structp png_ptr, + png_uint_32 chunk_name)); +#endif /* Handle the transformations for reading and writing */ #ifdef PNG_READ_TRANSFORMS_SUPPORTED -PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr, + png_row_infop row_info)); #endif #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED -PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr, + png_row_infop row_info)); #endif #ifdef PNG_READ_TRANSFORMS_SUPPORTED @@ -1441,13 +1613,13 @@ PNG_EXTERN png_uint_16 png_gamma_16bit_correct PNGARG((unsigned int value, png_fixed_point gamma_value)); PNG_EXTERN png_byte png_gamma_8bit_correct PNGARG((unsigned int value, png_fixed_point gamma_value)); +PNG_EXTERN void png_destroy_gamma_table(png_structp png_ptr); PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr, int bit_depth)); #endif /* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ - #include "pngdebug.h" #ifdef __cplusplus diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngread.c b/Build/source/libs/libpng/libpng-1.5.7/pngread.c index be3df47693d..0643754dad0 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngread.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngread.c @@ -1,7 +1,7 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.7 [December 15, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -80,8 +80,9 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr, #ifdef PNG_SETJMP_SUPPORTED /* Applications that neglect to set up their own setjmp() and then - encounter a png_error() will longjmp here. Since the jmpbuf is - then meaningless we abort instead of returning. */ + * encounter a png_error() will longjmp here. Since the jmpbuf is + * then meaningless we abort instead of returning. + */ #ifdef USE_FAR_KEYWORD if (setjmp(tmp_jmpbuf)) #else @@ -190,89 +191,35 @@ png_read_info(png_structp png_ptr, png_infop info_ptr) for (;;) { - PNG_IHDR; - PNG_IDAT; - PNG_IEND; - PNG_PLTE; -#ifdef PNG_READ_bKGD_SUPPORTED - PNG_bKGD; -#endif -#ifdef PNG_READ_cHRM_SUPPORTED - PNG_cHRM; -#endif -#ifdef PNG_READ_gAMA_SUPPORTED - PNG_gAMA; -#endif -#ifdef PNG_READ_hIST_SUPPORTED - PNG_hIST; -#endif -#ifdef PNG_READ_iCCP_SUPPORTED - PNG_iCCP; -#endif -#ifdef PNG_READ_iTXt_SUPPORTED - PNG_iTXt; -#endif -#ifdef PNG_READ_oFFs_SUPPORTED - PNG_oFFs; -#endif -#ifdef PNG_READ_pCAL_SUPPORTED - PNG_pCAL; -#endif -#ifdef PNG_READ_pHYs_SUPPORTED - PNG_pHYs; -#endif -#ifdef PNG_READ_sBIT_SUPPORTED - PNG_sBIT; -#endif -#ifdef PNG_READ_sCAL_SUPPORTED - PNG_sCAL; -#endif -#ifdef PNG_READ_sPLT_SUPPORTED - PNG_sPLT; -#endif -#ifdef PNG_READ_sRGB_SUPPORTED - PNG_sRGB; -#endif -#ifdef PNG_READ_tEXt_SUPPORTED - PNG_tEXt; -#endif -#ifdef PNG_READ_tIME_SUPPORTED - PNG_tIME; -#endif -#ifdef PNG_READ_tRNS_SUPPORTED - PNG_tRNS; -#endif -#ifdef PNG_READ_zTXt_SUPPORTED - PNG_zTXt; -#endif png_uint_32 length = png_read_chunk_header(png_ptr); - PNG_CONST png_bytep chunk_name = png_ptr->chunk_name; + png_uint_32 chunk_name = png_ptr->chunk_name; /* This should be a binary subdivision search or a hash for * matching the chunk name rather than a linear search. */ - if (!png_memcmp(chunk_name, png_IDAT, 4)) + if (chunk_name == png_IDAT) if (png_ptr->mode & PNG_AFTER_IDAT) png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT; - if (!png_memcmp(chunk_name, png_IHDR, 4)) + if (chunk_name == png_IHDR) png_handle_IHDR(png_ptr, info_ptr, length); - else if (!png_memcmp(chunk_name, png_IEND, 4)) + else if (chunk_name == png_IEND) png_handle_IEND(png_ptr, info_ptr, length); #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if (png_handle_as_unknown(png_ptr, chunk_name)) + else if (png_chunk_unknown_handling(png_ptr, chunk_name) != + PNG_HANDLE_CHUNK_AS_DEFAULT) { - if (!png_memcmp(chunk_name, png_IDAT, 4)) + if (chunk_name == png_IDAT) png_ptr->mode |= PNG_HAVE_IDAT; png_handle_unknown(png_ptr, info_ptr, length); - if (!png_memcmp(chunk_name, png_PLTE, 4)) + if (chunk_name == png_PLTE) png_ptr->mode |= PNG_HAVE_PLTE; - else if (!png_memcmp(chunk_name, png_IDAT, 4)) + else if (chunk_name == png_IDAT) { if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before IDAT"); @@ -285,10 +232,10 @@ png_read_info(png_structp png_ptr, png_infop info_ptr) } } #endif - else if (!png_memcmp(chunk_name, png_PLTE, 4)) + else if (chunk_name == png_PLTE) png_handle_PLTE(png_ptr, info_ptr, length); - else if (!png_memcmp(chunk_name, png_IDAT, 4)) + else if (chunk_name == png_IDAT) { if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before IDAT"); @@ -303,87 +250,87 @@ png_read_info(png_structp png_ptr, png_infop info_ptr) } #ifdef PNG_READ_bKGD_SUPPORTED - else if (!png_memcmp(chunk_name, png_bKGD, 4)) + else if (chunk_name == png_bKGD) png_handle_bKGD(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_cHRM_SUPPORTED - else if (!png_memcmp(chunk_name, png_cHRM, 4)) + else if (chunk_name == png_cHRM) png_handle_cHRM(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_gAMA_SUPPORTED - else if (!png_memcmp(chunk_name, png_gAMA, 4)) + else if (chunk_name == png_gAMA) png_handle_gAMA(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_hIST_SUPPORTED - else if (!png_memcmp(chunk_name, png_hIST, 4)) + else if (chunk_name == png_hIST) png_handle_hIST(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_oFFs_SUPPORTED - else if (!png_memcmp(chunk_name, png_oFFs, 4)) + else if (chunk_name == png_oFFs) png_handle_oFFs(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_pCAL_SUPPORTED - else if (!png_memcmp(chunk_name, png_pCAL, 4)) + else if (chunk_name == png_pCAL) png_handle_pCAL(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_sCAL_SUPPORTED - else if (!png_memcmp(chunk_name, png_sCAL, 4)) + else if (chunk_name == png_sCAL) png_handle_sCAL(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_pHYs_SUPPORTED - else if (!png_memcmp(chunk_name, png_pHYs, 4)) + else if (chunk_name == png_pHYs) png_handle_pHYs(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_sBIT_SUPPORTED - else if (!png_memcmp(chunk_name, png_sBIT, 4)) + else if (chunk_name == png_sBIT) png_handle_sBIT(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_sRGB_SUPPORTED - else if (!png_memcmp(chunk_name, png_sRGB, 4)) + else if (chunk_name == png_sRGB) png_handle_sRGB(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_iCCP_SUPPORTED - else if (!png_memcmp(chunk_name, png_iCCP, 4)) + else if (chunk_name == png_iCCP) png_handle_iCCP(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_sPLT_SUPPORTED - else if (!png_memcmp(chunk_name, png_sPLT, 4)) + else if (chunk_name == png_sPLT) png_handle_sPLT(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_tEXt_SUPPORTED - else if (!png_memcmp(chunk_name, png_tEXt, 4)) + else if (chunk_name == png_tEXt) png_handle_tEXt(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_tIME_SUPPORTED - else if (!png_memcmp(chunk_name, png_tIME, 4)) + else if (chunk_name == png_tIME) png_handle_tIME(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_tRNS_SUPPORTED - else if (!png_memcmp(chunk_name, png_tRNS, 4)) + else if (chunk_name == png_tRNS) png_handle_tRNS(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_zTXt_SUPPORTED - else if (!png_memcmp(chunk_name, png_zTXt, 4)) + else if (chunk_name == png_zTXt) png_handle_zTXt(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_iTXt_SUPPORTED - else if (!png_memcmp(chunk_name, png_iTXt, 4)) + else if (chunk_name == png_iTXt) png_handle_iTXt(png_ptr, info_ptr, length); #endif @@ -402,13 +349,7 @@ png_read_update_info(png_structp png_ptr, png_infop info_ptr) if (png_ptr == NULL) return; - if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) - png_read_start_row(png_ptr); - - else - png_warning(png_ptr, - "Ignoring extra png_read_update_info() call;" - " row buffer not reallocated"); + png_read_start_row(png_ptr); #ifdef PNG_READ_TRANSFORMS_SUPPORTED png_read_transform_info(png_ptr, info_ptr); @@ -428,15 +369,8 @@ png_start_read_image(png_structp png_ptr) { png_debug(1, "in png_start_read_image"); - if (png_ptr == NULL) - return; - - if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) - png_read_start_row(png_ptr); - else - png_warning(png_ptr, - "Ignoring extra png_start_read_image() call;" - " row buffer not reallocated"); + if (png_ptr != NULL) + png_read_start_row(png_ptr); } #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */ @@ -444,23 +378,30 @@ png_start_read_image(png_structp png_ptr) void PNGAPI png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) { - PNG_IDAT; -#ifdef PNG_READ_INTERLACING_SUPPORTED - PNG_CONST int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, - 0xff}; - PNG_CONST int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; -#endif int ret; + png_row_info row_info; + if (png_ptr == NULL) return; png_debug2(1, "in png_read_row (row %lu, pass %d)", (unsigned long)png_ptr->row_number, png_ptr->pass); + /* png_read_start_row sets the information (in particular iwidth) for this + * interlace pass. + */ if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) png_read_start_row(png_ptr); + /* 1.5.6: row_info moved out of png_struct to a local here. */ + row_info.width = png_ptr->iwidth; /* NOTE: width of current interlaced row */ + row_info.color_type = png_ptr->color_type; + row_info.bit_depth = png_ptr->bit_depth; + row_info.channels = png_ptr->channels; + row_info.pixel_depth = png_ptr->pixel_depth; + row_info.rowbytes = PNG_ROWBYTES(row_info.pixel_depth, row_info.width); + if (png_ptr->row_number == 0 && png_ptr->pass == 0) { /* Check for transforms that have been set but were defined out */ @@ -502,7 +443,12 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) } #ifdef PNG_READ_INTERLACING_SUPPORTED - /* If interlaced and we do not need a new row, combine row and return */ + /* If interlaced and we do not need a new row, combine row and return. + * Notice that the pixels we have from previous rows have been transformed + * already; we can only combine like with like (transformed or + * untransformed) and, because of the libpng API for interlaced images, this + * means we must transform before de-interlacing. + */ if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE)) { switch (png_ptr->pass) @@ -511,8 +457,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) if (png_ptr->row_number & 0x07) { if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); + png_combine_row(png_ptr, dsp_row, 1/*display*/); png_read_finish_row(png_ptr); return; } @@ -522,8 +467,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) if ((png_ptr->row_number & 0x07) || png_ptr->width < 5) { if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); + png_combine_row(png_ptr, dsp_row, 1/*display*/); png_read_finish_row(png_ptr); return; @@ -534,8 +478,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) if ((png_ptr->row_number & 0x07) != 4) { if (dsp_row != NULL && (png_ptr->row_number & 4)) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); + png_combine_row(png_ptr, dsp_row, 1/*display*/); png_read_finish_row(png_ptr); return; @@ -546,8 +489,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) if ((png_ptr->row_number & 3) || png_ptr->width < 3) { if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); + png_combine_row(png_ptr, dsp_row, 1/*display*/); png_read_finish_row(png_ptr); return; @@ -558,8 +500,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) if ((png_ptr->row_number & 3) != 2) { if (dsp_row != NULL && (png_ptr->row_number & 2)) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); + png_combine_row(png_ptr, dsp_row, 1/*display*/); png_read_finish_row(png_ptr); return; @@ -569,8 +510,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) if ((png_ptr->row_number & 1) || png_ptr->width < 2) { if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); + png_combine_row(png_ptr, dsp_row, 1/*display*/); png_read_finish_row(png_ptr); return; @@ -606,7 +546,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) png_crc_finish(png_ptr, 0); png_ptr->idat_size = png_read_chunk_header(png_ptr); - if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) + if (png_ptr->chunk_name != png_IDAT) png_error(png_ptr, "Not enough image data"); } png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size; @@ -636,63 +576,72 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) } while (png_ptr->zstream.avail_out); - png_ptr->row_info.color_type = png_ptr->color_type; - png_ptr->row_info.width = png_ptr->iwidth; - png_ptr->row_info.channels = png_ptr->channels; - png_ptr->row_info.bit_depth = png_ptr->bit_depth; - png_ptr->row_info.pixel_depth = png_ptr->pixel_depth; - png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->row_info.width); - - if (png_ptr->row_buf[0]) - png_read_filter_row(png_ptr, &(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->prev_row + 1, - (int)(png_ptr->row_buf[0])); + if (png_ptr->row_buf[0] > PNG_FILTER_VALUE_NONE) + { + if (png_ptr->row_buf[0] < PNG_FILTER_VALUE_LAST) + png_read_filter_row(png_ptr, &row_info, png_ptr->row_buf + 1, + png_ptr->prev_row + 1, png_ptr->row_buf[0]); + else + png_error(png_ptr, "bad adaptive filter value"); + } - png_memcpy(png_ptr->prev_row, png_ptr->row_buf, png_ptr->rowbytes + 1); + /* libpng 1.5.6: the following line was copying png_ptr->rowbytes before + * 1.5.6, while the buffer really is this big in current versions of libpng + * it may not be in the future, so this was changed just to copy the + * interlaced count: + */ + png_memcpy(png_ptr->prev_row, png_ptr->row_buf, row_info.rowbytes + 1); #ifdef PNG_MNG_FEATURES_SUPPORTED if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING)) { /* Intrapixel differencing */ - png_do_read_intrapixel(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_read_intrapixel(&row_info, png_ptr->row_buf + 1); } #endif #ifdef PNG_READ_TRANSFORMS_SUPPORTED if (png_ptr->transformations) - png_do_read_transformations(png_ptr); + png_do_read_transformations(png_ptr, &row_info); #endif + /* The transformed pixel depth should match the depth now in row_info. */ + if (png_ptr->transformed_pixel_depth == 0) + { + png_ptr->transformed_pixel_depth = row_info.pixel_depth; + if (row_info.pixel_depth > png_ptr->maximum_pixel_depth) + png_error(png_ptr, "sequential row overflow"); + } + + else if (png_ptr->transformed_pixel_depth != row_info.pixel_depth) + png_error(png_ptr, "internal sequential row size calculation error"); + #ifdef PNG_READ_INTERLACING_SUPPORTED /* Blow up interlaced rows to full size */ if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE)) { if (png_ptr->pass < 6) - /* Old interface (pre-1.0.9): - * png_do_read_interlace(&(png_ptr->row_info), - * png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations); - */ - png_do_read_interlace(png_ptr); + png_do_read_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass, + png_ptr->transformations); if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, png_pass_dsp_mask[png_ptr->pass]); + png_combine_row(png_ptr, dsp_row, 1/*display*/); if (row != NULL) - png_combine_row(png_ptr, row, png_pass_mask[png_ptr->pass]); + png_combine_row(png_ptr, row, 0/*row*/); } else #endif { if (row != NULL) - png_combine_row(png_ptr, row, 0xff); + png_combine_row(png_ptr, row, -1/*ignored*/); if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, 0xff); + png_combine_row(png_ptr, dsp_row, -1/*ignored*/); } png_read_finish_row(png_ptr); @@ -858,85 +807,31 @@ png_read_end(png_structp png_ptr, png_infop info_ptr) do { - PNG_IHDR; - PNG_IDAT; - PNG_IEND; - PNG_PLTE; -#ifdef PNG_READ_bKGD_SUPPORTED - PNG_bKGD; -#endif -#ifdef PNG_READ_cHRM_SUPPORTED - PNG_cHRM; -#endif -#ifdef PNG_READ_gAMA_SUPPORTED - PNG_gAMA; -#endif -#ifdef PNG_READ_hIST_SUPPORTED - PNG_hIST; -#endif -#ifdef PNG_READ_iCCP_SUPPORTED - PNG_iCCP; -#endif -#ifdef PNG_READ_iTXt_SUPPORTED - PNG_iTXt; -#endif -#ifdef PNG_READ_oFFs_SUPPORTED - PNG_oFFs; -#endif -#ifdef PNG_READ_pCAL_SUPPORTED - PNG_pCAL; -#endif -#ifdef PNG_READ_pHYs_SUPPORTED - PNG_pHYs; -#endif -#ifdef PNG_READ_sBIT_SUPPORTED - PNG_sBIT; -#endif -#ifdef PNG_READ_sCAL_SUPPORTED - PNG_sCAL; -#endif -#ifdef PNG_READ_sPLT_SUPPORTED - PNG_sPLT; -#endif -#ifdef PNG_READ_sRGB_SUPPORTED - PNG_sRGB; -#endif -#ifdef PNG_READ_tEXt_SUPPORTED - PNG_tEXt; -#endif -#ifdef PNG_READ_tIME_SUPPORTED - PNG_tIME; -#endif -#ifdef PNG_READ_tRNS_SUPPORTED - PNG_tRNS; -#endif -#ifdef PNG_READ_zTXt_SUPPORTED - PNG_zTXt; -#endif png_uint_32 length = png_read_chunk_header(png_ptr); - PNG_CONST png_bytep chunk_name = png_ptr->chunk_name; + png_uint_32 chunk_name = png_ptr->chunk_name; - if (!png_memcmp(chunk_name, png_IHDR, 4)) + if (chunk_name == png_IHDR) png_handle_IHDR(png_ptr, info_ptr, length); - else if (!png_memcmp(chunk_name, png_IEND, 4)) + else if (chunk_name == png_IEND) png_handle_IEND(png_ptr, info_ptr, length); #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if (png_handle_as_unknown(png_ptr, chunk_name)) + else if (png_chunk_unknown_handling(png_ptr, chunk_name) != + PNG_HANDLE_CHUNK_AS_DEFAULT) { - if (!png_memcmp(chunk_name, png_IDAT, 4)) + if (chunk_name == png_IDAT) { if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT)) png_benign_error(png_ptr, "Too many IDATs found"); } png_handle_unknown(png_ptr, info_ptr, length); - if (!png_memcmp(chunk_name, png_PLTE, 4)) + if (chunk_name == png_PLTE) png_ptr->mode |= PNG_HAVE_PLTE; } #endif - else if (!png_memcmp(chunk_name, png_IDAT, 4)) + else if (chunk_name == png_IDAT) { /* Zero length IDATs are legal after the last IDAT has been * read, but not after other chunks have been read. @@ -946,91 +841,91 @@ png_read_end(png_structp png_ptr, png_infop info_ptr) png_crc_finish(png_ptr, length); } - else if (!png_memcmp(chunk_name, png_PLTE, 4)) + else if (chunk_name == png_PLTE) png_handle_PLTE(png_ptr, info_ptr, length); #ifdef PNG_READ_bKGD_SUPPORTED - else if (!png_memcmp(chunk_name, png_bKGD, 4)) + else if (chunk_name == png_bKGD) png_handle_bKGD(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_cHRM_SUPPORTED - else if (!png_memcmp(chunk_name, png_cHRM, 4)) + else if (chunk_name == png_cHRM) png_handle_cHRM(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_gAMA_SUPPORTED - else if (!png_memcmp(chunk_name, png_gAMA, 4)) + else if (chunk_name == png_gAMA) png_handle_gAMA(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_hIST_SUPPORTED - else if (!png_memcmp(chunk_name, png_hIST, 4)) + else if (chunk_name == png_hIST) png_handle_hIST(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_oFFs_SUPPORTED - else if (!png_memcmp(chunk_name, png_oFFs, 4)) + else if (chunk_name == png_oFFs) png_handle_oFFs(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_pCAL_SUPPORTED - else if (!png_memcmp(chunk_name, png_pCAL, 4)) + else if (chunk_name == png_pCAL) png_handle_pCAL(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_sCAL_SUPPORTED - else if (!png_memcmp(chunk_name, png_sCAL, 4)) + else if (chunk_name == png_sCAL) png_handle_sCAL(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_pHYs_SUPPORTED - else if (!png_memcmp(chunk_name, png_pHYs, 4)) + else if (chunk_name == png_pHYs) png_handle_pHYs(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_sBIT_SUPPORTED - else if (!png_memcmp(chunk_name, png_sBIT, 4)) + else if (chunk_name == png_sBIT) png_handle_sBIT(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_sRGB_SUPPORTED - else if (!png_memcmp(chunk_name, png_sRGB, 4)) + else if (chunk_name == png_sRGB) png_handle_sRGB(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_iCCP_SUPPORTED - else if (!png_memcmp(chunk_name, png_iCCP, 4)) + else if (chunk_name == png_iCCP) png_handle_iCCP(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_sPLT_SUPPORTED - else if (!png_memcmp(chunk_name, png_sPLT, 4)) + else if (chunk_name == png_sPLT) png_handle_sPLT(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_tEXt_SUPPORTED - else if (!png_memcmp(chunk_name, png_tEXt, 4)) + else if (chunk_name == png_tEXt) png_handle_tEXt(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_tIME_SUPPORTED - else if (!png_memcmp(chunk_name, png_tIME, 4)) + else if (chunk_name == png_tIME) png_handle_tIME(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_tRNS_SUPPORTED - else if (!png_memcmp(chunk_name, png_tRNS, 4)) + else if (chunk_name == png_tRNS) png_handle_tRNS(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_zTXt_SUPPORTED - else if (!png_memcmp(chunk_name, png_zTXt, 4)) + else if (chunk_name == png_zTXt) png_handle_zTXt(png_ptr, info_ptr, length); #endif #ifdef PNG_READ_iTXt_SUPPORTED - else if (!png_memcmp(chunk_name, png_iTXt, 4)) + else if (chunk_name == png_iTXt) png_handle_iTXt(png_ptr, info_ptr, length); #endif @@ -1138,9 +1033,13 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, if (end_info_ptr != NULL) png_info_destroy(png_ptr, end_info_ptr); +#ifdef PNG_READ_GAMMA_SUPPORTED + png_destroy_gamma_table(png_ptr); +#endif + png_free(png_ptr, png_ptr->zbuf); png_free(png_ptr, png_ptr->big_row_buf); - png_free(png_ptr, png_ptr->prev_row); + png_free(png_ptr, png_ptr->big_prev_row); png_free(png_ptr, png_ptr->chunkdata); #ifdef PNG_READ_QUANTIZE_SUPPORTED @@ -1148,15 +1047,6 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_free(png_ptr, png_ptr->quantize_index); #endif -#ifdef PNG_READ_GAMMA_SUPPORTED - png_free(png_ptr, png_ptr->gamma_table); -#endif - -#ifdef PNG_READ_BACKGROUND_SUPPORTED - png_free(png_ptr, png_ptr->gamma_from_1); - png_free(png_ptr, png_ptr->gamma_to_1); -#endif - if (png_ptr->free_me & PNG_FREE_PLTE) png_zfree(png_ptr, png_ptr->palette); png_ptr->free_me &= ~PNG_FREE_PLTE; @@ -1174,42 +1064,6 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_ptr->free_me &= ~PNG_FREE_HIST; #endif -#ifdef PNG_READ_GAMMA_SUPPORTED - if (png_ptr->gamma_16_table != NULL) - { - int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); - for (i = 0; i < istop; i++) - { - png_free(png_ptr, png_ptr->gamma_16_table[i]); - } - png_free(png_ptr, png_ptr->gamma_16_table); - } - -#ifdef PNG_READ_BACKGROUND_SUPPORTED - if (png_ptr->gamma_16_from_1 != NULL) - { - int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); - for (i = 0; i < istop; i++) - { - png_free(png_ptr, png_ptr->gamma_16_from_1[i]); - } - png_free(png_ptr, png_ptr->gamma_16_from_1); - } - if (png_ptr->gamma_16_to_1 != NULL) - { - int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); - for (i = 0; i < istop; i++) - { - png_free(png_ptr, png_ptr->gamma_16_to_1[i]); - } - png_free(png_ptr, png_ptr->gamma_16_to_1); - } -#endif -#endif - inflateEnd(&png_ptr->zstream); #ifdef PNG_PROGRESSIVE_READ_SUPPORTED diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngrio.c b/Build/source/libs/libpng/libpng-1.5.7/pngrio.c index e9c381c5ba4..e9c381c5ba4 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngrio.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngrio.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngrtran.c b/Build/source/libs/libpng/libpng-1.5.7/pngrtran.c index f8847902340..1079595f0af 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngrtran.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngrtran.c @@ -1,7 +1,7 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.5.5 [September 22, 2011] + * Last changed in libpng 1.5.7 [December 15, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -936,15 +936,15 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action, switch(error_action) { - case 1: + case PNG_ERROR_ACTION_NONE: png_ptr->transformations |= PNG_RGB_TO_GRAY; break; - case 2: + case PNG_ERROR_ACTION_WARN: png_ptr->transformations |= PNG_RGB_TO_GRAY_WARN; break; - case 3: + case PNG_ERROR_ACTION_ERROR: png_ptr->transformations |= PNG_RGB_TO_GRAY_ERR; break; @@ -1198,53 +1198,44 @@ png_init_rgb_transformations(png_structp png_ptr) { { /* Expand background and tRNS chunks */ + int gray = png_ptr->background.gray; + int trans_gray = png_ptr->trans_color.gray; + 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_color.gray *= (png_uint_16)0xff; - png_ptr->trans_color.red = png_ptr->trans_color.green - = png_ptr->trans_color.blue = png_ptr->trans_color.gray; - } + gray *= 0xff; + trans_gray *= 0xff; 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_color.gray *= (png_uint_16)0x55; - png_ptr->trans_color.red = png_ptr->trans_color.green - = png_ptr->trans_color.blue = png_ptr->trans_color.gray; - } + gray *= 0x55; + trans_gray *= 0x55; 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_color.gray *= (png_uint_16)0x11; - png_ptr->trans_color.red = png_ptr->trans_color.green - = png_ptr->trans_color.blue = png_ptr->trans_color.gray; - } + gray *= 0x11; + trans_gray *= 0x11; break; default: case 8: + /* Already 8 bits, fall through */ case 16: - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; + /* Already a full 16 bits */ break; } + + png_ptr->background.red = png_ptr->background.green = + png_ptr->background.blue = (png_uint_16)gray; + + if (!(png_ptr->transformations & PNG_EXPAND_tRNS)) + { + png_ptr->trans_color.red = png_ptr->trans_color.green = + png_ptr->trans_color.blue = (png_uint_16)trans_gray; + } } } /* background expand and (therefore) no alpha association. */ #endif /* PNG_READ_EXPAND_SUPPORTED && PNG_READ_BACKGROUND_SUPPORTED */ @@ -1474,6 +1465,28 @@ png_init_read_transformations(png_structp png_ptr) } #endif /* PNG_READ_BACKGROUND_SUPPORTED && PNG_READ_EXPAND_16_SUPPORTED */ +#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \ + (defined(PNG_READ_SCALE_16_TO_8_SUPPORTED) || \ + defined(PNG_READ_STRIP_16_TO_8_SUPPORTED)) + if ((png_ptr->transformations & (PNG_16_TO_8|PNG_SCALE_16_TO_8)) && + (png_ptr->transformations & PNG_COMPOSE) && + !(png_ptr->transformations & PNG_BACKGROUND_EXPAND) && + png_ptr->bit_depth == 16) + { + /* On the other hand, if a 16-bit file is to be reduced to 8-bits per + * component this will also happen after PNG_COMPOSE and so the background + * color must be pre-expanded here. + * + * TODO: fix this too. + */ + png_ptr->background.red = (png_uint_16)(png_ptr->background.red * 257); + png_ptr->background.green = + (png_uint_16)(png_ptr->background.green * 257); + png_ptr->background.blue = (png_uint_16)(png_ptr->background.blue * 257); + png_ptr->background.gray = (png_uint_16)(png_ptr->background.gray * 257); + } +#endif + /* NOTE: below 'PNG_READ_ALPHA_MODE_SUPPORTED' is presumed to also enable the * background support (see the comments in scripts/pnglibconf.dfa), this * allows pre-multiplication of the alpha channel to be implemented as @@ -1521,6 +1534,16 @@ png_init_read_transformations(png_structp png_ptr) #ifdef PNG_READ_BACKGROUND_SUPPORTED if (png_ptr->transformations & PNG_COMPOSE) { + /* Issue a warning about this combination: because RGB_TO_GRAY is + * optimized to do the gamma transform if present yet do_background has + * to do the same thing if both options are set a + * double-gamma-correction happens. This is true in all versions of + * libpng to date. + */ + if (png_ptr->transformations & PNG_RGB_TO_GRAY) + png_warning(png_ptr, + "libpng does not support gamma+background+rgb_to_gray"); + if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { /* We don't get to here unless there is a tRNS chunk with non-opaque @@ -1650,8 +1673,9 @@ png_init_read_transformations(png_structp png_ptr) /* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN) */ else /* color_type != PNG_COLOR_TYPE_PALETTE */ { - png_fixed_point g = PNG_FP_1; - png_fixed_point gs = PNG_FP_1; + int gs_sig, g_sig; + png_fixed_point g = PNG_FP_1; /* Correction to linear */ + png_fixed_point gs = PNG_FP_1; /* Correction to screen */ switch (png_ptr->background_gamma_type) { @@ -1675,34 +1699,45 @@ png_init_read_transformations(png_structp png_ptr) png_error(png_ptr, "invalid background gamma type"); } - png_ptr->background_1.gray = png_gamma_correct(png_ptr, - png_ptr->background.gray, g); + g_sig = png_gamma_significant(g); + gs_sig = png_gamma_significant(gs); - png_ptr->background.gray = png_gamma_correct(png_ptr, - png_ptr->background.gray, gs); + if (g_sig) + png_ptr->background_1.gray = png_gamma_correct(png_ptr, + png_ptr->background.gray, g); + + if (gs_sig) + png_ptr->background.gray = png_gamma_correct(png_ptr, + png_ptr->background.gray, gs); if ((png_ptr->background.red != png_ptr->background.green) || (png_ptr->background.red != png_ptr->background.blue) || (png_ptr->background.red != png_ptr->background.gray)) { /* RGB or RGBA with color background */ - png_ptr->background_1.red = png_gamma_correct(png_ptr, - png_ptr->background.red, g); + if (g_sig) + { + png_ptr->background_1.red = png_gamma_correct(png_ptr, + png_ptr->background.red, g); - png_ptr->background_1.green = png_gamma_correct(png_ptr, - png_ptr->background.green, g); + png_ptr->background_1.green = png_gamma_correct(png_ptr, + png_ptr->background.green, g); - png_ptr->background_1.blue = png_gamma_correct(png_ptr, - png_ptr->background.blue, g); + png_ptr->background_1.blue = png_gamma_correct(png_ptr, + png_ptr->background.blue, g); + } - png_ptr->background.red = png_gamma_correct(png_ptr, - png_ptr->background.red, gs); + if (gs_sig) + { + png_ptr->background.red = png_gamma_correct(png_ptr, + png_ptr->background.red, gs); - png_ptr->background.green = png_gamma_correct(png_ptr, - png_ptr->background.green, gs); + png_ptr->background.green = png_gamma_correct(png_ptr, + png_ptr->background.green, gs); - png_ptr->background.blue = png_gamma_correct(png_ptr, - png_ptr->background.blue, gs); + png_ptr->background.blue = png_gamma_correct(png_ptr, + png_ptr->background.blue, gs); + } } else @@ -1714,13 +1749,22 @@ png_init_read_transformations(png_structp png_ptr) png_ptr->background.red = png_ptr->background.green = png_ptr->background.blue = png_ptr->background.gray; } + + /* The background is now in screen gamma: */ + png_ptr->background_gamma_type = PNG_BACKGROUND_GAMMA_SCREEN; } /* color_type != PNG_COLOR_TYPE_PALETTE */ }/* png_ptr->transformations & PNG_BACKGROUND */ else /* Transformation does not include PNG_BACKGROUND */ #endif /* PNG_READ_BACKGROUND_SUPPORTED */ - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE +#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED + /* RGB_TO_GRAY needs to have non-gamma-corrected values! */ + && ((png_ptr->transformations & PNG_EXPAND) == 0 || + (png_ptr->transformations & PNG_RGB_TO_GRAY) == 0) +#endif + ) { png_colorp palette = png_ptr->palette; int num_palette = png_ptr->num_palette; @@ -1788,26 +1832,38 @@ png_init_read_transformations(png_structp png_ptr) if ((png_ptr->transformations & PNG_SHIFT) && (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)) { - png_uint_16 i; - png_uint_16 istop = png_ptr->num_palette; - int sr = 8 - png_ptr->sig_bit.red; - int sg = 8 - png_ptr->sig_bit.green; - int sb = 8 - png_ptr->sig_bit.blue; + int i; + int istop = png_ptr->num_palette; + int shift = 8 - png_ptr->sig_bit.red; + + /* significant bits can be in the range 1 to 7 for a meaninful result, if + * the number of significant bits is 0 then no shift is done (this is an + * error condition which is silently ignored.) + */ + if (shift > 0 && shift < 8) for (i=0; i<istop; ++i) + { + int component = png_ptr->palette[i].red; - if (sr < 0 || sr > 8) - sr = 0; + component >>= shift; + png_ptr->palette[i].red = (png_byte)component; + } - if (sg < 0 || sg > 8) - sg = 0; + shift = 8 - png_ptr->sig_bit.green; + if (shift > 0 && shift < 8) for (i=0; i<istop; ++i) + { + int component = png_ptr->palette[i].green; - if (sb < 0 || sb > 8) - sb = 0; + component >>= shift; + png_ptr->palette[i].green = (png_byte)component; + } - for (i = 0; i < istop; i++) + shift = 8 - png_ptr->sig_bit.blue; + if (shift > 0 && shift < 8) for (i=0; i<istop; ++i) { - png_ptr->palette[i].red >>= sr; - png_ptr->palette[i].green >>= sg; - png_ptr->palette[i].blue >>= sb; + int component = png_ptr->palette[i].blue; + + component >>= shift; + png_ptr->palette[i].blue = (png_byte)component; } } #endif /* PNG_READ_SHIFT_SUPPORTED */ @@ -1900,7 +1956,7 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr) info_ptr->bit_depth = 8; # else -# if PNG_READ_SCALE_16_TO_8_SUPPORTED +# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED png_ptr->transformations |= PNG_SCALE_16_TO_8; info_ptr->bit_depth = 8; # else @@ -1913,12 +1969,14 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr) #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED if (png_ptr->transformations & PNG_GRAY_TO_RGB) - info_ptr->color_type |= PNG_COLOR_MASK_COLOR; + info_ptr->color_type = (png_byte)(info_ptr->color_type | + PNG_COLOR_MASK_COLOR); #endif #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED if (png_ptr->transformations & PNG_RGB_TO_GRAY) - info_ptr->color_type &= ~PNG_COLOR_MASK_COLOR; + info_ptr->color_type = (png_byte)(info_ptr->color_type & + ~PNG_COLOR_MASK_COLOR); #endif #ifdef PNG_READ_QUANTIZE_SUPPORTED @@ -1958,7 +2016,8 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr) #ifdef PNG_READ_STRIP_ALPHA_SUPPORTED if (png_ptr->transformations & PNG_STRIP_ALPHA) { - info_ptr->color_type &= ~PNG_COLOR_MASK_ALPHA; + info_ptr->color_type = (png_byte)(info_ptr->color_type & + ~PNG_COLOR_MASK_ALPHA); info_ptr->num_trans = 0; } #endif @@ -2015,7 +2074,7 @@ defined(PNG_READ_USER_TRANSFORM_SUPPORTED) * decide how it fits in with the other transformations here. */ void /* PRIVATE */ -png_do_read_transformations(png_structp png_ptr) +png_do_read_transformations(png_structp png_ptr, png_row_infop row_info) { png_debug(1, "in png_do_read_transformations"); @@ -2046,9 +2105,9 @@ png_do_read_transformations(png_structp png_ptr) #ifdef PNG_READ_EXPAND_SUPPORTED if (png_ptr->transformations & PNG_EXPAND) { - if (png_ptr->row_info.color_type == PNG_COLOR_TYPE_PALETTE) + if (row_info->color_type == PNG_COLOR_TYPE_PALETTE) { - png_do_expand_palette(&(png_ptr->row_info), png_ptr->row_buf + 1, + png_do_expand_palette(row_info, png_ptr->row_buf + 1, png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans); } @@ -2056,11 +2115,11 @@ png_do_read_transformations(png_structp png_ptr) { if (png_ptr->num_trans && (png_ptr->transformations & PNG_EXPAND_tRNS)) - png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1, + png_do_expand(row_info, png_ptr->row_buf + 1, &(png_ptr->trans_color)); else - png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1, + png_do_expand(row_info, png_ptr->row_buf + 1, NULL); } } @@ -2069,9 +2128,9 @@ png_do_read_transformations(png_structp png_ptr) #ifdef PNG_READ_STRIP_ALPHA_SUPPORTED if ((png_ptr->transformations & PNG_STRIP_ALPHA) && !(png_ptr->transformations & PNG_COMPOSE) && - (png_ptr->row_info.color_type == PNG_COLOR_TYPE_RGB_ALPHA || - png_ptr->row_info.color_type == PNG_COLOR_TYPE_GRAY_ALPHA)) - png_do_strip_channel(&(png_ptr->row_info), png_ptr->row_buf + 1, + (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA || + row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)) + png_do_strip_channel(row_info, png_ptr->row_buf + 1, 0 /* at_start == false, because SWAP_ALPHA happens later */); #endif @@ -2079,7 +2138,7 @@ png_do_read_transformations(png_structp png_ptr) if (png_ptr->transformations & PNG_RGB_TO_GRAY) { int rgb_error = - png_do_rgb_to_gray(png_ptr, &(png_ptr->row_info), + png_do_rgb_to_gray(png_ptr, row_info, png_ptr->row_buf + 1); if (rgb_error) @@ -2133,45 +2192,55 @@ png_do_read_transformations(png_structp png_ptr) */ if ((png_ptr->transformations & PNG_GRAY_TO_RGB) && !(png_ptr->mode & PNG_BACKGROUND_IS_GRAY)) - png_do_gray_to_rgb(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1); #endif #if (defined PNG_READ_BACKGROUND_SUPPORTED) ||\ (defined PNG_READ_ALPHA_MODE_SUPPORTED) if (png_ptr->transformations & PNG_COMPOSE) - png_do_compose(&(png_ptr->row_info), png_ptr->row_buf + 1, png_ptr); + png_do_compose(row_info, png_ptr->row_buf + 1, png_ptr); #endif #ifdef PNG_READ_GAMMA_SUPPORTED if ((png_ptr->transformations & PNG_GAMMA) && +#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED + /* Because RGB_TO_GRAY does the gamma transform. */ + !(png_ptr->transformations & PNG_RGB_TO_GRAY) && +#endif #if (defined PNG_READ_BACKGROUND_SUPPORTED) ||\ (defined PNG_READ_ALPHA_MODE_SUPPORTED) + /* Because PNG_COMPOSE does the gamma transform if there is something to + * do (if there is an alpha channel or transparency.) + */ !((png_ptr->transformations & PNG_COMPOSE) && ((png_ptr->num_trans != 0) || (png_ptr->color_type & PNG_COLOR_MASK_ALPHA))) && #endif + /* Because png_init_read_transformations transforms the palette, unless + * RGB_TO_GRAY will do the transform. + */ (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)) - png_do_gamma(&(png_ptr->row_info), png_ptr->row_buf + 1, png_ptr); + png_do_gamma(row_info, png_ptr->row_buf + 1, png_ptr); #endif #ifdef PNG_READ_STRIP_ALPHA_SUPPORTED if ((png_ptr->transformations & PNG_STRIP_ALPHA) && (png_ptr->transformations & PNG_COMPOSE) && - (png_ptr->row_info.color_type == PNG_COLOR_TYPE_RGB_ALPHA || - png_ptr->row_info.color_type == PNG_COLOR_TYPE_GRAY_ALPHA)) - png_do_strip_channel(&(png_ptr->row_info), png_ptr->row_buf + 1, + (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA || + row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)) + png_do_strip_channel(row_info, png_ptr->row_buf + 1, 0 /* at_start == false, because SWAP_ALPHA happens later */); #endif #ifdef PNG_READ_ALPHA_MODE_SUPPORTED if ((png_ptr->transformations & PNG_ENCODE_ALPHA) && - (png_ptr->row_info.color_type & PNG_COLOR_MASK_ALPHA)) - png_do_encode_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1, png_ptr); + (row_info->color_type & PNG_COLOR_MASK_ALPHA)) + png_do_encode_alpha(row_info, png_ptr->row_buf + 1, png_ptr); #endif #ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED if (png_ptr->transformations & PNG_SCALE_16_TO_8) - png_do_scale_16_to_8(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_scale_16_to_8(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED @@ -2180,16 +2249,16 @@ png_do_read_transformations(png_structp png_ptr) * calling the API or in a TRANSFORM flag) this is what happens. */ if (png_ptr->transformations & PNG_16_TO_8) - png_do_chop(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_chop(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_READ_QUANTIZE_SUPPORTED if (png_ptr->transformations & PNG_QUANTIZE) { - png_do_quantize(&(png_ptr->row_info), png_ptr->row_buf + 1, + png_do_quantize(row_info, png_ptr->row_buf + 1, png_ptr->palette_lookup, png_ptr->quantize_index); - if (png_ptr->row_info.rowbytes == 0) + if (row_info->rowbytes == 0) png_error(png_ptr, "png_do_quantize returned rowbytes=0"); } #endif /* PNG_READ_QUANTIZE_SUPPORTED */ @@ -2201,62 +2270,62 @@ png_do_read_transformations(png_structp png_ptr) * better accuracy results faster!) */ if (png_ptr->transformations & PNG_EXPAND_16) - png_do_expand_16(&png_ptr->row_info, png_ptr->row_buf + 1); + png_do_expand_16(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED /*NOTE: moved here in 1.5.4 (from much later in this list.) */ if ((png_ptr->transformations & PNG_GRAY_TO_RGB) && (png_ptr->mode & PNG_BACKGROUND_IS_GRAY)) - png_do_gray_to_rgb(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_READ_INVERT_SUPPORTED if (png_ptr->transformations & PNG_INVERT_MONO) - png_do_invert(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_invert(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_READ_SHIFT_SUPPORTED if (png_ptr->transformations & PNG_SHIFT) - png_do_unshift(&(png_ptr->row_info), png_ptr->row_buf + 1, + png_do_unshift(row_info, png_ptr->row_buf + 1, &(png_ptr->shift)); #endif #ifdef PNG_READ_PACK_SUPPORTED if (png_ptr->transformations & PNG_PACK) - png_do_unpack(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_unpack(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_READ_BGR_SUPPORTED if (png_ptr->transformations & PNG_BGR) - png_do_bgr(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_bgr(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_READ_PACKSWAP_SUPPORTED if (png_ptr->transformations & PNG_PACKSWAP) - png_do_packswap(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_packswap(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_READ_FILLER_SUPPORTED if (png_ptr->transformations & PNG_FILLER) - png_do_read_filler(&(png_ptr->row_info), png_ptr->row_buf + 1, + png_do_read_filler(row_info, png_ptr->row_buf + 1, (png_uint_32)png_ptr->filler, png_ptr->flags); #endif #ifdef PNG_READ_INVERT_ALPHA_SUPPORTED if (png_ptr->transformations & PNG_INVERT_ALPHA) - png_do_read_invert_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_read_invert_alpha(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_READ_SWAP_ALPHA_SUPPORTED if (png_ptr->transformations & PNG_SWAP_ALPHA) - png_do_read_swap_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_read_swap_alpha(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_READ_16BIT_SUPPORTED #ifdef PNG_READ_SWAP_SUPPORTED if (png_ptr->transformations & PNG_SWAP_BYTES) - png_do_swap(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_swap(row_info, png_ptr->row_buf + 1); #endif #endif @@ -2265,8 +2334,8 @@ png_do_read_transformations(png_structp png_ptr) { if (png_ptr->read_user_transform_fn != NULL) (*(png_ptr->read_user_transform_fn)) /* User read transform function */ - (png_ptr, /* png_ptr */ - &(png_ptr->row_info), /* row_info: */ + (png_ptr, /* png_ptr */ + row_info, /* row_info: */ /* png_uint_32 width; width of row */ /* png_size_t rowbytes; number of bytes in row */ /* png_byte color_type; color type of pixels */ @@ -2276,16 +2345,15 @@ png_do_read_transformations(png_structp png_ptr) png_ptr->row_buf + 1); /* start of pixel data for row */ #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED if (png_ptr->user_transform_depth) - png_ptr->row_info.bit_depth = png_ptr->user_transform_depth; + row_info->bit_depth = png_ptr->user_transform_depth; if (png_ptr->user_transform_channels) - png_ptr->row_info.channels = png_ptr->user_transform_channels; + row_info->channels = png_ptr->user_transform_channels; #endif - png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth * - png_ptr->row_info.channels); + row_info->pixel_depth = (png_byte)(row_info->bit_depth * + row_info->channels); - png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->row_info.width); + row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_info->width); } #endif } @@ -2399,105 +2467,128 @@ void /* PRIVATE */ png_do_unshift(png_row_infop row_info, png_bytep row, png_const_color_8p sig_bits) { + int color_type; + png_debug(1, "in png_do_unshift"); - if ( - row_info->color_type != PNG_COLOR_TYPE_PALETTE) + /* The palette case has already been handled in the _init routine. */ + color_type = row_info->color_type; + + if (color_type != PNG_COLOR_TYPE_PALETTE) { int shift[4]; int channels = 0; - int c; - png_uint_16 value = 0; - png_uint_32 row_width = row_info->width; + int bit_depth = row_info->bit_depth; - if (row_info->color_type & PNG_COLOR_MASK_COLOR) + if (color_type & PNG_COLOR_MASK_COLOR) { - shift[channels++] = row_info->bit_depth - sig_bits->red; - shift[channels++] = row_info->bit_depth - sig_bits->green; - shift[channels++] = row_info->bit_depth - sig_bits->blue; + shift[channels++] = bit_depth - sig_bits->red; + shift[channels++] = bit_depth - sig_bits->green; + shift[channels++] = bit_depth - sig_bits->blue; } else { - shift[channels++] = row_info->bit_depth - sig_bits->gray; + shift[channels++] = bit_depth - sig_bits->gray; } - if (row_info->color_type & PNG_COLOR_MASK_ALPHA) + if (color_type & PNG_COLOR_MASK_ALPHA) { - shift[channels++] = row_info->bit_depth - sig_bits->alpha; + shift[channels++] = bit_depth - sig_bits->alpha; } - for (c = 0; c < channels; c++) { - if (shift[c] <= 0) - shift[c] = 0; + int c, have_shift; - else - value = 1; - } + for (c = have_shift = 0; c < channels; ++c) + { + /* A shift of more than the bit depth is an error condition but it + * gets ignored here. + */ + if (shift[c] <= 0 || shift[c] >= bit_depth) + shift[c] = 0; + + else + have_shift = 1; + } - if (!value) - return; + if (!have_shift) + return; + } - switch (row_info->bit_depth) + switch (bit_depth) { default: + /* Must be 1bpp gray: should not be here! */ + /* NOTREACHED */ break; case 2: + /* Must be 2bpp gray */ + /* assert(channels == 1 && shift[0] == 1) */ { - png_bytep bp; - png_size_t i; - png_size_t istop = row_info->rowbytes; + png_bytep bp = row; + png_bytep bp_end = bp + row_info->rowbytes; - for (bp = row, i = 0; i < istop; i++) + while (bp < bp_end) { - *bp >>= 1; - *bp++ &= 0x55; + int b = (*bp >> 1) & 0x55; + *bp++ = (png_byte)b; } break; } case 4: + /* Must be 4bpp gray */ + /* assert(channels == 1) */ { png_bytep bp = row; - png_size_t i; - png_size_t istop = row_info->rowbytes; - png_byte mask = (png_byte)((((int)0xf0 >> shift[0]) & (int)0xf0) | - (png_byte)((int)0xf >> shift[0])); + png_bytep bp_end = bp + row_info->rowbytes; + int gray_shift = shift[0]; + int mask = 0xf >> gray_shift; + + mask |= mask << 4; - for (i = 0; i < istop; i++) + while (bp < bp_end) { - *bp >>= shift[0]; - *bp++ &= mask; + int b = (*bp >> gray_shift) & mask; + *bp++ = (png_byte)b; } break; } case 8: + /* Single byte components, G, GA, RGB, RGBA */ { png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = row_width * channels; + png_bytep bp_end = bp + row_info->rowbytes; + int channel = 0; - for (i = 0; i < istop; i++) + while (bp < bp_end) { - *bp++ >>= shift[i%channels]; + int b = *bp >> shift[channel]; + if (++channel >= channels) + channel = 0; + *bp++ = (png_byte)b; } break; } #ifdef PNG_READ_16BIT_SUPPORTED case 16: + /* Double byte components, G, GA, RGB, RGBA */ { png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = channels * row_width; + png_bytep bp_end = bp + row_info->rowbytes; + int channel = 0; - for (i = 0; i < istop; i++) + while (bp < bp_end) { - value = (png_uint_16)((*bp << 8) + *(bp + 1)); - value >>= shift[i%channels]; + int value = (bp[0] << 8) + bp[1]; + + value >>= shift[channel]; + if (++channel >= channels) + channel = 0; *bp++ = (png_byte)(value >> 8); *bp++ = (png_byte)(value & 0xff); } @@ -2519,7 +2610,7 @@ png_do_scale_16_to_8(png_row_infop row_info, png_bytep row) if (row_info->bit_depth == 16) { png_bytep sp = row; /* source */ - png_bytep dp = row; /* destinaton */ + png_bytep dp = row; /* destination */ png_bytep ep = sp + row_info->rowbytes; /* end+1 */ while (sp < ep) @@ -2580,7 +2671,7 @@ png_do_chop(png_row_infop row_info, png_bytep row) if (row_info->bit_depth == 16) { png_bytep sp = row; /* source */ - png_bytep dp = row; /* destinaton */ + png_bytep dp = row; /* destination */ png_bytep ep = sp + row_info->rowbytes; /* end+1 */ while (sp < ep) @@ -3060,7 +3151,7 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row) } } } - row_info->channels += (png_byte)2; + row_info->channels = (png_byte)(row_info->channels + 2); row_info->color_type |= PNG_COLOR_MASK_COLOR; row_info->pixel_depth = (png_byte)(row_info->channels * row_info->bit_depth); @@ -3288,7 +3379,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row) if (red != green || red != blue) rgb_error |= 1; - /* From 1.5.5 in the 16 bit case do the accurate convertion even + /* From 1.5.5 in the 16 bit case do the accurate conversion even * in the 'fast' case - this is because this is where the code * ends up when handling linear 16 bit data. */ @@ -3306,7 +3397,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row) } } - row_info->channels -= 2; + row_info->channels = (png_byte)(row_info->channels - 2); row_info->color_type = (png_byte)(row_info->color_type & ~PNG_COLOR_MASK_COLOR); row_info->pixel_depth = (png_byte)(row_info->channels * @@ -3376,7 +3467,8 @@ png_build_grayscale_palette(int bit_depth, png_colorp palette) #ifdef PNG_READ_TRANSFORMS_SUPPORTED -#ifdef PNG_READ_BACKGROUND_SUPPORTED +#if (defined PNG_READ_BACKGROUND_SUPPORTED) ||\ + (defined PNG_READ_ALPHA_MODE_SUPPORTED) /* Replace any alpha or transparency with the supplied background color. * "background" is already in the screen gamma, while "background_1" is * at a gamma of 1.0. Paletted files have already been taken care of. @@ -4084,7 +4176,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structp png_ptr) } } } -#endif +#endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_READ_ALPHA_MODE_SUPPORTED */ #ifdef PNG_READ_GAMMA_SUPPORTED /* Gamma correct the image, avoiding the alpha channel. Make sure diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngrutil.c b/Build/source/libs/libpng/libpng-1.5.7/pngrutil.c index bfff7d6b868..52a73cfc394 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngrutil.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngrutil.c @@ -1,7 +1,7 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.5.5 [September 22, 2011] + * Last changed in libpng 1.5.7 [December 15, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -165,14 +165,14 @@ png_read_chunk_header(png_structp png_ptr) length = png_get_uint_31(png_ptr, buf); /* Put the chunk name into png_ptr->chunk_name. */ - png_memcpy(png_ptr->chunk_name, buf + 4, 4); + png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(buf+4); - png_debug2(0, "Reading %s chunk, length = %u", - png_ptr->chunk_name, length); + png_debug2(0, "Reading %lx chunk, length = %lu", + (unsigned long)png_ptr->chunk_name, (unsigned long)length); /* Reset the crc and run it over the chunk name. */ png_reset_crc(png_ptr); - png_calculate_crc(png_ptr, png_ptr->chunk_name, 4); + png_calculate_crc(png_ptr, buf + 4, 4); /* Check to see if chunk name is valid. */ png_check_chunk_name(png_ptr, png_ptr->chunk_name); @@ -218,10 +218,9 @@ png_crc_finish(png_structp png_ptr, png_uint_32 skip) if (png_crc_error(png_ptr)) { - if (((png_ptr->chunk_name[0] & 0x20) && /* Ancillary */ - !(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN)) || - (!(png_ptr->chunk_name[0] & 0x20) && /* Critical */ - (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_USE))) + if (PNG_CHUNK_ANCILLIARY(png_ptr->chunk_name) ? + !(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN) : + (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_USE)) { png_chunk_warning(png_ptr, "CRC error"); } @@ -248,14 +247,14 @@ png_crc_error(png_structp png_ptr) png_uint_32 crc; int need_crc = 1; - if (png_ptr->chunk_name[0] & 0x20) /* ancillary */ + if (PNG_CHUNK_ANCILLIARY(png_ptr->chunk_name)) { if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) == (PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN)) need_crc = 0; } - else /* critical */ + else /* critical */ { if (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) need_crc = 0; @@ -302,7 +301,7 @@ png_inflate(png_structp png_ptr, png_bytep data, png_size_t size, { int ret, avail; - /* The setting of 'avail_in' used to be outside the loop, by setting it + /* The setting of 'avail_in' used to be outside the loop; by setting it * inside it is possible to chunk the input to zlib and simply rely on * zlib to advance the 'next_in' pointer. This allows arbitrary amounts o * data to be passed through zlib at the unavoidable cost of requiring a @@ -491,7 +490,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type, { PNG_WARNING_PARAMETERS(p) png_warning_parameter_signed(p, 1, PNG_NUMBER_FORMAT_d, comp_type); - png_formatted_warning(png_ptr, p, "Unknown zTXt compression type @1"); + png_formatted_warning(png_ptr, p, "Unknown compression type @1"); /* The recovery is to simply drop the data. */ } @@ -942,7 +941,7 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) else if (png_ptr->mode & PNG_HAVE_PLTE) /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Missing PLTE before cHRM"); + png_warning(png_ptr, "Out of place cHRM chunk"); if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM) # ifdef PNG_READ_sRGB_SUPPORTED @@ -2541,6 +2540,14 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) comp_type = *lang++; } + if (comp_type || (comp_flag && comp_flag != PNG_TEXT_COMPRESSION_zTXt)) + { + png_warning(png_ptr, "Unknown iTXt compression type or method"); + png_free(png_ptr, png_ptr->chunkdata); + png_ptr->chunkdata = NULL; + return; + } + for (lang_key = lang; *lang_key; lang_key++) /* Empty loop */ ; @@ -2641,16 +2648,14 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) if (png_ptr->mode & PNG_HAVE_IDAT) { - PNG_IDAT; - - if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) /* Not an IDAT */ + if (png_ptr->chunk_name != png_IDAT) png_ptr->mode |= PNG_AFTER_IDAT; } - if (!(png_ptr->chunk_name[0] & 0x20)) + if (PNG_CHUNK_CRITICAL(png_ptr->chunk_name)) { #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != + if (png_chunk_unknown_handling(png_ptr, png_ptr->chunk_name) != PNG_HANDLE_CHUNK_ALWAYS #ifdef PNG_READ_USER_CHUNKS_SUPPORTED && png_ptr->read_user_chunk_fn == NULL @@ -2668,21 +2673,20 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ) { #ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) + if (length > 65535) { png_warning(png_ptr, "unknown chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; + skip = length - 65535; + length = 65535; } #endif - png_memcpy((png_charp)png_ptr->unknown_chunk.name, - (png_charp)png_ptr->chunk_name, - png_sizeof(png_ptr->unknown_chunk.name)); - - png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name)-1] - = '\0'; - + /* TODO: this code is very close to the unknown handling in pngpread.c, + * maybe it can be put into a common utility routine? + * png_struct::unknown_chunk is just used as a temporary variable, along + * with the data into which the chunk is read. These can be eliminated. + */ + PNG_CSTRING_FROM_CHUNK(png_ptr->unknown_chunk.name, png_ptr->chunk_name); png_ptr->unknown_chunk.size = (png_size_t)length; if (length == 0) @@ -2691,7 +2695,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) else { png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr, length); - png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length); + png_crc_read(png_ptr, png_ptr->unknown_chunk.data, length); } #ifdef PNG_READ_USER_CHUNKS_SUPPORTED @@ -2708,10 +2712,10 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) if (ret == 0) { - if (!(png_ptr->chunk_name[0] & 0x20)) + if (PNG_CHUNK_CRITICAL(png_ptr->chunk_name)) { #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != + if (png_chunk_unknown_handling(png_ptr, png_ptr->chunk_name) != PNG_HANDLE_CHUNK_ALWAYS) #endif png_chunk_error(png_ptr, "unknown critical chunk"); @@ -2748,267 +2752,523 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) * the chunk name itself is valid. */ -#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97)) +/* Bit hacking: the test for an invalid byte in the 4 byte chunk name is: + * + * ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97)) + */ void /* PRIVATE */ -png_check_chunk_name(png_structp png_ptr, png_const_bytep chunk_name) +png_check_chunk_name(png_structp png_ptr, png_uint_32 chunk_name) { + int i; + png_debug(1, "in png_check_chunk_name"); - if (isnonalpha(chunk_name[0]) || isnonalpha(chunk_name[1]) || - isnonalpha(chunk_name[2]) || isnonalpha(chunk_name[3])) + + for (i=1; i<=4; ++i) { - png_chunk_error(png_ptr, "invalid chunk type"); + int c = chunk_name & 0xff; + + if (c < 65 || c > 122 || (c > 90 && c < 97)) + png_chunk_error(png_ptr, "invalid chunk type"); + + chunk_name >>= 8; } } -/* Combines the row recently read in with the existing pixels in the - * row. This routine takes care of alpha and transparency if requested. - * This routine also handles the two methods of progressive display - * of interlaced images, depending on the mask value. - * The mask value describes which pixels are to be combined with - * the row. The pattern always repeats every 8 pixels, so just 8 - * bits are needed. A one indicates the pixel is to be combined, - * a zero indicates the pixel is to be skipped. This is in addition - * to any alpha or transparency value associated with the pixel. If - * you want all pixels to be combined, pass 0xff (255) in mask. +/* Combines the row recently read in with the existing pixels in the row. This + * routine takes care of alpha and transparency if requested. This routine also + * handles the two methods of progressive display of interlaced images, + * depending on the 'display' value; if 'display' is true then the whole row + * (dp) is filled from the start by replicating the available pixels. If + * 'display' is false only those pixels present in the pass are filled in. */ - void /* PRIVATE */ -png_combine_row(png_structp png_ptr, png_bytep row, int mask) +png_combine_row(png_structp png_ptr, png_bytep dp, int display) { + unsigned int pixel_depth = png_ptr->transformed_pixel_depth; + png_const_bytep sp = png_ptr->row_buf + 1; + png_uint_32 row_width = png_ptr->width; + unsigned int pass = png_ptr->pass; + png_bytep end_ptr = 0; + png_byte end_byte = 0; + unsigned int end_mask; + png_debug(1, "in png_combine_row"); - /* Added in 1.5.4: the row_info should match the information returned by any - * call to png_read_update_info at this point. Do not continue if we got + /* Added in 1.5.6: it should not be possible to enter this routine until at + * least one row has been read from the PNG data and transformed. + */ + if (pixel_depth == 0) + png_error(png_ptr, "internal row logic error"); + + /* Added in 1.5.4: the pixel depth should match the information returned by + * any call to png_read_update_info at this point. Do not continue if we got * this wrong. */ if (png_ptr->info_rowbytes != 0 && png_ptr->info_rowbytes != - PNG_ROWBYTES(png_ptr->row_info.pixel_depth, png_ptr->width)) + PNG_ROWBYTES(pixel_depth, row_width)) png_error(png_ptr, "internal row size calculation error"); - if (mask == 0xff) + /* Don't expect this to ever happen: */ + if (row_width == 0) + png_error(png_ptr, "internal row width error"); + + /* Preserve the last byte in cases where only part of it will be overwritten, + * the multiply below may overflow, we don't care because ANSI-C guarantees + * we get the low bits. + */ + end_mask = (pixel_depth * row_width) & 7; + if (end_mask != 0) { - png_memcpy(row, png_ptr->row_buf + 1, - PNG_ROWBYTES(png_ptr->row_info.pixel_depth, png_ptr->width)); + /* end_ptr == NULL is a flag to say do nothing */ + end_ptr = dp + PNG_ROWBYTES(pixel_depth, row_width) - 1; + end_byte = *end_ptr; +# ifdef PNG_READ_PACKSWAP_SUPPORTED + if (png_ptr->transformations & PNG_PACKSWAP) /* little-endian byte */ + end_mask = 0xff << end_mask; + + else /* big-endian byte */ +# endif + end_mask = 0xff >> end_mask; + /* end_mask is now the bits to *keep* from the destination row */ } - else + /* For non-interlaced images this reduces to a png_memcpy(). A png_memcpy() + * will also happen if interlacing isn't supported or if the application + * does not call png_set_interlace_handling(). In the latter cases the + * caller just gets a sequence of the unexpanded rows from each interlace + * pass. + */ +#ifdef PNG_READ_INTERLACING_SUPPORTED + if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE) && + pass < 6 && (display == 0 || + /* The following copies everything for 'display' on passes 0, 2 and 4. */ + (display == 1 && (pass & 1) != 0))) { - switch (png_ptr->row_info.pixel_depth) - { - case 1: - { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; - int s_inc, s_start, s_end; - int m = 0x80; - int shift; - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; - -#ifdef PNG_READ_PACKSWAP_SUPPORTED - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 7; - s_inc = 1; - } + /* Narrow images may have no bits in a pass; the caller should handle + * this, but this test is cheap: + */ + if (row_width <= PNG_PASS_START_COL(pass)) + return; - else -#endif - { - s_start = 7; - s_end = 0; - s_inc = -1; - } + if (pixel_depth < 8) + { + /* For pixel depths up to 4 bpp the 8-pixel mask can be expanded to fit + * into 32 bits, then a single loop over the bytes using the four byte + * values in the 32-bit mask can be used. For the 'display' option the + * expanded mask may also not require any masking within a byte. To + * make this work the PACKSWAP option must be taken into account - it + * simply requires the pixels to be reversed in each byte. + * + * The 'regular' case requires a mask for each of the first 6 passes, + * the 'display' case does a copy for the even passes in the range + * 0..6. This has already been handled in the test above. + * + * The masks are arranged as four bytes with the first byte to use in + * the lowest bits (little-endian) regardless of the order (PACKSWAP or + * not) of the pixels in each byte. + * + * NOTE: the whole of this logic depends on the caller of this function + * only calling it on rows appropriate to the pass. This function only + * understands the 'x' logic; the 'y' logic is handled by the caller. + * + * The following defines allow generation of compile time constant bit + * masks for each pixel depth and each possibility of swapped or not + * swapped bytes. Pass 'p' is in the range 0..6; 'x', a pixel index, + * is in the range 0..7; and the result is 1 if the pixel is to be + * copied in the pass, 0 if not. 'S' is for the sparkle method, 'B' + * for the block method. + * + * With some compilers a compile time expression of the general form: + * + * (shift >= 32) ? (a >> (shift-32)) : (b >> shift) + * + * Produces warnings with values of 'shift' in the range 33 to 63 + * because the right hand side of the ?: expression is evaluated by + * the compiler even though it isn't used. Microsoft Visual C (various + * versions) and the Intel C compiler are known to do this. To avoid + * this the following macros are used in 1.5.6. This is a temporary + * solution to avoid destabilizing the code during the release process. + */ +# if PNG_USE_COMPILE_TIME_MASKS +# define PNG_LSR(x,s) ((x)>>((s) & 0x1f)) +# define PNG_LSL(x,s) ((x)<<((s) & 0x1f)) +# else +# define PNG_LSR(x,s) ((x)>>(s)) +# define PNG_LSL(x,s) ((x)<<(s)) +# endif +# define S_COPY(p,x) (((p)<4 ? PNG_LSR(0x80088822,(3-(p))*8+(7-(x))) :\ + PNG_LSR(0xaa55ff00,(7-(p))*8+(7-(x)))) & 1) +# define B_COPY(p,x) (((p)<4 ? PNG_LSR(0xff0fff33,(3-(p))*8+(7-(x))) :\ + PNG_LSR(0xff55ff00,(7-(p))*8+(7-(x)))) & 1) + + /* Return a mask for pass 'p' pixel 'x' at depth 'd'. The mask is + * little endian - the first pixel is at bit 0 - however the extra + * parameter 's' can be set to cause the mask position to be swapped + * within each byte, to match the PNG format. This is done by XOR of + * the shift with 7, 6 or 4 for bit depths 1, 2 and 4. + */ +# define PIXEL_MASK(p,x,d,s) \ + (PNG_LSL(((PNG_LSL(1U,(d)))-1),(((x)*(d))^((s)?8-(d):0)))) - shift = s_start; + /* Hence generate the appropriate 'block' or 'sparkle' pixel copy mask. + */ +# define S_MASKx(p,x,d,s) (S_COPY(p,x)?PIXEL_MASK(p,x,d,s):0) +# define B_MASKx(p,x,d,s) (B_COPY(p,x)?PIXEL_MASK(p,x,d,s):0) - for (i = 0; i < row_width; i++) - { - if (m & mask) - { - int value; + /* Combine 8 of these to get the full mask. For the 1-bpp and 2-bpp + * cases the result needs replicating, for the 4-bpp case the above + * generates a full 32 bits. + */ +# define MASK_EXPAND(m,d) ((m)*((d)==1?0x01010101:((d)==2?0x00010001:1))) - value = (*sp >> shift) & 0x01; - *dp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } +# define S_MASK(p,d,s) MASK_EXPAND(S_MASKx(p,0,d,s) + S_MASKx(p,1,d,s) +\ + S_MASKx(p,2,d,s) + S_MASKx(p,3,d,s) + S_MASKx(p,4,d,s) +\ + S_MASKx(p,5,d,s) + S_MASKx(p,6,d,s) + S_MASKx(p,7,d,s), d) - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } +# define B_MASK(p,d,s) MASK_EXPAND(B_MASKx(p,0,d,s) + B_MASKx(p,1,d,s) +\ + B_MASKx(p,2,d,s) + B_MASKx(p,3,d,s) + B_MASKx(p,4,d,s) +\ + B_MASKx(p,5,d,s) + B_MASKx(p,6,d,s) + B_MASKx(p,7,d,s), d) - else - shift += s_inc; +#if PNG_USE_COMPILE_TIME_MASKS + /* Utility macros to construct all the masks for a depth/swap + * combination. The 's' parameter says whether the format is PNG + * (big endian bytes) or not. Only the three odd-numbered passes are + * required for the display/block algorithm. + */ +# define S_MASKS(d,s) { S_MASK(0,d,s), S_MASK(1,d,s), S_MASK(2,d,s),\ + S_MASK(3,d,s), S_MASK(4,d,s), S_MASK(5,d,s) } - if (m == 1) - m = 0x80; +# define B_MASKS(d,s) { B_MASK(1,d,s), S_MASK(3,d,s), S_MASK(5,d,s) } - else - m >>= 1; - } - break; - } +# define DEPTH_INDEX(d) ((d)==1?0:((d)==2?1:2)) - case 2: + /* Hence the pre-compiled masks indexed by PACKSWAP (or not), depth and + * then pass: + */ + static PNG_CONST png_uint_32 row_mask[2/*PACKSWAP*/][3/*depth*/][6] = { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; - int s_start, s_end, s_inc; - int m = 0x80; - int shift; - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; - int value; + /* Little-endian byte masks for PACKSWAP */ + { S_MASKS(1,0), S_MASKS(2,0), S_MASKS(4,0) }, + /* Normal (big-endian byte) masks - PNG format */ + { S_MASKS(1,1), S_MASKS(2,1), S_MASKS(4,1) } + }; + + /* display_mask has only three entries for the odd passes, so index by + * pass>>1. + */ + static PNG_CONST png_uint_32 display_mask[2][3][3] = + { + /* Little-endian byte masks for PACKSWAP */ + { B_MASKS(1,0), B_MASKS(2,0), B_MASKS(4,0) }, + /* Normal (big-endian byte) masks - PNG format */ + { B_MASKS(1,1), B_MASKS(2,1), B_MASKS(4,1) } + }; + +# define MASK(pass,depth,display,png)\ + ((display)?display_mask[png][DEPTH_INDEX(depth)][pass>>1]:\ + row_mask[png][DEPTH_INDEX(depth)][pass]) + +#else /* !PNG_USE_COMPILE_TIME_MASKS */ + /* This is the runtime alternative: it seems unlikely that this will + * ever be either smaller or faster than the compile time approach. + */ +# define MASK(pass,depth,display,png)\ + ((display)?B_MASK(pass,depth,png):S_MASK(pass,depth,png)) +#endif /* !PNG_USE_COMPILE_TIME_MASKS */ + + /* Use the appropriate mask to copy the required bits. In some cases + * the byte mask will be 0 or 0xff, optimize these cases. row_width is + * the number of pixels, but the code copies bytes, so it is necessary + * to special case the end. + */ + png_uint_32 pixels_per_byte = 8 / pixel_depth; + png_uint_32 mask; -#ifdef PNG_READ_PACKSWAP_SUPPORTED +# ifdef PNG_READ_PACKSWAP_SUPPORTED if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 6; - s_inc = 2; - } + mask = MASK(pass, pixel_depth, display, 0); else -#endif +# endif + mask = MASK(pass, pixel_depth, display, 1); + + for (;;) + { + png_uint_32 m; + + /* It doesn't matter in the following if png_uint_32 has more than + * 32 bits because the high bits always match those in m<<24; it is, + * however, essential to use OR here, not +, because of this. + */ + m = mask; + mask = (m >> 8) | (m << 24); /* rotate right to good compilers */ + m &= 0xff; + + if (m != 0) /* something to copy */ { - s_start = 6; - s_end = 0; - s_inc = -2; + if (m != 0xff) + *dp = (png_byte)((*dp & ~m) | (*sp & m)); + else + *dp = *sp; } - shift = s_start; + /* NOTE: this may overwrite the last byte with garbage if the image + * is not an exact number of bytes wide; libpng has always done + * this. + */ + if (row_width <= pixels_per_byte) + break; /* May need to restore part of the last byte */ - for (i = 0; i < row_width; i++) - { - if (m & mask) - { - value = (*sp >> shift) & 0x03; - *dp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } + row_width -= pixels_per_byte; + ++dp; + ++sp; + } + } - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } + else /* pixel_depth >= 8 */ + { + unsigned int bytes_to_copy, bytes_to_jump; - else - shift += s_inc; + /* Validate the depth - it must be a multiple of 8 */ + if (pixel_depth & 7) + png_error(png_ptr, "invalid user transform pixel depth"); - if (m == 1) - m = 0x80; + pixel_depth >>= 3; /* now in bytes */ + row_width *= pixel_depth; - else - m >>= 1; - } - break; + /* Regardless of pass number the Adam 7 interlace always results in a + * fixed number of pixels to copy then to skip. There may be a + * different number of pixels to skip at the start though. + */ + { + unsigned int offset = PNG_PASS_START_COL(pass) * pixel_depth; + + row_width -= offset; + dp += offset; + sp += offset; } - case 4: + /* Work out the bytes to copy. */ + if (display) { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; - int s_start, s_end, s_inc; - int m = 0x80; - int shift; - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; - int value; + /* When doing the 'block' algorithm the pixel in the pass gets + * replicated to adjacent pixels. This is why the even (0,2,4,6) + * passes are skipped above - the entire expanded row is copied. + */ + bytes_to_copy = (1<<((6-pass)>>1)) * pixel_depth; -#ifdef PNG_READ_PACKSWAP_SUPPORTED - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 4; - s_inc = 4; - } + /* But don't allow this number to exceed the actual row width. */ + if (bytes_to_copy > row_width) + bytes_to_copy = row_width; + } - else -#endif - { - s_start = 4; - s_end = 0; - s_inc = -4; - } - shift = s_start; + else /* normal row; Adam7 only ever gives us one pixel to copy. */ + bytes_to_copy = pixel_depth; - for (i = 0; i < row_width; i++) - { - if (m & mask) + /* In Adam7 there is a constant offset between where the pixels go. */ + bytes_to_jump = PNG_PASS_COL_OFFSET(pass) * pixel_depth; + + /* And simply copy these bytes. Some optimization is possible here, + * depending on the value of 'bytes_to_copy'. Special case the low + * byte counts, which we know to be frequent. + * + * Notice that these cases all 'return' rather than 'break' - this + * avoids an unnecessary test on whether to restore the last byte + * below. + */ + switch (bytes_to_copy) + { + case 1: + for (;;) { - value = (*sp >> shift) & 0xf; - *dp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); + *dp = *sp; + + if (row_width <= bytes_to_jump) + return; + + dp += bytes_to_jump; + sp += bytes_to_jump; + row_width -= bytes_to_jump; } - if (shift == s_end) + case 2: + /* There is a possibility of a partial copy at the end here; this + * slows the code down somewhat. + */ + do { - shift = s_start; - sp++; - dp++; + dp[0] = sp[0], dp[1] = sp[1]; + + if (row_width <= bytes_to_jump) + return; + + sp += bytes_to_jump; + dp += bytes_to_jump; + row_width -= bytes_to_jump; } + while (row_width > 1); - else - shift += s_inc; + /* And there can only be one byte left at this point: */ + *dp = *sp; + return; - if (m == 1) - m = 0x80; + case 3: + /* This can only be the RGB case, so each copy is exactly one + * pixel and it is not necessary to check for a partial copy. + */ + for(;;) + { + dp[0] = sp[0], dp[1] = sp[1], dp[2] = sp[2]; - else - m >>= 1; - } - break; - } + if (row_width <= bytes_to_jump) + return; - default: - { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; - png_size_t pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; - png_byte m = 0x80; + sp += bytes_to_jump; + dp += bytes_to_jump; + row_width -= bytes_to_jump; + } - for (i = 0; i < row_width; i++) - { - if (m & mask) + default: +#if PNG_ALIGN_TYPE != PNG_ALIGN_NONE + /* Check for double byte alignment and, if possible, use a + * 16-bit copy. Don't attempt this for narrow images - ones that + * are less than an interlace panel wide. Don't attempt it for + * wide bytes_to_copy either - use the png_memcpy there. + */ + if (bytes_to_copy < 16 /*else use png_memcpy*/ && + png_isaligned(dp, png_uint_16) && + png_isaligned(sp, png_uint_16) && + bytes_to_copy % sizeof (png_uint_16) == 0 && + bytes_to_jump % sizeof (png_uint_16) == 0) { - png_memcpy(dp, sp, pixel_bytes); + /* Everything is aligned for png_uint_16 copies, but try for + * png_uint_32 first. + */ + if (png_isaligned(dp, png_uint_32) && + png_isaligned(sp, png_uint_32) && + bytes_to_copy % sizeof (png_uint_32) == 0 && + bytes_to_jump % sizeof (png_uint_32) == 0) + { + png_uint_32p dp32 = (png_uint_32p)dp; + png_const_uint_32p sp32 = (png_const_uint_32p)sp; + unsigned int skip = (bytes_to_jump-bytes_to_copy) / + sizeof (png_uint_32); + + do + { + size_t c = bytes_to_copy; + do + { + *dp32++ = *sp32++; + c -= sizeof (png_uint_32); + } + while (c > 0); + + if (row_width <= bytes_to_jump) + return; + + dp32 += skip; + sp32 += skip; + row_width -= bytes_to_jump; + } + while (bytes_to_copy <= row_width); + + /* Get to here when the row_width truncates the final copy. + * There will be 1-3 bytes left to copy, so don't try the + * 16-bit loop below. + */ + dp = (png_bytep)dp32; + sp = (png_const_bytep)sp32; + do + *dp++ = *sp++; + while (--row_width > 0); + return; + } + + /* Else do it in 16-bit quantities, but only if the size is + * not too large. + */ + else + { + png_uint_16p dp16 = (png_uint_16p)dp; + png_const_uint_16p sp16 = (png_const_uint_16p)sp; + unsigned int skip = (bytes_to_jump-bytes_to_copy) / + sizeof (png_uint_16); + + do + { + size_t c = bytes_to_copy; + do + { + *dp16++ = *sp16++; + c -= sizeof (png_uint_16); + } + while (c > 0); + + if (row_width <= bytes_to_jump) + return; + + dp16 += skip; + sp16 += skip; + row_width -= bytes_to_jump; + } + while (bytes_to_copy <= row_width); + + /* End of row - 1 byte left, bytes_to_copy > row_width: */ + dp = (png_bytep)dp16; + sp = (png_const_bytep)sp16; + do + *dp++ = *sp++; + while (--row_width > 0); + return; + } } +#endif /* PNG_ALIGN_ code */ - sp += pixel_bytes; - dp += pixel_bytes; + /* The true default - use a png_memcpy: */ + for (;;) + { + png_memcpy(dp, sp, bytes_to_copy); - if (m == 1) - m = 0x80; + if (row_width <= bytes_to_jump) + return; - else - m >>= 1; - } - break; + sp += bytes_to_jump; + dp += bytes_to_jump; + row_width -= bytes_to_jump; + if (bytes_to_copy > row_width) + bytes_to_copy = row_width; + } } - } + + /* NOT REACHED*/ + } /* pixel_depth >= 8 */ + + /* Here if pixel_depth < 8 to check 'end_ptr' below. */ } + else +#endif + + /* If here then the switch above wasn't used so just png_memcpy the whole row + * from the temporary row buffer (notice that this overwrites the end of the + * destination row if it is a partial byte.) + */ + png_memcpy(dp, sp, PNG_ROWBYTES(pixel_depth, row_width)); + + /* Restore the overwritten bits from the last byte if necessary. */ + if (end_ptr != NULL) + *end_ptr = (png_byte)((end_byte & end_mask) | (*end_ptr & ~end_mask)); } #ifdef PNG_READ_INTERLACING_SUPPORTED void /* PRIVATE */ -png_do_read_interlace(png_structp png_ptr) +png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass, + png_uint_32 transformations /* Because these may affect the byte layout */) { - png_row_infop row_info = &(png_ptr->row_info); - png_bytep row = png_ptr->row_buf + 1; - int pass = png_ptr->pass; - png_uint_32 transformations = png_ptr->transformations; /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Offset to next interlace block */ - PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + static PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; png_debug(1, "in png_do_read_interlace"); if (row != NULL && row_info != NULL) @@ -3173,7 +3433,7 @@ png_do_read_interlace(png_structp png_ptr) for (i = 0; i < row_info->width; i++) { - png_byte v = (png_byte)((*sp >> sshift) & 0xf); + png_byte v = (png_byte)((*sp >> sshift) & 0x0f); int j; for (j = 0; j < jstop; j++) @@ -3202,6 +3462,7 @@ png_do_read_interlace(png_structp png_ptr) } break; } + default: { png_size_t pixel_bytes = (row_info->pixel_depth >> 3); @@ -3232,6 +3493,7 @@ png_do_read_interlace(png_structp png_ptr) break; } } + row_info->width = final_width; row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, final_width); } @@ -3241,133 +3503,253 @@ png_do_read_interlace(png_structp png_ptr) } #endif /* PNG_READ_INTERLACING_SUPPORTED */ -void /* PRIVATE */ -png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row, - png_const_bytep prev_row, int filter) +static void +png_read_filter_row_sub(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) { - png_debug(1, "in png_read_filter_row"); - png_debug2(2, "row = %u, filter = %d", png_ptr->row_number, filter); - switch (filter) + png_size_t i; + png_size_t istop = row_info->rowbytes; + unsigned int bpp = (row_info->pixel_depth + 7) >> 3; + png_bytep rp = row + bpp; + + PNG_UNUSED(prev_row) + + for (i = bpp; i < istop; i++) { - case PNG_FILTER_VALUE_NONE: - break; + *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff); + rp++; + } +} - case PNG_FILTER_VALUE_SUB: - { - png_size_t i; - png_size_t istop = row_info->rowbytes; - unsigned int bpp = (row_info->pixel_depth + 7) >> 3; - png_bytep rp = row + bpp; - png_bytep lp = row; +static void +png_read_filter_row_up(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) +{ + png_size_t i; + png_size_t istop = row_info->rowbytes; + png_bytep rp = row; + png_const_bytep pp = prev_row; - for (i = bpp; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*lp++)) & 0xff); - rp++; - } - break; - } - case PNG_FILTER_VALUE_UP: - { - png_size_t i; - png_size_t istop = row_info->rowbytes; - png_bytep rp = row; - png_const_bytep pp = prev_row; + for (i = 0; i < istop; i++) + { + *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); + rp++; + } +} - for (i = 0; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); - rp++; - } - break; - } - case PNG_FILTER_VALUE_AVG: - { - png_size_t i; - png_bytep rp = row; - png_const_bytep pp = prev_row; - png_bytep lp = row; - unsigned int bpp = (row_info->pixel_depth + 7) >> 3; - png_size_t istop = row_info->rowbytes - bpp; - - for (i = 0; i < bpp; i++) - { - *rp = (png_byte)(((int)(*rp) + - ((int)(*pp++) / 2 )) & 0xff); +static void +png_read_filter_row_avg(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) +{ + png_size_t i; + png_bytep rp = row; + png_const_bytep pp = prev_row; + unsigned int bpp = (row_info->pixel_depth + 7) >> 3; + png_size_t istop = row_info->rowbytes - bpp; - rp++; - } + for (i = 0; i < bpp; i++) + { + *rp = (png_byte)(((int)(*rp) + + ((int)(*pp++) / 2 )) & 0xff); - for (i = 0; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + - (int)(*pp++ + *lp++) / 2 ) & 0xff); + rp++; + } - rp++; - } - break; - } - case PNG_FILTER_VALUE_PAETH: - { - png_size_t i; - png_bytep rp = row; - png_const_bytep pp = prev_row; - png_bytep lp = row; - png_const_bytep cp = prev_row; - unsigned int bpp = (row_info->pixel_depth + 7) >> 3; - png_size_t istop=row_info->rowbytes - bpp; - - for (i = 0; i < bpp; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); - rp++; - } + for (i = 0; i < istop; i++) + { + *rp = (png_byte)(((int)(*rp) + + (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff); - for (i = 0; i < istop; i++) /* Use leftover rp,pp */ - { - int a, b, c, pa, pb, pc, p; + rp++; + } +} - a = *lp++; - b = *pp++; - c = *cp++; +static void +png_read_filter_row_paeth_1byte_pixel(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) +{ + png_bytep rp_end = row + row_info->rowbytes; + int a, c; - p = b - c; - pc = a - c; + /* First pixel/byte */ + c = *prev_row++; + a = *row + c; + *row++ = (png_byte)a; -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif + /* Remainder */ + while (row < rp_end) + { + int b, pa, pb, pc, p; - /* - if (pa <= pb && pa <= pc) - p = a; + a &= 0xff; /* From previous iteration or start */ + b = *prev_row++; - else if (pb <= pc) - p = b; + p = b - c; + pc = a - c; - else - p = c; - */ +# ifdef PNG_USE_ABS + pa = abs(p); + pb = abs(pc); + pc = abs(p + pc); +# else + pa = p < 0 ? -p : p; + pb = pc < 0 ? -pc : pc; + pc = (p + pc) < 0 ? -(p + pc) : p + pc; +# endif - p = (pa <= pb && pa <= pc) ? a : (pb <= pc) ? b : c; + /* Find the best predictor, the least of pa, pb, pc favoring the earlier + * ones in the case of a tie. + */ + if (pb < pa) pa = pb, a = b; + if (pc < pa) a = c; - *rp = (png_byte)(((int)(*rp) + p) & 0xff); - rp++; - } + /* Calculate the current pixel in a, and move the previous row pixel to c + * for the next time round the loop + */ + c = b; + a += *row; + *row++ = (png_byte)a; + } +} + +static void +png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row, + png_const_bytep prev_row) +{ + int bpp = (row_info->pixel_depth + 7) >> 3; + png_bytep rp_end = row + bpp; + + /* Process the first pixel in the row completely (this is the same as 'up' + * because there is only one candidate predictor for the first row). + */ + while (row < rp_end) + { + int a = *row + *prev_row++; + *row++ = (png_byte)a; + } + + /* Remainder */ + rp_end += row_info->rowbytes - bpp; + + while (row < rp_end) + { + int a, b, c, pa, pb, pc, p; + + c = *(prev_row - bpp); + a = *(row - bpp); + b = *prev_row++; + + p = b - c; + pc = a - c; + +# ifdef PNG_USE_ABS + pa = abs(p); + pb = abs(pc); + pc = abs(p + pc); +# else + pa = p < 0 ? -p : p; + pb = pc < 0 ? -pc : pc; + pc = (p + pc) < 0 ? -(p + pc) : p + pc; +# endif + + if (pb < pa) pa = pb, a = b; + if (pc < pa) a = c; + + c = b; + a += *row; + *row++ = (png_byte)a; + } +} + +#ifdef PNG_ARM_NEON + +#ifdef __linux__ +#include <stdio.h> +#include <elf.h> +#include <asm/hwcap.h> + +static int png_have_hwcap(unsigned cap) +{ + FILE *f = fopen("/proc/self/auxv", "r"); + Elf32_auxv_t aux; + int have_cap = 0; + + if (!f) + return 0; + + while (fread(&aux, sizeof(aux), 1, f) > 0) + { + if (aux.a_type == AT_HWCAP && + aux.a_un.a_val & cap) + { + have_cap = 1; break; } - default: - png_error(png_ptr, "Ignoring bad adaptive filter type"); - /*NOT REACHED */ - break; + } + + fclose(f); + + return have_cap; +} +#endif /* __linux__ */ + +static void +png_init_filter_functions_neon(png_structp pp, unsigned int bpp) +{ +#ifdef __linux__ + if (!png_have_hwcap(HWCAP_NEON)) + return; +#endif + + pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_neon; + + if (bpp == 3) + { + pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_neon; + pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_neon; + pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = + png_read_filter_row_paeth3_neon; + } + + else if (bpp == 4) + { + pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_neon; + pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_neon; + pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = + png_read_filter_row_paeth4_neon; } } +#endif /* PNG_ARM_NEON */ + +static void +png_init_filter_functions(png_structp pp) +{ + unsigned int bpp = (pp->pixel_depth + 7) >> 3; + + pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub; + pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up; + pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg; + if (bpp == 1) + pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = + png_read_filter_row_paeth_1byte_pixel; + else + pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = + png_read_filter_row_paeth_multibyte_pixel; + +#ifdef PNG_ARM_NEON + png_init_filter_functions_neon(pp, bpp); +#endif +} + +void /* PRIVATE */ +png_read_filter_row(png_structp pp, png_row_infop row_info, png_bytep row, + png_const_bytep prev_row, int filter) +{ + if (pp->read_filter[0] == NULL) + png_init_filter_functions(pp); + if (filter > PNG_FILTER_VALUE_NONE && filter < PNG_FILTER_VALUE_LAST) + pp->read_filter[filter-1](row_info, row, prev_row); +} #ifdef PNG_SEQUENTIAL_READ_SUPPORTED void /* PRIVATE */ @@ -3377,16 +3759,16 @@ png_read_finish_row(png_structp png_ptr) /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ - PNG_CONST int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* Offset to next interlace block */ - PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; /* Start of interlace block in the y direction */ - PNG_CONST int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; + static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; /* Offset to next interlace block in the y direction */ - PNG_CONST int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; #endif /* PNG_READ_INTERLACING_SUPPORTED */ png_debug(1, "in png_read_finish_row"); @@ -3399,6 +3781,9 @@ png_read_finish_row(png_structp png_ptr) { png_ptr->row_number = 0; + /* TO DO: don't do this if prev_row isn't needed (requires + * read-ahead of the next row's filter byte. + */ png_memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1); do @@ -3433,7 +3818,6 @@ png_read_finish_row(png_structp png_ptr) if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) { - PNG_IDAT; char extra; int ret; @@ -3448,7 +3832,7 @@ png_read_finish_row(png_structp png_ptr) { png_crc_finish(png_ptr, 0); png_ptr->idat_size = png_read_chunk_header(png_ptr); - if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) + if (png_ptr->chunk_name != png_IDAT) png_error(png_ptr, "Not enough image data"); } @@ -3507,16 +3891,16 @@ png_read_start_row(png_structp png_ptr) /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ - PNG_CONST int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* Offset to next interlace block */ - PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; /* Start of interlace block in the y direction */ - PNG_CONST int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; + static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; /* Offset to next interlace block in the y direction */ - PNG_CONST int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; #endif int max_pixel_depth; @@ -3552,6 +3936,16 @@ png_read_start_row(png_structp png_ptr) max_pixel_depth = png_ptr->pixel_depth; + /* WARNING: * png_read_transform_info (pngrtran.c) performs a simpliar set of + * calculations to calculate the final pixel depth, then + * png_do_read_transforms actually does the transforms. This means that the + * code which effectively calculates this value is actually repeated in three + * separate places. They must all match. Innocent changes to the order of + * transformations can and will break libpng in a way that causes memory + * overwrites. + * + * TODO: fix this. + */ #ifdef PNG_READ_PACK_SUPPORTED if ((png_ptr->transformations & PNG_PACK) && png_ptr->bit_depth < 8) max_pixel_depth = 8; @@ -3610,10 +4004,7 @@ png_read_start_row(png_structp png_ptr) #ifdef PNG_READ_FILLER_SUPPORTED if (png_ptr->transformations & (PNG_FILLER)) { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - max_pixel_depth = 32; - - else if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) + if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) { if (max_pixel_depth <= 8) max_pixel_depth = 16; @@ -3622,7 +4013,8 @@ png_read_start_row(png_structp png_ptr) max_pixel_depth = 32; } - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) + else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB || + png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { if (max_pixel_depth <= 32) max_pixel_depth = 32; @@ -3676,14 +4068,20 @@ png_read_start_row(png_structp png_ptr) defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) if (png_ptr->transformations & PNG_USER_TRANSFORM) { - int user_pixel_depth = png_ptr->user_transform_depth* + int user_pixel_depth = png_ptr->user_transform_depth * png_ptr->user_transform_channels; if (user_pixel_depth > max_pixel_depth) - max_pixel_depth=user_pixel_depth; + max_pixel_depth = user_pixel_depth; } #endif + /* This value is stored in png_struct and double checked in the row read + * code. + */ + png_ptr->maximum_pixel_depth = (png_byte)max_pixel_depth; + png_ptr->transformed_pixel_depth = 0; /* calculated on demand */ + /* Align the width on the next larger 8 pixels. Mainly used * for interlacing */ @@ -3702,28 +4100,39 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) if (row_bytes + 48 > png_ptr->old_big_row_buf_size) { png_free(png_ptr, png_ptr->big_row_buf); + png_free(png_ptr, png_ptr->big_prev_row); if (png_ptr->interlaced) png_ptr->big_row_buf = (png_bytep)png_calloc(png_ptr, row_bytes + 48); else - png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, - row_bytes + 48); + png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes + 48); - png_ptr->old_big_row_buf_size = row_bytes + 48; + png_ptr->big_prev_row = (png_bytep)png_malloc(png_ptr, row_bytes + 48); #ifdef PNG_ALIGNED_MEMORY_SUPPORTED /* Use 16-byte aligned memory for row_buf with at least 16 bytes - * of padding before and after row_buf. + * of padding before and after row_buf; treat prev_row similarly. + * NOTE: the alignment is to the start of the pixels, one beyond the start + * of the buffer, because of the filter byte. Prior to libpng 1.5.6 this + * was incorrect; the filter byte was aligned, which had the exact + * opposite effect of that intended. */ - png_ptr->row_buf = png_ptr->big_row_buf + 32 - - (((png_alloc_size_t)png_ptr->big_row_buf + 15) & 0x0F); + { + png_bytep temp = png_ptr->big_row_buf + 32; + int extra = (int)((temp - (png_bytep)0) & 0x0f); + png_ptr->row_buf = temp - extra - 1/*filter byte*/; + + temp = png_ptr->big_prev_row + 32; + extra = (int)((temp - (png_bytep)0) & 0x0f); + png_ptr->prev_row = temp - extra - 1/*filter byte*/; + } - png_ptr->old_big_row_buf_size = row_bytes + 48; #else - /* Use 32 bytes of padding before and 16 bytes after row_buf. */ - png_ptr->row_buf = png_ptr->big_row_buf + 32; + /* Use 31 bytes of padding before and 17 bytes after row_buf. */ + png_ptr->row_buf = png_ptr->big_row_buf + 31; + png_ptr->prev_row = png_ptr->big_prev_row + 31; #endif png_ptr->old_big_row_buf_size = row_bytes + 48; } @@ -3736,15 +4145,6 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) if (png_ptr->rowbytes > (PNG_SIZE_MAX - 1)) png_error(png_ptr, "Row has too many bytes to allocate in memory"); - if (png_ptr->rowbytes + 1 > png_ptr->old_prev_row_size) - { - png_free(png_ptr, png_ptr->prev_row); - - png_ptr->prev_row = (png_bytep)png_malloc(png_ptr, png_ptr->rowbytes + 1); - - png_ptr->old_prev_row_size = png_ptr->rowbytes + 1; - } - png_memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1); png_debug1(3, "width = %u,", png_ptr->width); diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngset.c b/Build/source/libs/libpng/libpng-1.5.7/pngset.c index 7bae97c59e7..92db3890a89 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngset.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngset.c @@ -1,7 +1,7 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.5.5 [September 22, 2011] + * Last changed in libpng 1.5.7 [December 15, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -681,9 +681,8 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, { int i; - png_debug1(1, "in %s storage function", ((png_ptr == NULL || - png_ptr->chunk_name[0] == '\0') ? - "text" : (png_const_charp)png_ptr->chunk_name)); + png_debug1(1, "in %lx storage function", png_ptr == NULL ? "unexpected" : + (unsigned long)png_ptr->chunk_name); if (png_ptr == NULL || info_ptr == NULL || num_text == 0) return(0); @@ -865,6 +864,15 @@ png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_const_timep mod_time) (png_ptr->mode & PNG_WROTE_tIME)) return; + if (mod_time->month == 0 || mod_time->month > 12 || + mod_time->day == 0 || mod_time->day > 31 || + mod_time->hour > 23 || mod_time->minute > 59 || + mod_time->second > 60) + { + png_warning(png_ptr, "Ignoring invalid time value"); + return; + } + png_memcpy(&(info_ptr->mod_time), mod_time, png_sizeof(png_time)); info_ptr->valid |= PNG_INFO_tIME; } diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngstruct.h b/Build/source/libs/libpng/libpng-1.5.7/pngstruct.h index a9155b4277a..07f3a042554 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngstruct.h +++ b/Build/source/libs/libpng/libpng-1.5.7/pngstruct.h @@ -104,13 +104,17 @@ struct png_struct_def png_size_t rowbytes; /* size of row in bytes */ png_uint_32 iwidth; /* width of current interlaced row in pixels */ png_uint_32 row_number; /* current row in interlace pass */ - png_bytep prev_row; /* buffer to save previous (unfiltered) row */ - png_bytep row_buf; /* buffer to save current (unfiltered) row */ + png_uint_32 chunk_name; /* PNG_CHUNK() id of current chunk */ + png_bytep prev_row; /* buffer to save previous (unfiltered) row. + * This is a pointer into big_prev_row + */ + png_bytep row_buf; /* buffer to save current (unfiltered) row. + * This is a pointer into big_row_buf + */ png_bytep sub_row; /* buffer to save "sub" row when filtering */ png_bytep up_row; /* buffer to save "up" row when filtering */ png_bytep avg_row; /* buffer to save "avg" row when filtering */ png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ - png_row_info row_info; /* used for transformation routines */ png_size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */ png_uint_32 idat_size; /* current IDAT size for read */ @@ -118,7 +122,6 @@ struct png_struct_def png_colorp palette; /* palette from the input file */ png_uint_16 num_palette; /* number of color entries in palette */ png_uint_16 num_trans; /* number of transparency values */ - png_byte chunk_name[5]; /* null-terminated name of current chunk */ png_byte compression; /* file compression type (always 0) */ png_byte filter; /* file filter type (always 0) */ png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ @@ -126,11 +129,17 @@ struct png_struct_def png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ png_byte color_type; /* color type of file */ png_byte bit_depth; /* bit depth of file */ - png_byte usr_bit_depth; /* bit depth of users row */ + png_byte usr_bit_depth; /* bit depth of users row: write only */ png_byte pixel_depth; /* number of bits per pixel */ png_byte channels; /* number of channels in file */ - png_byte usr_channels; /* channels at start of write */ + png_byte usr_channels; /* channels at start of write: write only */ png_byte sig_bytes; /* magic bytes read/written from start of file */ + png_byte maximum_pixel_depth; + /* pixel depth used for the row buffers */ + png_byte transformed_pixel_depth; + /* pixel depth after read/write transforms */ + png_byte io_chunk_string[5]; + /* string name of chunk */ #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) png_uint_16 filler; /* filler bytes for pixel expansion */ @@ -152,19 +161,21 @@ struct png_struct_def png_uint_32 flush_rows; /* number of rows written since last flush */ #endif -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) +#ifdef PNG_READ_GAMMA_SUPPORTED int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */ png_fixed_point gamma; /* file gamma value */ png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */ -#endif -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) png_bytep gamma_table; /* gamma table for 8-bit depth files */ + png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ +#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ + defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \ + defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) png_bytep gamma_from_1; /* converts from 1.0 to screen */ png_bytep gamma_to_1; /* converts from file to 1.0 */ - png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ +#endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */ #endif #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) @@ -329,9 +340,8 @@ struct png_struct_def png_unknown_chunk unknown_chunk; #endif -/* New members added in libpng-1.2.26 */ +/* New member added in libpng-1.2.26 */ png_size_t old_big_row_buf_size; - png_size_t old_prev_row_size; /* New member added in libpng-1.2.30 */ png_charp chunkdata; /* buffer for reading chunk data */ @@ -340,5 +350,11 @@ struct png_struct_def /* New member added in libpng-1.4.0 */ png_uint_32 io_state; #endif + +/* New member added in libpng-1.5.6 */ + png_bytep big_prev_row; + + void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info, + png_bytep row, png_const_bytep prev_row); }; #endif /* PNGSTRUCT_H */ diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngtest.c b/Build/source/libs/libpng/libpng-1.5.7/pngtest.c index 4bb24f3829b..c52aef3e6b5 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngtest.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngtest.c @@ -1,7 +1,7 @@ /* pngtest.c - a simple test program to test libpng * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.6 [November 3, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -98,6 +98,7 @@ static char tIME_string[PNG_tIME_STRING_LENGTH] = "tIME chunk is not present"; #endif static int verbose = 0; +static int strict = 0; int test_one_file PNGARG((PNG_CONST char *inname, PNG_CONST char *outname)); @@ -1162,6 +1163,10 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) if (png_get_text(read_ptr, read_info_ptr, &text_ptr, &num_text) > 0) { pngtest_debug1("Handling %d iTXt/tEXt/zTXt chunks", num_text); + + if (verbose) + printf("\nText compression=%d\n", text_ptr->compression); + png_set_text(write_ptr, write_info_ptr, text_ptr, num_text); } } @@ -1479,7 +1484,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) FCLOSE(fpin); FCLOSE(fpout); - return (0); + + if (strict != 0) + return (1); + + else + return (0); } if (!num_in) @@ -1504,7 +1514,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) FCLOSE(fpin); FCLOSE(fpout); - return (0); + + if (strict != 0) + return (1); + + else + return (0); } } @@ -1586,6 +1601,14 @@ main(int argc, char *argv[]) inname = argv[2]; } + else if (strcmp(argv[1], "--strict") == 0) + { + status_dots_requested = 0; + verbose = 1; + inname = argv[2]; + strict++; + } + else { inname = argv[1]; @@ -1794,4 +1817,4 @@ main(int argc, char *argv[]) } /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_5_5 Your_png_h_is_not_version_1_5_5; +typedef png_libpng_version_1_5_7 Your_png_h_is_not_version_1_5_7; diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngtest.png b/Build/source/libs/libpng/libpng-1.5.7/pngtest.png Binary files differindex 81f5f8438a9..81f5f8438a9 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngtest.png +++ b/Build/source/libs/libpng/libpng-1.5.7/pngtest.png diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngtrans.c b/Build/source/libs/libpng/libpng-1.5.7/pngtrans.c index 6a6908dcd26..6a6908dcd26 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngtrans.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngtrans.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngwio.c b/Build/source/libs/libpng/libpng-1.5.7/pngwio.c index 95ffb3429f1..95ffb3429f1 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngwio.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngwio.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngwrite.c b/Build/source/libs/libpng/libpng-1.5.7/pngwrite.c index d1af9e899fb..6d3fd4c3861 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngwrite.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngwrite.c @@ -1,7 +1,7 @@ /* pngwrite.c - general routines to write a PNG file * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.7 [December 15, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -490,8 +490,9 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr, #ifdef PNG_SETJMP_SUPPORTED /* Applications that neglect to set up their own setjmp() and then - encounter a png_error() will longjmp here. Since the jmpbuf is - then meaningless we abort instead of returning. */ + * encounter a png_error() will longjmp here. Since the jmpbuf is + * then meaningless we abort instead of returning. + */ #ifdef USE_FAR_KEYWORD if (setjmp(tmp_jmpbuf)) #else @@ -608,6 +609,9 @@ png_write_image(png_structp png_ptr, png_bytepp image) void PNGAPI png_write_row(png_structp png_ptr, png_const_bytep row) { + /* 1.5.6: moved from png_struct to be a local structure: */ + png_row_info row_info; + if (png_ptr == NULL) return; @@ -731,36 +735,31 @@ png_write_row(png_structp png_ptr, png_const_bytep row) #endif /* Set up row info for transformations */ - png_ptr->row_info.color_type = png_ptr->color_type; - png_ptr->row_info.width = png_ptr->usr_width; - png_ptr->row_info.channels = png_ptr->usr_channels; - png_ptr->row_info.bit_depth = png_ptr->usr_bit_depth; - png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth * - png_ptr->row_info.channels); - - png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->row_info.width); - - png_debug1(3, "row_info->color_type = %d", png_ptr->row_info.color_type); - png_debug1(3, "row_info->width = %u", png_ptr->row_info.width); - png_debug1(3, "row_info->channels = %d", png_ptr->row_info.channels); - png_debug1(3, "row_info->bit_depth = %d", png_ptr->row_info.bit_depth); - png_debug1(3, "row_info->pixel_depth = %d", png_ptr->row_info.pixel_depth); - png_debug1(3, "row_info->rowbytes = %lu", - (unsigned long)png_ptr->row_info.rowbytes); + row_info.color_type = png_ptr->color_type; + row_info.width = png_ptr->usr_width; + row_info.channels = png_ptr->usr_channels; + row_info.bit_depth = png_ptr->usr_bit_depth; + row_info.pixel_depth = (png_byte)(row_info.bit_depth * row_info.channels); + row_info.rowbytes = PNG_ROWBYTES(row_info.pixel_depth, row_info.width); + + png_debug1(3, "row_info->color_type = %d", row_info.color_type); + png_debug1(3, "row_info->width = %u", row_info.width); + png_debug1(3, "row_info->channels = %d", row_info.channels); + png_debug1(3, "row_info->bit_depth = %d", row_info.bit_depth); + png_debug1(3, "row_info->pixel_depth = %d", row_info.pixel_depth); + png_debug1(3, "row_info->rowbytes = %lu", (unsigned long)row_info.rowbytes); /* Copy user's row into buffer, leaving room for filter byte. */ - png_memcpy(png_ptr->row_buf + 1, row, png_ptr->row_info.rowbytes); + png_memcpy(png_ptr->row_buf + 1, row, row_info.rowbytes); #ifdef PNG_WRITE_INTERLACING_SUPPORTED /* Handle interlacing */ if (png_ptr->interlaced && png_ptr->pass < 6 && (png_ptr->transformations & PNG_INTERLACE)) { - png_do_write_interlace(&(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->pass); + png_do_write_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass); /* This should always get caught above, but still ... */ - if (!(png_ptr->row_info.width)) + if (!(row_info.width)) { png_write_finish_row(png_ptr); return; @@ -771,9 +770,16 @@ png_write_row(png_structp png_ptr, png_const_bytep row) #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED /* Handle other transformations */ if (png_ptr->transformations) - png_do_write_transformations(png_ptr); + png_do_write_transformations(png_ptr, &row_info); #endif + /* At this point the row_info pixel depth must match the 'transformed' depth, + * which is also the output depth. + */ + if (row_info.pixel_depth != png_ptr->pixel_depth || + row_info.pixel_depth != png_ptr->transformed_pixel_depth) + png_error(png_ptr, "internal write transform logic error"); + #ifdef PNG_MNG_FEATURES_SUPPORTED /* Write filter_method 64 (intrapixel differencing) only if * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and @@ -788,12 +794,12 @@ png_write_row(png_structp png_ptr, png_const_bytep row) (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING)) { /* Intrapixel differencing */ - png_do_write_intrapixel(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_write_intrapixel(&row_info, png_ptr->row_buf + 1); } #endif /* Find a filter if necessary, filter the row and write it out. */ - png_write_find_filter(png_ptr, &(png_ptr->row_info)); + png_write_find_filter(png_ptr, &row_info); if (png_ptr->write_row_fn != NULL) (*(png_ptr->write_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass); @@ -879,13 +885,7 @@ png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr) png_debug(1, "in png_destroy_write_struct"); if (png_ptr_ptr != NULL) - { png_ptr = *png_ptr_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - free_fn = png_ptr->free_fn; - mem_ptr = png_ptr->mem_ptr; -#endif - } #ifdef PNG_USER_MEM_SUPPORTED if (png_ptr != NULL) diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngwtran.c b/Build/source/libs/libpng/libpng-1.5.7/pngwtran.c index 124d708c4a3..96608efcb4a 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngwtran.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngwtran.c @@ -1,7 +1,7 @@ /* pngwtran.c - transforms the data in a row for PNG writers * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.6 [November 3, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -20,7 +20,7 @@ * transformations is significant. */ void /* PRIVATE */ -png_do_write_transformations(png_structp png_ptr) +png_do_write_transformations(png_structp png_ptr, png_row_infop row_info) { png_debug(1, "in png_do_write_transformations"); @@ -32,8 +32,8 @@ png_do_write_transformations(png_structp png_ptr) if (png_ptr->write_user_transform_fn != NULL) (*(png_ptr->write_user_transform_fn)) /* User write transform function */ - (png_ptr, /* png_ptr */ - &(png_ptr->row_info), /* row_info: */ + (png_ptr, /* png_ptr */ + row_info, /* row_info: */ /* png_uint_32 width; width of row */ /* png_size_t rowbytes; number of bytes in row */ /* png_byte color_type; color type of pixels */ @@ -45,50 +45,50 @@ png_do_write_transformations(png_structp png_ptr) #ifdef PNG_WRITE_FILLER_SUPPORTED if (png_ptr->transformations & PNG_FILLER) - png_do_strip_channel(&(png_ptr->row_info), png_ptr->row_buf + 1, + png_do_strip_channel(row_info, png_ptr->row_buf + 1, !(png_ptr->flags & PNG_FLAG_FILLER_AFTER)); #endif #ifdef PNG_WRITE_PACKSWAP_SUPPORTED if (png_ptr->transformations & PNG_PACKSWAP) - png_do_packswap(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_packswap(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_WRITE_PACK_SUPPORTED if (png_ptr->transformations & PNG_PACK) - png_do_pack(&(png_ptr->row_info), png_ptr->row_buf + 1, + png_do_pack(row_info, png_ptr->row_buf + 1, (png_uint_32)png_ptr->bit_depth); #endif #ifdef PNG_WRITE_SWAP_SUPPORTED if (png_ptr->transformations & PNG_SWAP_BYTES) - png_do_swap(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_swap(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_WRITE_SHIFT_SUPPORTED if (png_ptr->transformations & PNG_SHIFT) - png_do_shift(&(png_ptr->row_info), png_ptr->row_buf + 1, + png_do_shift(row_info, png_ptr->row_buf + 1, &(png_ptr->shift)); #endif #ifdef 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); + png_do_write_swap_alpha(row_info, png_ptr->row_buf + 1); #endif #ifdef 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); + png_do_write_invert_alpha(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_WRITE_BGR_SUPPORTED if (png_ptr->transformations & PNG_BGR) - png_do_bgr(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_bgr(row_info, png_ptr->row_buf + 1); #endif #ifdef PNG_WRITE_INVERT_SUPPORTED if (png_ptr->transformations & PNG_INVERT_MONO) - png_do_invert(&(png_ptr->row_info), png_ptr->row_buf + 1); + png_do_invert(row_info, png_ptr->row_buf + 1); #endif } diff --git a/Build/source/libs/libpng/libpng-1.5.5/pngwutil.c b/Build/source/libs/libpng/libpng-1.5.7/pngwutil.c index bc3e4dd9dad..da18e9502ef 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/pngwutil.c +++ b/Build/source/libs/libpng/libpng-1.5.7/pngwutil.c @@ -1,7 +1,7 @@ /* pngwutil.c - utilities to write a PNG file * - * Last changed in libpng 1.5.5 [September 22, 2011] + * Last changed in libpng 1.5.6 [November 3, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -82,39 +82,20 @@ png_write_sig(png_structp png_ptr) png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE; } -/* Write a PNG chunk all at once. The type is an array of ASCII characters - * representing the chunk name. The array must be at least 4 bytes in - * length, and does not need to be null terminated. To be safe, pass the - * pre-defined chunk names here, and if you need a new one, define it - * where the others are defined. The length is the length of the data. - * All the data must be present. If that is not possible, use the - * png_write_chunk_start(), png_write_chunk_data(), and png_write_chunk_end() - * functions instead. - */ -void PNGAPI -png_write_chunk(png_structp png_ptr, png_const_bytep chunk_name, - png_const_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, (png_size_t)length); - png_write_chunk_end(png_ptr); -} - /* Write the start of a PNG chunk. The type is the chunk type. * The total_length is the sum of the lengths of all the data you will be * passing in png_write_chunk_data(). */ -void PNGAPI -png_write_chunk_start(png_structp png_ptr, png_const_bytep chunk_name, +static void +png_write_chunk_header(png_structp png_ptr, png_uint_32 chunk_name, png_uint_32 length) { png_byte buf[8]; - png_debug2(0, "Writing %s chunk, length = %lu", chunk_name, - (unsigned long)length); +#if defined(PNG_DEBUG) && (PNG_DEBUG > 0) + PNG_CSTRING_FROM_CHUNK(buf, chunk_name); + png_debug2(0, "Writing %s chunk, length = %lu", buf, (unsigned long)length); +#endif if (png_ptr == NULL) return; @@ -128,16 +109,16 @@ png_write_chunk_start(png_structp png_ptr, png_const_bytep chunk_name, /* Write the length and the chunk name */ png_save_uint_32(buf, length); - png_memcpy(buf + 4, chunk_name, 4); - png_write_data(png_ptr, buf, (png_size_t)8); + png_save_uint_32(buf + 4, chunk_name); + png_write_data(png_ptr, buf, 8); /* Put the chunk name into png_ptr->chunk_name */ - png_memcpy(png_ptr->chunk_name, chunk_name, 4); + png_ptr->chunk_name = chunk_name; /* Reset the crc and run it over the chunk name */ png_reset_crc(png_ptr); - png_calculate_crc(png_ptr, chunk_name, 4); + png_calculate_crc(png_ptr, buf + 4, 4); #ifdef PNG_IO_STATE_SUPPORTED /* Inform the I/O callback that chunk data will (possibly) be written. @@ -147,10 +128,17 @@ png_write_chunk_start(png_structp png_ptr, png_const_bytep chunk_name, #endif } -/* Write the data of a PNG chunk started with png_write_chunk_start(). +void PNGAPI +png_write_chunk_start(png_structp png_ptr, png_const_bytep chunk_string, + png_uint_32 length) +{ + png_write_chunk_header(png_ptr, PNG_CHUNK_FROM_STRING(chunk_string), length); +} + +/* Write the data of a PNG chunk started with png_write_chunk_header(). * Note that multiple calls to this function are allowed, and that the * sum of the lengths from these calls *must* add up to the total_length - * given to png_write_chunk_start(). + * given to png_write_chunk_header(). */ void PNGAPI png_write_chunk_data(png_structp png_ptr, png_const_bytep data, @@ -171,7 +159,7 @@ png_write_chunk_data(png_structp png_ptr, png_const_bytep data, } } -/* Finish a chunk started with png_write_chunk_start(). */ +/* Finish a chunk started with png_write_chunk_header(). */ void PNGAPI png_write_chunk_end(png_structp png_ptr) { @@ -192,6 +180,40 @@ png_write_chunk_end(png_structp png_ptr) png_write_data(png_ptr, buf, (png_size_t)4); } +/* Write a PNG chunk all at once. The type is an array of ASCII characters + * representing the chunk name. The array must be at least 4 bytes in + * length, and does not need to be null terminated. To be safe, pass the + * pre-defined chunk names here, and if you need a new one, define it + * where the others are defined. The length is the length of the data. + * All the data must be present. If that is not possible, use the + * png_write_chunk_start(), png_write_chunk_data(), and png_write_chunk_end() + * functions instead. + */ +static void +png_write_complete_chunk(png_structp png_ptr, png_uint_32 chunk_name, + png_const_bytep data, png_size_t length) +{ + if (png_ptr == NULL) + return; + + /* On 64 bit architectures 'length' may not fit in a png_uint_32. */ + if (length > PNG_UINT_32_MAX) + png_error(png_ptr, "length exceeds PNG maxima"); + + png_write_chunk_header(png_ptr, chunk_name, (png_uint_32)length); + png_write_chunk_data(png_ptr, data, length); + png_write_chunk_end(png_ptr); +} + +/* This is the API that calls the internal function above. */ +void PNGAPI +png_write_chunk(png_structp png_ptr, png_const_bytep chunk_string, + png_const_bytep data, png_size_t length) +{ + png_write_complete_chunk(png_ptr, PNG_CHUNK_FROM_STRING(chunk_string), data, + length); +} + /* Initialize the compressor for the appropriate type of compression. */ static void png_zlib_claim(png_structp png_ptr, png_uint_32 state) @@ -560,7 +582,10 @@ png_write_compressed_data_out(png_structp png_ptr, compression_state *comp) } #ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED - if (comp->input_len >= 2 && comp->input_len < 16384) + /* The zbuf_size test is because the code below doesn't work if zbuf_size is + * '1'; simply skip it to avoid memory overwrite. + */ + if (comp->input_len >= 2 && comp->input_len < 16384 && png_ptr->zbuf_size > 1) { unsigned int z_cmf; /* zlib compression method and flags */ @@ -652,8 +677,6 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int compression_type, int filter_type, int interlace_type) { - PNG_IHDR; - png_byte buf[13]; /* Buffer to store the IHDR info */ png_debug(1, "in png_write_IHDR"); @@ -795,7 +818,7 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height, buf[12] = (png_byte)interlace_type; /* Write the chunk */ - png_write_chunk(png_ptr, png_IHDR, buf, (png_size_t)13); + png_write_complete_chunk(png_ptr, png_IHDR, buf, (png_size_t)13); /* Initialize zlib with PNG info */ png_ptr->zstream.zalloc = png_zalloc; @@ -872,7 +895,6 @@ void /* PRIVATE */ png_write_PLTE(png_structp png_ptr, png_const_colorp palette, png_uint_32 num_pal) { - PNG_PLTE; png_uint_32 i; png_const_colorp pal_ptr; png_byte buf[3]; @@ -908,7 +930,7 @@ png_write_PLTE(png_structp png_ptr, png_const_colorp palette, png_ptr->num_palette = (png_uint_16)num_pal; png_debug1(3, "num_palette = %d", png_ptr->num_palette); - png_write_chunk_start(png_ptr, png_PLTE, (png_uint_32)(num_pal * 3)); + png_write_chunk_header(png_ptr, png_PLTE, (png_uint_32)(num_pal * 3)); #ifdef PNG_POINTER_INDEXING_SUPPORTED for (i = 0, pal_ptr = palette; i < num_pal; i++, pal_ptr++) @@ -942,8 +964,6 @@ png_write_PLTE(png_structp png_ptr, png_const_colorp palette, void /* PRIVATE */ png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length) { - PNG_IDAT; - png_debug(1, "in png_write_IDAT"); #ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED @@ -1014,7 +1034,7 @@ png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length) } #endif /* PNG_WRITE_OPTIMIZE_CMF_SUPPORTED */ - png_write_chunk(png_ptr, png_IDAT, data, length); + png_write_complete_chunk(png_ptr, png_IDAT, data, length); png_ptr->mode |= PNG_HAVE_IDAT; /* Prior to 1.5.4 this code was replicated in every caller (except at the @@ -1029,11 +1049,9 @@ png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length) void /* PRIVATE */ png_write_IEND(png_structp png_ptr) { - PNG_IEND; - png_debug(1, "in png_write_IEND"); - png_write_chunk(png_ptr, png_IEND, NULL, (png_size_t)0); + png_write_complete_chunk(png_ptr, png_IEND, NULL, (png_size_t)0); png_ptr->mode |= PNG_HAVE_IEND; } @@ -1042,14 +1060,13 @@ png_write_IEND(png_structp png_ptr) void /* PRIVATE */ png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma) { - PNG_gAMA; png_byte buf[4]; png_debug(1, "in png_write_gAMA"); /* file_gamma is saved in 1/100,000ths */ png_save_uint_32(buf, (png_uint_32)file_gamma); - png_write_chunk(png_ptr, png_gAMA, buf, (png_size_t)4); + png_write_complete_chunk(png_ptr, png_gAMA, buf, (png_size_t)4); } #endif @@ -1058,7 +1075,6 @@ png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma) void /* PRIVATE */ png_write_sRGB(png_structp png_ptr, int srgb_intent) { - PNG_sRGB; png_byte buf[1]; png_debug(1, "in png_write_sRGB"); @@ -1068,7 +1084,7 @@ png_write_sRGB(png_structp png_ptr, int srgb_intent) "Invalid sRGB rendering intent specified"); buf[0]=(png_byte)srgb_intent; - png_write_chunk(png_ptr, png_sRGB, buf, (png_size_t)1); + png_write_complete_chunk(png_ptr, png_sRGB, buf, (png_size_t)1); } #endif @@ -1078,7 +1094,6 @@ void /* PRIVATE */ png_write_iCCP(png_structp png_ptr, png_const_charp name, int compression_type, png_const_charp profile, int profile_len) { - PNG_iCCP; png_size_t name_len; png_charp new_name; compression_state comp; @@ -1139,7 +1154,7 @@ png_write_iCCP(png_structp png_ptr, png_const_charp name, int compression_type, (png_size_t)profile_len, PNG_COMPRESSION_TYPE_BASE, &comp); /* Make sure we include the NULL after the name and the compression type */ - png_write_chunk_start(png_ptr, png_iCCP, + png_write_chunk_header(png_ptr, png_iCCP, (png_uint_32)(name_len + profile_len + 2)); new_name[name_len + 1] = 0x00; @@ -1163,7 +1178,6 @@ png_write_iCCP(png_structp png_ptr, png_const_charp name, int compression_type, void /* PRIVATE */ png_write_sPLT(png_structp png_ptr, png_const_sPLT_tp spalette) { - PNG_sPLT; png_size_t name_len; png_charp new_name; png_byte entrybuf[10]; @@ -1180,7 +1194,7 @@ png_write_sPLT(png_structp png_ptr, png_const_sPLT_tp spalette) return; /* Make sure we include the NULL after the name */ - png_write_chunk_start(png_ptr, png_sPLT, + png_write_chunk_header(png_ptr, png_sPLT, (png_uint_32)(name_len + 2 + palette_size)); png_write_chunk_data(png_ptr, (png_bytep)new_name, @@ -1248,7 +1262,6 @@ png_write_sPLT(png_structp png_ptr, png_const_sPLT_tp spalette) void /* PRIVATE */ png_write_sBIT(png_structp png_ptr, png_const_color_8p sbit, int color_type) { - PNG_sBIT; png_byte buf[4]; png_size_t size; @@ -1299,7 +1312,7 @@ png_write_sBIT(png_structp png_ptr, png_const_color_8p sbit, int color_type) buf[size++] = sbit->alpha; } - png_write_chunk(png_ptr, png_sBIT, buf, size); + png_write_complete_chunk(png_ptr, png_sBIT, buf, size); } #endif @@ -1311,7 +1324,6 @@ png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x, png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x, png_fixed_point blue_y) { - PNG_cHRM; png_byte buf[32]; png_debug(1, "in png_write_cHRM"); @@ -1334,7 +1346,7 @@ png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x, png_save_uint_32(buf + 24, (png_uint_32)blue_x); png_save_uint_32(buf + 28, (png_uint_32)blue_y); - png_write_chunk(png_ptr, png_cHRM, buf, (png_size_t)32); + png_write_complete_chunk(png_ptr, png_cHRM, buf, (png_size_t)32); } } #endif @@ -1345,7 +1357,6 @@ void /* PRIVATE */ png_write_tRNS(png_structp png_ptr, png_const_bytep trans_alpha, png_const_color_16p tran, int num_trans, int color_type) { - PNG_tRNS; png_byte buf[6]; png_debug(1, "in png_write_tRNS"); @@ -1359,7 +1370,7 @@ png_write_tRNS(png_structp png_ptr, png_const_bytep trans_alpha, } /* Write the chunk out as it is */ - png_write_chunk(png_ptr, png_tRNS, trans_alpha, (png_size_t)num_trans); + png_write_complete_chunk(png_ptr, png_tRNS, trans_alpha, (png_size_t)num_trans); } else if (color_type == PNG_COLOR_TYPE_GRAY) @@ -1374,7 +1385,7 @@ png_write_tRNS(png_structp png_ptr, png_const_bytep trans_alpha, } png_save_uint_16(buf, tran->gray); - png_write_chunk(png_ptr, png_tRNS, buf, (png_size_t)2); + png_write_complete_chunk(png_ptr, png_tRNS, buf, (png_size_t)2); } else if (color_type == PNG_COLOR_TYPE_RGB) @@ -1394,7 +1405,7 @@ png_write_tRNS(png_structp png_ptr, png_const_bytep trans_alpha, return; } - png_write_chunk(png_ptr, png_tRNS, buf, (png_size_t)6); + png_write_complete_chunk(png_ptr, png_tRNS, buf, (png_size_t)6); } else @@ -1409,7 +1420,6 @@ png_write_tRNS(png_structp png_ptr, png_const_bytep trans_alpha, void /* PRIVATE */ png_write_bKGD(png_structp png_ptr, png_const_color_16p back, int color_type) { - PNG_bKGD; png_byte buf[6]; png_debug(1, "in png_write_bKGD"); @@ -1428,7 +1438,7 @@ png_write_bKGD(png_structp png_ptr, png_const_color_16p back, int color_type) } buf[0] = back->index; - png_write_chunk(png_ptr, png_bKGD, buf, (png_size_t)1); + png_write_complete_chunk(png_ptr, png_bKGD, buf, (png_size_t)1); } else if (color_type & PNG_COLOR_MASK_COLOR) @@ -1448,7 +1458,7 @@ png_write_bKGD(png_structp png_ptr, png_const_color_16p back, int color_type) return; } - png_write_chunk(png_ptr, png_bKGD, buf, (png_size_t)6); + png_write_complete_chunk(png_ptr, png_bKGD, buf, (png_size_t)6); } else @@ -1462,7 +1472,7 @@ png_write_bKGD(png_structp png_ptr, png_const_color_16p back, int color_type) } png_save_uint_16(buf, back->gray); - png_write_chunk(png_ptr, png_bKGD, buf, (png_size_t)2); + png_write_complete_chunk(png_ptr, png_bKGD, buf, (png_size_t)2); } } #endif @@ -1472,7 +1482,6 @@ png_write_bKGD(png_structp png_ptr, png_const_color_16p back, int color_type) void /* PRIVATE */ png_write_hIST(png_structp png_ptr, png_const_uint_16p hist, int num_hist) { - PNG_hIST; int i; png_byte buf[3]; @@ -1487,7 +1496,7 @@ png_write_hIST(png_structp png_ptr, png_const_uint_16p hist, int num_hist) return; } - png_write_chunk_start(png_ptr, png_hIST, (png_uint_32)(num_hist * 2)); + png_write_chunk_header(png_ptr, png_hIST, (png_uint_32)(num_hist * 2)); for (i = 0; i < num_hist; i++) { @@ -1637,7 +1646,6 @@ void /* PRIVATE */ png_write_tEXt(png_structp png_ptr, png_const_charp key, png_const_charp text, png_size_t text_len) { - PNG_tEXt; png_size_t key_len; png_charp new_key; @@ -1653,7 +1661,7 @@ png_write_tEXt(png_structp png_ptr, png_const_charp key, png_const_charp text, text_len = png_strlen(text); /* Make sure we include the 0 after the key */ - png_write_chunk_start(png_ptr, png_tEXt, + png_write_chunk_header(png_ptr, png_tEXt, (png_uint_32)(key_len + text_len + 1)); /* * We leave it to the application to meet PNG-1.0 requirements on the @@ -1679,7 +1687,6 @@ void /* PRIVATE */ png_write_zTXt(png_structp png_ptr, png_const_charp key, png_const_charp text, png_size_t text_len, int compression) { - PNG_zTXt; png_size_t key_len; png_byte buf; png_charp new_key; @@ -1713,7 +1720,7 @@ png_write_zTXt(png_structp png_ptr, png_const_charp key, png_const_charp text, &comp); /* Write start of chunk */ - png_write_chunk_start(png_ptr, png_zTXt, + png_write_chunk_header(png_ptr, png_zTXt, (png_uint_32)(key_len+text_len + 2)); /* Write key */ @@ -1742,7 +1749,6 @@ void /* PRIVATE */ png_write_iTXt(png_structp png_ptr, int compression, png_const_charp key, png_const_charp lang, png_const_charp lang_key, png_const_charp text) { - PNG_iTXt; png_size_t lang_len, key_len, lang_key_len, text_len; png_charp new_lang; png_charp new_key = NULL; @@ -1787,7 +1793,7 @@ png_write_iTXt(png_structp png_ptr, int compression, png_const_charp key, * and the NULs after the key, lang, and lang_key parts */ - png_write_chunk_start(png_ptr, png_iTXt, (png_uint_32)( + png_write_chunk_header(png_ptr, png_iTXt, (png_uint_32)( 5 /* comp byte, comp flag, terminators for key, lang and lang_key */ + key_len + lang_len @@ -1836,7 +1842,6 @@ void /* PRIVATE */ png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset, int unit_type) { - PNG_oFFs; png_byte buf[9]; png_debug(1, "in png_write_oFFs"); @@ -1848,7 +1853,7 @@ png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset, png_save_int_32(buf + 4, y_offset); buf[8] = (png_byte)unit_type; - png_write_chunk(png_ptr, png_oFFs, buf, (png_size_t)9); + png_write_complete_chunk(png_ptr, png_oFFs, buf, (png_size_t)9); } #endif #ifdef PNG_WRITE_pCAL_SUPPORTED @@ -1858,7 +1863,6 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_const_charp units, png_charpp params) { - PNG_pCAL; png_size_t purpose_len, units_len, total_len; png_size_tp params_len; png_byte buf[10]; @@ -1891,7 +1895,7 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0, } png_debug1(3, "pCAL total length = %d", (int)total_len); - png_write_chunk_start(png_ptr, png_pCAL, (png_uint_32)total_len); + png_write_chunk_header(png_ptr, png_pCAL, (png_uint_32)total_len); png_write_chunk_data(png_ptr, (png_const_bytep)new_purpose, purpose_len); png_save_int_32(buf, X0); png_save_int_32(buf + 4, X1); @@ -1918,7 +1922,6 @@ void /* PRIVATE */ png_write_sCAL_s(png_structp png_ptr, int unit, png_const_charp width, png_const_charp height) { - PNG_sCAL; png_byte buf[64]; png_size_t wlen, hlen, total_len; @@ -1939,7 +1942,7 @@ png_write_sCAL_s(png_structp png_ptr, int unit, png_const_charp width, png_memcpy(buf + wlen + 2, height, hlen); /* Do NOT append the '\0' here */ png_debug1(3, "sCAL total length = %u", (unsigned int)total_len); - png_write_chunk(png_ptr, png_sCAL, buf, total_len); + png_write_complete_chunk(png_ptr, png_sCAL, buf, total_len); } #endif @@ -1950,7 +1953,6 @@ png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, int unit_type) { - PNG_pHYs; png_byte buf[9]; png_debug(1, "in png_write_pHYs"); @@ -1962,7 +1964,7 @@ png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit, png_save_uint_32(buf + 4, y_pixels_per_unit); buf[8] = (png_byte)unit_type; - png_write_chunk(png_ptr, png_pHYs, buf, (png_size_t)9); + png_write_complete_chunk(png_ptr, png_pHYs, buf, (png_size_t)9); } #endif @@ -1973,7 +1975,6 @@ png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit, void /* PRIVATE */ png_write_tIME(png_structp png_ptr, png_const_timep mod_time) { - PNG_tIME; png_byte buf[7]; png_debug(1, "in png_write_tIME"); @@ -1993,7 +1994,7 @@ png_write_tIME(png_structp png_ptr, png_const_timep mod_time) buf[5] = mod_time->minute; buf[6] = mod_time->second; - png_write_chunk(png_ptr, png_tIME, buf, (png_size_t)7); + png_write_complete_chunk(png_ptr, png_tIME, buf, (png_size_t)7); } #endif @@ -2005,28 +2006,32 @@ png_write_start_row(png_structp png_ptr) /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ - int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* Offset to next interlace block */ - int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; /* Start of interlace block in the y direction */ - int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; + static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; /* Offset to next interlace block in the y direction */ - int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; #endif - png_size_t buf_size; + png_alloc_size_t buf_size; + int usr_pixel_depth; png_debug(1, "in png_write_start_row"); - buf_size = (png_size_t)(PNG_ROWBYTES( - png_ptr->usr_channels*png_ptr->usr_bit_depth, png_ptr->width) + 1); + usr_pixel_depth = png_ptr->usr_channels * png_ptr->usr_bit_depth; + buf_size = PNG_ROWBYTES(usr_pixel_depth, png_ptr->width) + 1; + + /* 1.5.6: added to allow checking in the row write code. */ + png_ptr->transformed_pixel_depth = png_ptr->pixel_depth; + png_ptr->maximum_pixel_depth = (png_byte)usr_pixel_depth; /* Set up row buffer */ - png_ptr->row_buf = (png_bytep)png_malloc(png_ptr, - (png_alloc_size_t)buf_size); + png_ptr->row_buf = (png_bytep)png_malloc(png_ptr, buf_size); png_ptr->row_buf[0] = PNG_FILTER_VALUE_NONE; @@ -2043,8 +2048,7 @@ png_write_start_row(png_structp png_ptr) if (png_ptr->do_filter & (PNG_FILTER_AVG | PNG_FILTER_UP | PNG_FILTER_PAETH)) { /* Set up previous row buffer */ - png_ptr->prev_row = (png_bytep)png_calloc(png_ptr, - (png_alloc_size_t)buf_size); + png_ptr->prev_row = (png_bytep)png_calloc(png_ptr, buf_size); if (png_ptr->do_filter & PNG_FILTER_UP) { @@ -2112,16 +2116,16 @@ png_write_finish_row(png_structp png_ptr) /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ - int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* Offset to next interlace block */ - int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; /* Start of interlace block in the y direction */ - int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; + static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; /* Offset to next interlace block in the y direction */ - int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; #endif int ret; @@ -2239,10 +2243,10 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass) /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ - int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* Offset to next interlace block */ - int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; png_debug(1, "in png_do_write_interlace"); @@ -2410,7 +2414,8 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass) * been specified by the application, and then writes the row out with the * chosen filter. */ -static void png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row); +static void png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row, + png_size_t row_bytes); #define PNG_MAXSUM (((png_uint_32)(-1)) >> 1) #define PNG_HISHIFT 10 @@ -2426,7 +2431,7 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info) png_byte filter_to_do = png_ptr->do_filter; png_size_t row_bytes = row_info->rowbytes; #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - int num_p_filters = (int)png_ptr->num_prev_filters; + int num_p_filters = png_ptr->num_prev_filters; #endif png_debug(1, "in png_write_find_filter"); @@ -3063,9 +3068,9 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info) } } #endif /* PNG_WRITE_FILTER_SUPPORTED */ - /* Do the actual writing of the filtered row data from the chosen filter. */ - png_write_filtered_row(png_ptr, best_row); + /* Do the actual writing of the filtered row data from the chosen filter. */ + png_write_filtered_row(png_ptr, best_row, row_info->rowbytes+1); #ifdef PNG_WRITE_FILTER_SUPPORTED #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED @@ -3088,10 +3093,9 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info) /* Do the actual writing of a previously filtered row. */ static void -png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row) +png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row, + png_size_t avail/*includes filter byte*/) { - png_size_t avail; - png_debug(1, "in png_write_filtered_row"); png_debug1(2, "filter = %d", filtered_row[0]); @@ -3099,7 +3103,6 @@ png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row) png_ptr->zstream.next_in = filtered_row; png_ptr->zstream.avail_in = 0; - avail = png_ptr->row_info.rowbytes + 1; /* Repeat until we have compressed all the data */ do { diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/libpng.tgt b/Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/libpng.tgt index 096b2eef179..4a9622e68cf 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/libpng.tgt +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/libpng.tgt @@ -1,383 +1,383 @@ -40 -targetIdent -0 -MProject -1 -MComponent -0 -2 -WString -3 -LIB -3 -WString -5 -n_2sn -1 -0 -0 -4 -MCommand -0 -5 -MCommand -0 -6 -MItem -10 -libpng.lib -7 -WString -3 -LIB -8 -WVList -0 -9 -WVList -1 -10 -ActionStates -11 -WString -5 -&Make -12 -WVList -0 --1 -1 -1 -0 -13 -WPickList -16 -14 -MItem -3 -*.c -15 -WString -4 -COBJ -16 -WVList -2 -17 -MVState -18 -WString -3 -WCC -19 -WString -25 -n????Include directories: -1 -20 -WString -39 -"$(%zlib);$(%watcom)/h;$(%watcom)/h/nt" -0 -21 -MVState -22 -WString -3 -WCC -23 -WString -25 -n????Include directories: -0 -24 -WString -39 -"$(%zlib);$(%watcom)/h;$(%watcom)/h/nt" -0 -25 -WVList -1 -26 -ActionStates -27 -WString -5 -&Make -28 -WVList -0 --1 -1 -1 -0 -29 -MItem -11 -..\..\png.c -30 -WString -4 -COBJ -31 -WVList -0 -32 -WVList -0 -14 -1 -1 -0 -33 -MItem -16 -..\..\pngerror.c -34 -WString -4 -COBJ -35 -WVList -0 -36 -WVList -0 -14 -1 -1 -0 -37 -MItem -14 -..\..\pngget.c -38 -WString -4 -COBJ -39 -WVList -0 -40 -WVList -0 -14 -1 -1 -0 -41 -MItem -14 -..\..\pngmem.c -42 -WString -4 -COBJ -43 -WVList -0 -44 -WVList -0 -14 -1 -1 -0 -45 -MItem -16 -..\..\pngpread.c -46 -WString -4 -COBJ -47 -WVList -0 -48 -WVList -0 -14 -1 -1 -0 -49 -MItem -15 -..\..\pngread.c -50 -WString -4 -COBJ -51 -WVList -0 -52 -WVList -0 -14 -1 -1 -0 -53 -MItem -14 -..\..\pngrio.c -54 -WString -4 -COBJ -55 -WVList -0 -56 -WVList -0 -14 -1 -1 -0 -57 -MItem -16 -..\..\pngrtran.c -58 -WString -4 -COBJ -59 -WVList -0 -60 -WVList -0 -14 -1 -1 -0 -61 -MItem -16 -..\..\pngrutil.c -62 -WString -4 -COBJ -63 -WVList -0 -64 -WVList -0 -14 -1 -1 -0 -65 -MItem -14 -..\..\pngset.c -66 -WString -4 -COBJ -67 -WVList -0 -68 -WVList -0 -14 -1 -1 -0 -69 -MItem -16 -..\..\pngtrans.c -70 -WString -4 -COBJ -71 -WVList -0 -72 -WVList -0 -14 -1 -1 -0 -73 -MItem -14 -..\..\pngwio.c -74 -WString -4 -COBJ -75 -WVList -0 -76 -WVList -0 -14 -1 -1 -0 -77 -MItem -16 -..\..\pngwrite.c -78 -WString -4 -COBJ -79 -WVList -0 -80 -WVList -0 -14 -1 -1 -0 -81 -MItem -16 -..\..\pngwtran.c -82 -WString -4 -COBJ -83 -WVList -0 -84 -WVList -0 -14 -1 -1 -0 -85 -MItem -16 -..\..\pngwutil.c -86 -WString -4 -COBJ -87 -WVList -0 -88 -WVList -0 -14 -1 -1 -0 +40
+targetIdent
+0
+MProject
+1
+MComponent
+0
+2
+WString
+3
+LIB
+3
+WString
+5
+n_2sn
+1
+0
+0
+4
+MCommand
+0
+5
+MCommand
+0
+6
+MItem
+10
+libpng.lib
+7
+WString
+3
+LIB
+8
+WVList
+0
+9
+WVList
+1
+10
+ActionStates
+11
+WString
+5
+&Make
+12
+WVList
+0
+-1
+1
+1
+0
+13
+WPickList
+16
+14
+MItem
+3
+*.c
+15
+WString
+4
+COBJ
+16
+WVList
+2
+17
+MVState
+18
+WString
+3
+WCC
+19
+WString
+25
+n????Include directories:
+1
+20
+WString
+39
+"$(%zlib);$(%watcom)/h;$(%watcom)/h/nt"
+0
+21
+MVState
+22
+WString
+3
+WCC
+23
+WString
+25
+n????Include directories:
+0
+24
+WString
+39
+"$(%zlib);$(%watcom)/h;$(%watcom)/h/nt"
+0
+25
+WVList
+1
+26
+ActionStates
+27
+WString
+5
+&Make
+28
+WVList
+0
+-1
+1
+1
+0
+29
+MItem
+11
+..\..\png.c
+30
+WString
+4
+COBJ
+31
+WVList
+0
+32
+WVList
+0
+14
+1
+1
+0
+33
+MItem
+16
+..\..\pngerror.c
+34
+WString
+4
+COBJ
+35
+WVList
+0
+36
+WVList
+0
+14
+1
+1
+0
+37
+MItem
+14
+..\..\pngget.c
+38
+WString
+4
+COBJ
+39
+WVList
+0
+40
+WVList
+0
+14
+1
+1
+0
+41
+MItem
+14
+..\..\pngmem.c
+42
+WString
+4
+COBJ
+43
+WVList
+0
+44
+WVList
+0
+14
+1
+1
+0
+45
+MItem
+16
+..\..\pngpread.c
+46
+WString
+4
+COBJ
+47
+WVList
+0
+48
+WVList
+0
+14
+1
+1
+0
+49
+MItem
+15
+..\..\pngread.c
+50
+WString
+4
+COBJ
+51
+WVList
+0
+52
+WVList
+0
+14
+1
+1
+0
+53
+MItem
+14
+..\..\pngrio.c
+54
+WString
+4
+COBJ
+55
+WVList
+0
+56
+WVList
+0
+14
+1
+1
+0
+57
+MItem
+16
+..\..\pngrtran.c
+58
+WString
+4
+COBJ
+59
+WVList
+0
+60
+WVList
+0
+14
+1
+1
+0
+61
+MItem
+16
+..\..\pngrutil.c
+62
+WString
+4
+COBJ
+63
+WVList
+0
+64
+WVList
+0
+14
+1
+1
+0
+65
+MItem
+14
+..\..\pngset.c
+66
+WString
+4
+COBJ
+67
+WVList
+0
+68
+WVList
+0
+14
+1
+1
+0
+69
+MItem
+16
+..\..\pngtrans.c
+70
+WString
+4
+COBJ
+71
+WVList
+0
+72
+WVList
+0
+14
+1
+1
+0
+73
+MItem
+14
+..\..\pngwio.c
+74
+WString
+4
+COBJ
+75
+WVList
+0
+76
+WVList
+0
+14
+1
+1
+0
+77
+MItem
+16
+..\..\pngwrite.c
+78
+WString
+4
+COBJ
+79
+WVList
+0
+80
+WVList
+0
+14
+1
+1
+0
+81
+MItem
+16
+..\..\pngwtran.c
+82
+WString
+4
+COBJ
+83
+WVList
+0
+84
+WVList
+0
+14
+1
+1
+0
+85
+MItem
+16
+..\..\pngwutil.c
+86
+WString
+4
+COBJ
+87
+WVList
+0
+88
+WVList
+0
+14
+1
+1
+0
diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/libpng.wpj b/Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/libpng.wpj index e2e591cf87a..cddf9f1f10e 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/libpng.wpj +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/libpng.wpj @@ -1,92 +1,92 @@ -40 -projectIdent -0 -VpeMain -1 -WRect -256 -146 -8966 -9303 -2 -MProject -3 -MCommand -322 -# Locations of zlib and (if required) awk (change as required:) -set zlib=..\..\..\zlib -set awk= -# -@if not exist pngconfig.dfa $(MAKE) $(__MAKEOPTS__) -f pngconfig.mak defaults -@if exist config.inf type config.inf -@echo Checking for the libpng configuration file pnglibconf.h -$(MAKE) $(__MAKEOPTS__) -f pngconfig.mak -4 -MCommand -19 -@type pngconfig.inf -3 -5 -WFileName -10 -libpng.tgt -6 -WFileName -11 -pngtest.tgt -7 -WFileName -12 -pngvalid.tgt -8 -WVList -3 -9 -VComponent -10 -WRect -0 -0 -5644 -4183 -0 -0 -11 -WFileName -10 -libpng.tgt -0 -0 -12 -VComponent -13 -WRect -1280 -1560 -5644 -4183 -0 -0 -14 -WFileName -11 -pngtest.tgt -0 -1 -15 -VComponent -16 -WRect -530 -507 -5644 -4183 -0 -0 -17 -WFileName -12 -pngvalid.tgt -0 -1 -9 +40
+projectIdent
+0
+VpeMain
+1
+WRect
+256
+0
+8960
+9284
+2
+MProject
+3
+MCommand
+322
+# Locations of zlib and (if required) awk (change as required:)
+set zlib=..\..\..\zlib
+set awk=
+#
+@if not exist pngconfig.dfa $(MAKE) $(__MAKEOPTS__) -f pngconfig.mak defaults
+@if exist config.inf type config.inf
+@echo Checking for the libpng configuration file pnglibconf.h
+$(MAKE) $(__MAKEOPTS__) -f pngconfig.mak
+4
+MCommand
+19
+@type pngconfig.inf
+3
+5
+WFileName
+10
+libpng.tgt
+6
+WFileName
+11
+pngtest.tgt
+7
+WFileName
+12
+pngvalid.tgt
+8
+WVList
+3
+9
+VComponent
+10
+WRect
+0
+0
+5632
+4164
+0
+0
+11
+WFileName
+10
+libpng.tgt
+0
+0
+12
+VComponent
+13
+WRect
+1280
+1540
+5632
+4164
+0
+0
+14
+WFileName
+11
+pngtest.tgt
+0
+1
+15
+VComponent
+16
+WRect
+518
+487
+5632
+4164
+0
+0
+17
+WFileName
+12
+pngvalid.tgt
+0
+1
+9
diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngconfig.mak b/Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/pngconfig.mak index 6943e15d4f7..0f988780513 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngconfig.mak +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/pngconfig.mak @@ -57,9 +57,9 @@ instructions consult and edit projects/openwatcom/pngconfig.dfa << $(DELETE) dfn.c dfn1.out dfn2.out -pnglibconf.dfn: ..\..\scripts\pnglibconf.dfa ..\..\scripts\options.awk pngconfig.dfa +pnglibconf.dfn: ..\..\scripts\pnglibconf.dfa ..\..\scripts\options.awk pngconfig.dfa ..\..\pngconf.h $(DELETE) $@ dfn1.out dfn2.out - $(AWK) -f ..\..\scripts\options.awk out=dfn1.out ..\..\scripts\pnglibconf.dfa pngconfig.dfa $(DFA_XTRA) 1>&2 + $(AWK) -f ..\..\scripts\options.awk out=dfn1.out version=search ..\..\pngconf.h ..\..\scripts\pnglibconf.dfa pngconfig.dfa $(DFA_XTRA) 1>&2 $(AWK) -f ..\..\scripts\options.awk out=dfn2.out dfn1.out 1>&2 $(COPY) dfn2.out $@ $(DELETE) dfn1.out dfn2.out diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngtest.tgt b/Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/pngtest.tgt index ca3db8c3ac4..211f1a74886 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngtest.tgt +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/pngtest.tgt @@ -1,179 +1,179 @@ -40 -targetIdent -0 -MProject -1 -MComponent -0 -2 -WString -4 -NEXE -3 -WString -5 -nc2en -1 -0 -0 -4 -MCommand -0 -5 -MCommand -34 -cd ..\.. -projects\owatcom\pngtest -6 -MItem -11 -pngtest.exe -7 -WString -4 -NEXE -8 -WVList -4 -9 -MVState -10 -WString -7 -WINLINK -11 -WString -28 -?????Library directories(;): -1 -12 -WString -8 -$(%zlib) -0 -13 -MVState -14 -WString -7 -WINLINK -15 -WString -18 -?????Libraries(,): -1 -16 -WString -19 -libpng.lib zlib.lib -0 -17 -MVState -18 -WString -7 -WINLINK -19 -WString -28 -?????Library directories(;): -0 -20 -WString -8 -$(%zlib) -0 -21 -MVState -22 -WString -7 -WINLINK -23 -WString -18 -?????Libraries(,): -0 -24 -WString -19 -libpng.lib zlib.lib -0 -25 -WVList -0 --1 -1 -1 -0 -26 -WPickList -2 -27 -MItem -3 -*.c -28 -WString -4 -COBJ -29 -WVList -2 -30 -MVState -31 -WString -3 -WCC -32 -WString -25 -n????Include directories: -1 -33 -WString -39 -"$(%zlib);$(%watcom)/h;$(%watcom)/h/nt" -0 -34 -MVState -35 -WString -3 -WCC -36 -WString -25 -n????Include directories: -0 -37 -WString -39 -"$(%zlib);$(%watcom)/h;$(%watcom)/h/nt" -0 -38 -WVList -0 --1 -1 -1 -0 -39 -MItem -15 -..\..\pngtest.c -40 -WString -4 -COBJ -41 -WVList -0 -42 -WVList -0 -27 -1 -1 -0 +40
+targetIdent
+0
+MProject
+1
+MComponent
+0
+2
+WString
+4
+NEXE
+3
+WString
+5
+nc2en
+1
+0
+0
+4
+MCommand
+0
+5
+MCommand
+34
+cd ..\..
+projects\owatcom\pngtest
+6
+MItem
+11
+pngtest.exe
+7
+WString
+4
+NEXE
+8
+WVList
+4
+9
+MVState
+10
+WString
+7
+WINLINK
+11
+WString
+28
+?????Library directories(;):
+1
+12
+WString
+8
+$(%zlib)
+0
+13
+MVState
+14
+WString
+7
+WINLINK
+15
+WString
+18
+?????Libraries(,):
+1
+16
+WString
+19
+libpng.lib zlib.lib
+0
+17
+MVState
+18
+WString
+7
+WINLINK
+19
+WString
+28
+?????Library directories(;):
+0
+20
+WString
+8
+$(%zlib)
+0
+21
+MVState
+22
+WString
+7
+WINLINK
+23
+WString
+18
+?????Libraries(,):
+0
+24
+WString
+19
+libpng.lib zlib.lib
+0
+25
+WVList
+0
+-1
+1
+1
+0
+26
+WPickList
+2
+27
+MItem
+3
+*.c
+28
+WString
+4
+COBJ
+29
+WVList
+2
+30
+MVState
+31
+WString
+3
+WCC
+32
+WString
+25
+n????Include directories:
+1
+33
+WString
+39
+"$(%zlib);$(%watcom)/h;$(%watcom)/h/nt"
+0
+34
+MVState
+35
+WString
+3
+WCC
+36
+WString
+25
+n????Include directories:
+0
+37
+WString
+39
+"$(%zlib);$(%watcom)/h;$(%watcom)/h/nt"
+0
+38
+WVList
+0
+-1
+1
+1
+0
+39
+MItem
+15
+..\..\pngtest.c
+40
+WString
+4
+COBJ
+41
+WVList
+0
+42
+WVList
+0
+27
+1
+1
+0
diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngvalid.tgt b/Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/pngvalid.tgt index 83d47490c47..1e78e75cb6c 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngvalid.tgt +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/owatcom/pngvalid.tgt @@ -1,210 +1,210 @@ -40 -targetIdent -0 -MProject -1 -MComponent -0 -2 -WString -4 -NEXE -3 -WString -5 -nc2en -1 -0 -0 -4 -MCommand -0 -5 -MCommand -8 -pngvalid -6 -MItem -12 -pngvalid.exe -7 -WString -4 -NEXE -8 -WVList -6 -9 -MVState -10 -WString -7 -WINLINK -11 -WString -11 -?????Stack: -1 -12 -WString -4 -768k -0 -13 -MVState -14 -WString -7 -WINLINK -15 -WString -28 -?????Library directories(;): -1 -16 -WString -8 -$(%zlib) -0 -17 -MVState -18 -WString -7 -WINLINK -19 -WString -18 -?????Libraries(,): -1 -20 -WString -19 -libpng.lib zlib.lib -0 -21 -MVState -22 -WString -7 -WINLINK -23 -WString -11 -?????Stack: -0 -24 -WString -4 -768k -0 -25 -MVState -26 -WString -7 -WINLINK -27 -WString -28 -?????Library directories(;): -0 -28 -WString -8 -$(%zlib) -0 -29 -MVState -30 -WString -7 -WINLINK -31 -WString -18 -?????Libraries(,): -0 -32 -WString -19 -libpng.lib zlib.lib -0 -33 -WVList -0 --1 -1 -1 -0 -34 -WPickList -2 -35 -MItem -3 -*.c -36 -WString -4 -COBJ -37 -WVList -2 -38 -MVState -39 -WString -3 -WCC -40 -WString -25 -n????Include directories: -1 -41 -WString -39 -"$(%zlib);$(%watcom)/h;$(%watcom)/h/nt" -0 -42 -MVState -43 -WString -3 -WCC -44 -WString -25 -n????Include directories: -0 -45 -WString -39 -"$(%zlib);$(%watcom)/h;$(%watcom)/h/nt" -0 -46 -WVList -0 --1 -1 -1 -0 -47 -MItem -16 -..\..\pngvalid.c -48 -WString -4 -COBJ -49 -WVList -0 -50 -WVList -0 -35 -1 -1 -0 +40
+targetIdent
+0
+MProject
+1
+MComponent
+0
+2
+WString
+4
+NEXE
+3
+WString
+5
+nc2en
+1
+0
+0
+4
+MCommand
+0
+5
+MCommand
+8
+pngvalid
+6
+MItem
+12
+pngvalid.exe
+7
+WString
+4
+NEXE
+8
+WVList
+6
+9
+MVState
+10
+WString
+7
+WINLINK
+11
+WString
+11
+?????Stack:
+1
+12
+WString
+4
+768k
+0
+13
+MVState
+14
+WString
+7
+WINLINK
+15
+WString
+28
+?????Library directories(;):
+1
+16
+WString
+8
+$(%zlib)
+0
+17
+MVState
+18
+WString
+7
+WINLINK
+19
+WString
+18
+?????Libraries(,):
+1
+20
+WString
+19
+libpng.lib zlib.lib
+0
+21
+MVState
+22
+WString
+7
+WINLINK
+23
+WString
+11
+?????Stack:
+0
+24
+WString
+4
+768k
+0
+25
+MVState
+26
+WString
+7
+WINLINK
+27
+WString
+28
+?????Library directories(;):
+0
+28
+WString
+8
+$(%zlib)
+0
+29
+MVState
+30
+WString
+7
+WINLINK
+31
+WString
+18
+?????Libraries(,):
+0
+32
+WString
+19
+libpng.lib zlib.lib
+0
+33
+WVList
+0
+-1
+1
+1
+0
+34
+WPickList
+2
+35
+MItem
+3
+*.c
+36
+WString
+4
+COBJ
+37
+WVList
+2
+38
+MVState
+39
+WString
+3
+WCC
+40
+WString
+25
+n????Include directories:
+1
+41
+WString
+39
+"$(%zlib);$(%watcom)/h;$(%watcom)/h/nt"
+0
+42
+MVState
+43
+WString
+3
+WCC
+44
+WString
+25
+n????Include directories:
+0
+45
+WString
+39
+"$(%zlib);$(%watcom)/h;$(%watcom)/h/nt"
+0
+46
+WVList
+0
+-1
+1
+1
+0
+47
+MItem
+33
+..\..\contrib\libtests\pngvalid.c
+48
+WString
+4
+COBJ
+49
+WVList
+0
+50
+WVList
+0
+35
+1
+1
+0
diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/PRJ0041.mak b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/PRJ0041.mak index c7a68b503e7..c7a68b503e7 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/PRJ0041.mak +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/PRJ0041.mak diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/README.txt b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/README.txt index 625eefcab7f..625eefcab7f 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/README.txt +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/README.txt diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/README_zlib.txt b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/README_zlib.txt index 81d11cbb577..81d11cbb577 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/README_zlib.txt +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/README_zlib.txt diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/libpng.sln b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/libpng.sln index eeb101f2e31..eeb101f2e31 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/libpng.sln +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/libpng.sln diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/libpng.vcproj b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/libpng.vcproj index 4c5acf94c8b..4c5acf94c8b 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/libpng.vcproj +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/libpng.vcproj diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/pngtest.vcproj b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/pngtest.vcproj index ff330ae350f..ff330ae350f 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/pngtest.vcproj +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/pngtest.vcproj diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/zlib.vcproj b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/zlib.vcproj index eb218488dcf..eb218488dcf 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/zlib.vcproj +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/visualc71/zlib.vcproj diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/libpng/libpng.vcxproj b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/libpng/libpng.vcxproj index c4bf04184ee..c4bf04184ee 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/libpng/libpng.vcxproj +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/libpng/libpng.vcxproj diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pnglibconf/pnglibconf.vcxproj b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/pnglibconf/pnglibconf.vcxproj index 7c691c32d34..7c691c32d34 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pnglibconf/pnglibconf.vcxproj +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/pnglibconf/pnglibconf.vcxproj diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pngtest/pngtest.vcxproj b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/pngtest/pngtest.vcxproj index a03dca565ff..a03dca565ff 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pngtest/pngtest.vcxproj +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/pngtest/pngtest.vcxproj diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pngvalid/pngvalid.vcxproj b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/pngvalid/pngvalid.vcxproj index bd85806aba2..6a0a6e4f312 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pngvalid/pngvalid.vcxproj +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/pngvalid/pngvalid.vcxproj @@ -204,14 +204,13 @@ </Link> <CustomBuildStep> <Message>Executing PNG validation program</Message> - <Command>$(OutDir)pngvalid.exe ..\..\..\pngvalid.png $(IntDir)pngout.png</Command> <Command>"$(OutDir)pngvalid.exe" --touch "$(IntDir)pngvalid.out"</Command> <Outputs>$(IntDir)pngvalid.out</Outputs> <Inputs>$(OutDir)pngvalid.exe</Inputs> </CustomBuildStep> </ItemDefinitionGroup> <ItemGroup> - <ClCompile Include="..\..\..\pngvalid.c" /> + <ClCompile Include="..\..\..\contrib\libtests\pngvalid.c" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/readme.txt b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/readme.txt index e1a726b02f7..a18faa12591 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/readme.txt +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/readme.txt @@ -1,7 +1,7 @@ VisualStudio instructions -libpng version 1.5.5 - September 22, 2011 +libpng version 1.5.7 - December 15, 2011 Copyright (c) 1998-2010 Glenn Randers-Pehrson diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/vstudio.sln b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/vstudio.sln index fad771b1fce..4ab66418ca3 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/vstudio.sln +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/vstudio.sln @@ -2,22 +2,22 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "libpng\libpng.vcxproj", "{D6973076-9317-4EF2-A0B8-B7A18AC0713E}" ProjectSection(ProjectDependencies) = postProject - {64CE4900-97EA-2DD5-4226-F2E36FFF2867} = {64CE4900-97EA-2DD5-4226-F2E36FFF2867} + {60F89955-91C6-3A36-8000-13C592FEC2DF} = {60F89955-91C6-3A36-8000-13C592FEC2DF} {EB33566E-DA7F-4D28-9077-88C0B7C77E35} = {EB33566E-DA7F-4D28-9077-88C0B7C77E35} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pngtest", "pngtest\pngtest.vcxproj", "{228BA965-50D5-42B2-8BCF-AFCC227E3C1D}" ProjectSection(ProjectDependencies) = postProject - {64CE4900-97EA-2DD5-4226-F2E36FFF2867} = {64CE4900-97EA-2DD5-4226-F2E36FFF2867} + {60F89955-91C6-3A36-8000-13C592FEC2DF} = {60F89955-91C6-3A36-8000-13C592FEC2DF} {EB33566E-DA7F-4D28-9077-88C0B7C77E35} = {EB33566E-DA7F-4D28-9077-88C0B7C77E35} {D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {D6973076-9317-4EF2-A0B8-B7A18AC0713E} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcxproj", "{64CE4900-97EA-2DD5-4226-F2E36FFF2867}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcxproj", "{60F89955-91C6-3A36-8000-13C592FEC2DF}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pngvalid", "pngvalid\pngvalid.vcxproj", "{9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}" ProjectSection(ProjectDependencies) = postProject - {64CE4900-97EA-2DD5-4226-F2E36FFF2867} = {64CE4900-97EA-2DD5-4226-F2E36FFF2867} + {60F89955-91C6-3A36-8000-13C592FEC2DF} = {60F89955-91C6-3A36-8000-13C592FEC2DF} {EB33566E-DA7F-4D28-9077-88C0B7C77E35} = {EB33566E-DA7F-4D28-9077-88C0B7C77E35} {D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {D6973076-9317-4EF2-A0B8-B7A18AC0713E} EndProjectSection @@ -48,14 +48,14 @@ Global {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release Library|Win32.Build.0 = Release Library|Win32 {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release|Win32.ActiveCfg = Release|Win32 {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release|Win32.Build.0 = Release|Win32 - {64CE4900-97EA-2DD5-4226-F2E36FFF2867}.Debug Library|Win32.ActiveCfg = Debug Library|Win32 - {64CE4900-97EA-2DD5-4226-F2E36FFF2867}.Debug Library|Win32.Build.0 = Debug Library|Win32 - {64CE4900-97EA-2DD5-4226-F2E36FFF2867}.Debug|Win32.ActiveCfg = Debug|Win32 - {64CE4900-97EA-2DD5-4226-F2E36FFF2867}.Debug|Win32.Build.0 = Debug|Win32 - {64CE4900-97EA-2DD5-4226-F2E36FFF2867}.Release Library|Win32.ActiveCfg = Release Library|Win32 - {64CE4900-97EA-2DD5-4226-F2E36FFF2867}.Release Library|Win32.Build.0 = Release Library|Win32 - {64CE4900-97EA-2DD5-4226-F2E36FFF2867}.Release|Win32.ActiveCfg = Release|Win32 - {64CE4900-97EA-2DD5-4226-F2E36FFF2867}.Release|Win32.Build.0 = Release|Win32 + {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug Library|Win32.ActiveCfg = Debug Library|Win32 + {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug Library|Win32.Build.0 = Debug Library|Win32 + {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug|Win32.ActiveCfg = Debug|Win32 + {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug|Win32.Build.0 = Debug|Win32 + {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release Library|Win32.ActiveCfg = Release Library|Win32 + {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release Library|Win32.Build.0 = Release Library|Win32 + {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release|Win32.ActiveCfg = Release|Win32 + {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release|Win32.Build.0 = Release|Win32 {9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Debug Library|Win32.ActiveCfg = Debug Library|Win32 {9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Debug Library|Win32.Build.0 = Debug Library|Win32 {9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -72,6 +72,14 @@ Global {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release Library|Win32.Build.0 = Release|Win32 {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release|Win32.ActiveCfg = Release|Win32 {EB33566E-DA7F-4D28-9077-88C0B7C77E35}.Release|Win32.Build.0 = Release|Win32 + {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Debug Library|Win32.ActiveCfg = Debug Library|Win32 + {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Debug Library|Win32.Build.0 = Debug Library|Win32 + {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Debug|Win32.ActiveCfg = Debug|Win32 + {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Debug|Win32.Build.0 = Debug|Win32 + {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release Library|Win32.ActiveCfg = Release Library|Win32 + {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release Library|Win32.Build.0 = Release Library|Win32 + {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release|Win32.ActiveCfg = Release|Win32 + {277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/zlib.props b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/zlib.props index 31ddabfacbf..c13867c35e0 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/zlib.props +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/zlib.props @@ -2,7 +2,7 @@ <!-- * zlib.props - location of zlib source * - * libpng version 1.5.5 - September 22, 2011 + * libpng version 1.5.7 - December 15, 2011 * * Copyright (c) 1998-2011 Glenn Randers-Pehrson * diff --git a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/zlib/zlib.vcxproj b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/zlib/zlib.vcxproj index d627817969a..d627817969a 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/zlib/zlib.vcxproj +++ b/Build/source/libs/libpng/libpng-1.5.7/projects/vstudio/zlib/zlib.vcxproj diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/README.txt b/Build/source/libs/libpng/libpng-1.5.7/scripts/README.txt index a53f1520f8e..485aba225fe 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/README.txt +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/README.txt @@ -1,9 +1,9 @@ -Makefiles for libpng version 1.5.5 - September 22, 2011 +Makefiles for libpng version 1.5.7 - December 15, 2011 pnglibconf.h.prebuilt => Stores configuration settings makefile.linux => Linux/ELF makefile - (gcc, creates libpng15.so.15.1.5.5) + (gcc, creates libpng15.so.15.1.5.7) makefile.gcc => Generic makefile (gcc, creates static libpng.a) makefile.knr => Archaic UNIX Makefile that converts files with ansi2knr (Requires ansi2knr.c from @@ -20,7 +20,7 @@ pnglibconf.h.prebuilt => Stores configuration settings makefile.dec => DEC Alpha UNIX makefile makefile.dj2 => DJGPP 2 makefile makefile.elf => Linux/ELF makefile symbol versioning, - (gcc, creates libpng15.so.15.1.5.5) + (gcc, creates libpng15.so.15.1.5.7) makefile.freebsd => FreeBSD makefile makefile.gcc => Generic gcc makefile makefile.hpgcc => HPUX makefile using gcc @@ -35,12 +35,12 @@ pnglibconf.h.prebuilt => Stores configuration settings makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def) makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc makefile.sggcc => Silicon Graphics (gcc, - creates libpng15.so.15.1.5.5) + creates libpng15.so.15.1.5.7) makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib) makefile.solaris => Solaris 2.X makefile (gcc, - creates libpng15.so.15.1.5.5) + creates libpng15.so.15.1.5.7) makefile.so9 => Solaris 9 makefile (gcc, - creates libpng15.so.15.1.5.5) + creates libpng15.so.15.1.5.7) makefile.std => Generic UNIX makefile (cc, creates static libpng.a) makefile.sunos => Sun makefile makefile.32sunu => Sun Ultra 32-bit makefile diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/SCOPTIONS.ppc b/Build/source/libs/libpng/libpng-1.5.7/scripts/SCOPTIONS.ppc index 2c3503e9eb2..2c3503e9eb2 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/SCOPTIONS.ppc +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/SCOPTIONS.ppc diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/checksym.awk b/Build/source/libs/libpng/libpng-1.5.7/scripts/checksym.awk index ba4c99b564d..ba4c99b564d 100755 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/checksym.awk +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/checksym.awk diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/chkfmt b/Build/source/libs/libpng/libpng-1.5.7/scripts/chkfmt index 9da6475fd4e..9da6475fd4e 100755 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/chkfmt +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/chkfmt diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/def.dfn b/Build/source/libs/libpng/libpng-1.5.7/scripts/def.dfn index d918d4c3c8b..5fd75259347 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/def.dfn +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/def.dfn @@ -27,12 +27,12 @@ S--E S-EXPORTS-E S-;Version 1.5.0beta58-E -/* NOTE: @@@ is interpreted by the calling script as a signal to +/* NOTE: PNG_JOIN is interpreted by the calling script as a signal to * join the two things on either side, so we can do symbol * substitution within the name, regular C ## joins the pp-tokens, * not their final values. */ #define PNG_EXPORTA(ordinal, type, name, args, attributes)\ - PNG_DEFN_MAGIC- SYMBOL_PREFIX @@@ name-PNG_DEFN_END + PNG_DEFN_MAGIC- SYMBOL_PREFIX PNG_JOIN name-PNG_DEFN_END #include "../png.h" diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/descrip.mms b/Build/source/libs/libpng/libpng-1.5.7/scripts/descrip.mms index 99ea1abccd1..99ea1abccd1 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/descrip.mms +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/descrip.mms diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/libpng-config-body.in b/Build/source/libs/libpng/libpng-1.5.7/scripts/libpng-config-body.in index b466432d546..b466432d546 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/libpng-config-body.in +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/libpng-config-body.in diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/libpng-config-head.in b/Build/source/libs/libpng/libpng-1.5.7/scripts/libpng-config-head.in index 4694f6b33f3..49a93395fcd 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/libpng-config-head.in +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/libpng-config-head.in @@ -11,7 +11,7 @@ # Modeled after libxml-config. -version=1.5.5 +version=1.5.7 prefix="" libdir="" libs="" diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/libpng.pc.in b/Build/source/libs/libpng/libpng-1.5.7/scripts/libpng.pc.in index ec8f82da338..3ec77d6d571 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/libpng.pc.in +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/libpng.pc.in @@ -5,6 +5,6 @@ includedir=@includedir@/libpng15 Name: libpng Description: Loads and saves PNG files -Version: 1.5.5 +Version: 1.5.7 Libs: -L${libdir} -lpng15 Cflags: -I${includedir} diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.32sunu b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.32sunu index b5e5a33a06f..b5e5a33a06f 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.32sunu +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.32sunu diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.64sunu b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.64sunu index a0331d670e0..a0331d670e0 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.64sunu +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.64sunu diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.acorn b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.acorn index 00b8fb5b35c..00b8fb5b35c 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.acorn +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.acorn diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.aix b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.aix index bb4c40d4b0d..bb4c40d4b0d 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.aix +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.aix diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.amiga b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.amiga index 228b5c22a75..228b5c22a75 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.amiga +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.amiga diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.atari b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.atari index 1aeb7d5b7dd..1aeb7d5b7dd 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.atari +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.atari diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.bc32 b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.bc32 index ebbd5ce3d27..ebbd5ce3d27 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.bc32 +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.bc32 diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.beos b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.beos index 749db78ad32..749db78ad32 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.beos +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.beos diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.bor b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.bor index 96d5e861a3a..96d5e861a3a 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.bor +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.bor diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.cegcc b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.cegcc index ebf6c6d4f71..624fbaa0f30 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.cegcc +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.cegcc @@ -23,7 +23,7 @@ VERMAJ = 1 VERMIN = 5 -VERMIC = 5 +VERMIC = 7 VER = $(VERMAJ).$(VERMIN).$(VERMIC) NAME = libpng PACKAGE = $(NAME)-$(VER) diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.darwin b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.darwin index 337a8151eb5..337a8151eb5 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.darwin +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.darwin diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.dec b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.dec index 5301d87d33e..5301d87d33e 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.dec +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.dec diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.dj2 b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.dj2 index 87a05a364ac..87a05a364ac 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.dj2 +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.dj2 diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.elf b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.elf index 5af43b18452..5af43b18452 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.elf +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.elf diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.freebsd b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.freebsd index 994608c993a..994608c993a 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.freebsd +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.freebsd diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.gcc b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.gcc index 2e5b611367f..2e5b611367f 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.gcc +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.gcc diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hp64 b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.hp64 index b5b631d11c7..b5b631d11c7 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hp64 +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.hp64 diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hpgcc b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.hpgcc index 3fe21177a4c..3fe21177a4c 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hpgcc +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.hpgcc diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hpux b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.hpux index 650ab4f6621..650ab4f6621 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hpux +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.hpux diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.ibmc b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.ibmc index 209d513b1cb..209d513b1cb 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.ibmc +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.ibmc diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.intel b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.intel index 1cb9ef37497..1cb9ef37497 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.intel +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.intel diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.knr b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.knr index 18a39f53755..18a39f53755 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.knr +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.knr diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.linux b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.linux index df8a59db4f8..8e3991ad6ac 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.linux +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.linux @@ -10,7 +10,7 @@ # Library name: LIBNAME = libpng15 PNGMAJ = 15 -RELEASE = 5 +RELEASE = 7 # Shared library names: LIBSO=$(LIBNAME).so diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.mips b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.mips index 179d3850b69..179d3850b69 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.mips +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.mips diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.msc b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.msc index baa863dad99..baa863dad99 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.msc +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.msc diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.ne12bsd b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.ne12bsd index d6ed321d89a..e534a01b004 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.ne12bsd +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.ne12bsd @@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include/libpng15 LIB= png15 SHLIB_MAJOR= 0 -SHLIB_MINOR= 1.5.5 +SHLIB_MINOR= 1.5.7 SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngwtran.c pngmem.c pngerror.c pngpread.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.netbsd b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.netbsd index 45c821b178b..262bdbd78d2 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.netbsd +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.netbsd @@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include LIB= png SHLIB_MAJOR= 15 -SHLIB_MINOR= 1.5.5 +SHLIB_MINOR= 1.5.7 SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngwtran.c pngmem.c pngerror.c pngpread.c diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.openbsd b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.openbsd index 9c12d606605..ad2b87426de 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.openbsd +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.openbsd @@ -11,7 +11,7 @@ LIBDIR= ${PREFIX}/lib MANDIR= ${PREFIX}/man/cat SHLIB_MAJOR= 15 -SHLIB_MINOR= 1.5.5 +SHLIB_MINOR= 1.5.7 LIB= png SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \ diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sco b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.sco index 0aad789a981..0aad789a981 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sco +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.sco diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sggcc b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.sggcc index 1611638ba6c..1611638ba6c 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sggcc +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.sggcc diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sgi b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.sgi index 83db59f817e..83db59f817e 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sgi +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.sgi diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.so9 b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.so9 index 615c2e34580..615c2e34580 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.so9 +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.so9 diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.solaris b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.solaris index 24bd61033ce..24bd61033ce 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.solaris +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.solaris diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.solaris-x86 b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.solaris-x86 index 76467622a85..76467622a85 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.solaris-x86 +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.solaris-x86 diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.std b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.std index 30e16464360..a04dbb856b4 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.std +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.std @@ -50,9 +50,9 @@ all: libpng.a pngtest # The standard pnglibconf.h exists as scripts/pnglibconf.h.prebuilt, # copy this if the following doesn't work. -pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk +pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h $(RM_F) $@ dfn?.out - $(AWK) -f scripts/options.awk out=dfn1.out\ + $(AWK) -f scripts/options.awk out=dfn1.out version=search pngconf.h\ scripts/pnglibconf.dfa $(DFA_XTRA) 1>&2 $(AWK) -f scripts/options.awk out=dfn2.out dfn1.out 1>&2 cp dfn2.out $@ @@ -62,9 +62,9 @@ pnglibconf.h: pnglibconf.dfn $(RM_F) $@ dfn.c dfn?.out $(ECHO) '#include "pnglibconf.dfn"' >dfn.c $(CPP) $(DFNFLAGS) dfn.c >dfn1.out - $(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p'\ + $(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\ dfn1.out >dfn2.out - $(SED) -e 's| *@@@ *||g' -e 's| *$$||' dfn2.out >dfn3.out + $(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' dfn2.out >dfn3.out cp dfn3.out $@ $(RM_F) dfn.c dfn?.out diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sunos b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.sunos index 383954987ee..383954987ee 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sunos +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.sunos diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.tc3 b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.tc3 index 462c47fece9..462c47fece9 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.tc3 +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.tc3 diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.vcwin32 b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.vcwin32 index 6bfeac03f7e..6bfeac03f7e 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.vcwin32 +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makefile.vcwin32 diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/makevms.com b/Build/source/libs/libpng/libpng-1.5.7/scripts/makevms.com index f6c326103c2..f6c326103c2 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/makevms.com +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/makevms.com diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/options.awk b/Build/source/libs/libpng/libpng-1.5.7/scripts/options.awk index 24f07137f18..a8dff044a68 100755 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/options.awk +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/options.awk @@ -1,7 +1,7 @@ #!/bin/awk -f # scripts/options.awk - library build configuration control # -# last changed in libpng version 1.5.0 - January 6, 2011 +# last changed in libpng version 1.5.7 - December 15, 2011 # # Copyright (c) 1998-2011 Glenn Randers-Pehrson # @@ -32,16 +32,19 @@ BEGIN{ out="/dev/null" # intermediate, preprocessed, file pre=-1 # preprocess (first line) + version="libpng version unknown" # version information + version_file="" # where to find the version err=0 # in-line exit sets this start="PNG_DEFN_MAGIC-" # Arbitrary start end="-PNG_DEFN_END" # Arbitrary end - cx= "/@@@*" # Open C comment for output file + ct="PNG_JOIN" # Join two tokens + cx= "/" ct "*" # Open C comment for output file comment=start cx # Comment start cend="*/" end # Comment end - def=start "#define PNG_@@@" # Arbitrary define - sup="@@@_SUPPORTED" end # end supported option - und=comment "#undef PNG_@@@" # Unsupported option - une="@@@_SUPPORTED" cend # end unsupported option + def=start "#define PNG_" ct # Arbitrary define + sup=ct "_SUPPORTED" end # end supported option + und=comment "#undef PNG_" ct # Unsupported option + une=ct "_SUPPORTED" cend # end unsupported option error=start "ERROR:" # error message # Variables @@ -85,6 +88,28 @@ pre == -1{ } } +# While pre-processing if version is set to "search" look for a version string +# in the following file. +pre && version == "search" && version_file == ""{ + version_file = FILENAME +} + +pre && version == "search" && version_file != FILENAME{ + print "version string not found in", version_file + err = 1 + exit 1 +} + +pre && version == "search" && $0 ~ /^ \* libpng version/{ + version = substr($0, 4) + print "version =", version >out + next +} + +pre && FILENAME == version_file{ + next +} + # variable=value # Sets the given variable to the given value (the syntax is fairly # free form, except for deb (you are expected to understand how to @@ -94,6 +119,11 @@ pre == -1{ # rest of the actions, so the variable settings happen during # preprocessing but are recorded in the END action too. This # allows them to be set on the command line too. +$0 ~ /^[ ]*version[ ]*=/{ + sub(/^[ ]*version[ ]*=[ ]*/, "") + version = $0 + next +} $0 ~ /^[ ]*everything[ =]*off[ ]*$/{ everything = "off" next @@ -165,6 +195,19 @@ $1 == "com"{ next } +# version +# Inserts a version comment +$1 == "version" && NF == 1{ + if (version == "") { + print "ERROR: no version string set" + err = 1 # prevent END{} running + exit 1 + } + + print comment, version, cend >out + next +} + # file output input protect # Informational: the official name of the input file (without # make generated local directories), the official name of the diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.dfa b/Build/source/libs/libpng/libpng-1.5.7/scripts/pnglibconf.dfa index 07b7f6927a4..a740d6827bd 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.dfa +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/pnglibconf.dfa @@ -6,7 +6,7 @@ # com pnglibconf.h - library build configuration com -com libpng version 1.5.3 - July 7, 2011 +version com com Copyright (c) 1998-2011 Glenn Randers-Pehrson com @@ -296,7 +296,7 @@ option READ enables READ_INTERLACING # processing after that has happened. You need to be sure to enable # READ_SCALE_16_TO_8 or READ_STRIP_16_TO_8 when you disable READ_16BIT for # this to work properly. You should disable the other option if you need to -# ensure a particular convertion (otherwise the app can chose.) +# ensure a particular conversion (otherwise the app can chose.) option READ_16BIT requires READ enables 16BIT diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.h.prebuilt b/Build/source/libs/libpng/libpng-1.5.7/scripts/pnglibconf.h.prebuilt index 8022a5a8814..0a799915f85 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.h.prebuilt +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/pnglibconf.h.prebuilt @@ -3,7 +3,7 @@ /* pnglibconf.h - library build configuration */ -/* libpng version 1.5.4 - last changed on June 22, 2011 */ +/* Libpng 1.5.7 - December 15, 2011 */ /* Copyright (c) 1998-2011 Glenn Randers-Pehrson */ @@ -54,6 +54,8 @@ #define PNG_FIXED_POINT_SUPPORTED #define PNG_FLOATING_ARITHMETIC_SUPPORTED #define PNG_FLOATING_POINT_SUPPORTED +#define PNG_FORMAT_AFIRST_SUPPORTED +#define PNG_FORMAT_BGR_SUPPORTED #define PNG_gAMA_SUPPORTED #define PNG_HANDLE_AS_UNKNOWN_SUPPORTED #define PNG_hIST_SUPPORTED diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.mak b/Build/source/libs/libpng/libpng-1.5.7/scripts/pnglibconf.mak index 1509ee242ec..c04578f31d9 100755 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.mak +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/pnglibconf.mak @@ -35,18 +35,19 @@ pnglibconf.h: pnglibconf.dfn $(ECHO) '#include "pnglibconf.dfn"' >dfn.c $(CPP) $(DFNFLAGS) dfn.c >dfn1.out $(ECHO) "If 'cpp -e' crashes try /lib/cpp (e.g. CPP='/lib/cpp')" >&2 - $(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p'\ + $(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\ dfn1.out >dfn2.out - $(SED) -e 's| *@@@ *||g' -e 's| *$$||' dfn2.out >dfn3.out + $(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' dfn2.out >dfn3.out $(COPY) dfn3.out $@ $(DELETE) dfn.c dfn1.out dfn2.out dfn3.out -pnglibconf.dfn: $(srcdir)/scripts/pnglibconf.dfa $(srcdir)/scripts/options.awk +pnglibconf.dfn: $(srcdir)/scripts/pnglibconf.dfa $(srcdir)/scripts/options.awk $(srcdir)/pngconf.h $(DELETE) $@ dfn1.out dfn2.out $(ECHO) "Calling $(AWK) from scripts/pnglibconf.mak" >&2 $(ECHO) "If 'awk' crashes try a better awk (e.g. AWK='nawk')" >&2 - $(AWK) -f $(srcdir)/scripts/options.awk out=dfn1.out\ - $(srcdir)/scripts/pnglibconf.dfa $(DFA_XTRA) 1>&2 + $(AWK) -f $(srcdir)/scripts/options.awk out=dfn1.out version=search\ + $(srcdir)/pngconf.h $(srcdir)/scripts/pnglibconf.dfa\ + $(DFA_XTRA) 1>&2 $(AWK) -f $(srcdir)/scripts/options.awk out=dfn2.out dfn1.out 1>&2 $(COPY) dfn2.out $@ $(DELETE) dfn1.out dfn2.out diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/pngwin.rc b/Build/source/libs/libpng/libpng-1.5.7/scripts/pngwin.rc index 9335cbbe03b..9335cbbe03b 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/pngwin.rc +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/pngwin.rc diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/smakefile.ppc b/Build/source/libs/libpng/libpng-1.5.7/scripts/smakefile.ppc index 2e7380b1f98..2e7380b1f98 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/smakefile.ppc +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/smakefile.ppc diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/sym.dfn b/Build/source/libs/libpng/libpng-1.5.7/scripts/sym.dfn index 4b12ec2bf6e..f4f13df0831 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/sym.dfn +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/sym.dfn @@ -10,6 +10,6 @@ */ #define PNG_EXPORTA(ordinal, type, name, args, attributes)\ - PNG_DEFN_MAGIC-SYMBOL_PREFIX @@@ name-PNG_DEFN_END + PNG_DEFN_MAGIC-SYMBOL_PREFIX PNG_JOIN name-PNG_DEFN_END #include "../png.h" diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/symbols.def b/Build/source/libs/libpng/libpng-1.5.7/scripts/symbols.def index 3d0e1e7f58f..a2f15e40638 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/symbols.def +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/symbols.def @@ -5,7 +5,7 @@ LIBRARY EXPORTS -;Version 1.5.5 +;Version 1.5.7 png_access_version_number @1 png_set_sig_bytes @2 png_sig_cmp @3 diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/symbols.dfn b/Build/source/libs/libpng/libpng-1.5.7/scripts/symbols.dfn index d790929e7e7..d790929e7e7 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/symbols.dfn +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/symbols.dfn diff --git a/Build/source/libs/libpng/libpng-1.5.5/scripts/vers.dfn b/Build/source/libs/libpng/libpng-1.5.7/scripts/vers.dfn index a4bf5c720ee..89d5f3879e2 100644 --- a/Build/source/libs/libpng/libpng-1.5.5/scripts/vers.dfn +++ b/Build/source/libs/libpng/libpng-1.5.7/scripts/vers.dfn @@ -11,13 +11,13 @@ #define HEADER PNG_DEFN_MAGIC-PNGLIB_LIBNAME {global:-PNG_DEFN_END -/* NOTE: @@@ is interpreted by the calling script as a signal to +/* NOTE: PNG_JOIN is interpreted by the calling script as a signal to * join the two things on either side, so we can do symbol * substitution within the name, regular C ## joins the pp-tokens, * not their final values. */ #define PNG_EXPORTA(ordinal, type, name, args, attributes)\ - PNG_DEFN_MAGIC- SYMBOL_PREFIX @@@ name;-PNG_DEFN_END + PNG_DEFN_MAGIC- SYMBOL_PREFIX PNG_JOIN name;-PNG_DEFN_END #define TRAILER PNG_DEFN_MAGIC-local: *; };-PNG_DEFN_END diff --git a/Build/source/libs/libpng/libpng-1.5.7/test-pngtest.sh b/Build/source/libs/libpng/libpng-1.5.7/test-pngtest.sh new file mode 100755 index 00000000000..bba128b6319 --- /dev/null +++ b/Build/source/libs/libpng/libpng-1.5.7/test-pngtest.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +echo "Running tests. For details see pngtest-log.txt" + +echo "============ pngtest pngtest.png ==============" > pngtest-log.txt + +echo "Running test-pngtest.sh" +if ./pngtest --strict ${srcdir}/pngtest.png >> pngtest-log.txt 2>&1 +then + echo " PASS: pngtest --strict pngtest.png" + err=0 +else + echo " FAIL: pngtest --strict pngtest.png" + err=1 +fi +exit $err diff --git a/Build/source/libs/libpng/libpng-1.5.5/test-pngvalid-full.sh b/Build/source/libs/libpng/libpng-1.5.7/test-pngvalid-full.sh index d8c6faa23b4..f7d1b2b5d58 100755 --- a/Build/source/libs/libpng/libpng-1.5.5/test-pngvalid-full.sh +++ b/Build/source/libs/libpng/libpng-1.5.7/test-pngvalid-full.sh @@ -9,15 +9,13 @@ echo "============ pngvalid-full.sh ==============" >> pngtest-log.txt echo "Running test-pngvalid-full.sh" for gamma in threshold transform sbit 16-to-8 background alpha-mode "transform --expand16" "background --expand16" "alpha-mode --expand16" do - if ./pngvalid --gamma-$gamma >> pngtest-log.txt 2>&1 + if ./pngvalid "$@" --gamma-$gamma >> pngtest-log.txt 2>&1 then - echo " PASS:" pngvalid "--gamma-$gamma" + echo " PASS: pngvalid" "$@" "--gamma-$gamma" else - echo " FAIL:" pngvalid "--gamma-$gamma" + echo " FAIL: pngvalid" "$@" "--gamma-$gamma" err=1 fi done -echo - exit $err diff --git a/Build/source/libs/libpng/libpng-1.5.5/test-pngvalid-simple.sh b/Build/source/libs/libpng/libpng-1.5.7/test-pngvalid-simple.sh index 9eb0c0a06e1..7d4d9d83c28 100755 --- a/Build/source/libs/libpng/libpng-1.5.5/test-pngvalid-simple.sh +++ b/Build/source/libs/libpng/libpng-1.5.7/test-pngvalid-simple.sh @@ -18,11 +18,11 @@ for opts in "--standard" "--standard --progressive-read" \ "--size" "--size --progressive-read" \ "--transform" do - if ./pngvalid $opts >> pngtest-log.txt 2>&1 + if ./pngvalid "$@" $opts >> pngtest-log.txt 2>&1 then - echo " PASS:" pngvalid $opts + echo " PASS: pngvalid" "$@" $opts else - echo " FAIL:" pngvalid $opts + echo " FAIL: pngvalid" "$@" $opts err=1 fi done diff --git a/Build/source/libs/libpng/version.ac b/Build/source/libs/libpng/version.ac index 89880be740c..11f3f70b59b 100644 --- a/Build/source/libs/libpng/version.ac +++ b/Build/source/libs/libpng/version.ac @@ -8,4 +8,4 @@ dnl dnl -------------------------------------------------------- dnl dnl m4-include this file to define the current libpng version -m4_define([libpng_version], [1.5.5]) +m4_define([libpng_version], [1.5.7]) |