Commit 4e586c7a authored by hybrid's avatar hybrid

Update to bzip2 1.0.6, libpng 1.4.4 and lzma from 9.20 SDK

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3458 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 1e69bb99
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
...@@ -317,3 +317,11 @@ Fixes some minor bugs since the last version, 1.0.3. ...@@ -317,3 +317,11 @@ Fixes some minor bugs since the last version, 1.0.3.
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
Security fix only. Fixes CERT-FI 20469 as it applies to bzip2. Security fix only. Fixes CERT-FI 20469 as it applies to bzip2.
1.0.6 (6 Sept 10)
~~~~~~~~~~~~~~~~~
* Security fix for CVE-2010-0405. This was reported by Mikolaj
Izdebski.
* Make the documentation build on Ubuntu 10.04
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
-------------------------------------------------------------------------- --------------------------------------------------------------------------
This program, "bzip2", the associated library "libbzip2", and all This program, "bzip2", the associated library "libbzip2", and all
documentation, are copyright (C) 1996-2007 Julian R Seward. All documentation, are copyright (C) 1996-2010 Julian R Seward. All
rights reserved. rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
...@@ -37,6 +37,6 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ...@@ -37,6 +37,6 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, jseward@bzip.org Julian Seward, jseward@bzip.org
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
-------------------------------------------------------------------------- --------------------------------------------------------------------------
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
# This file is part of bzip2/libbzip2, a program and library for # This file is part of bzip2/libbzip2, a program and library for
# lossless, block-sorting data compression. # lossless, block-sorting data compression.
# #
# bzip2/libbzip2 version 1.0.5 of 10 December 2007 # bzip2/libbzip2 version 1.0.6 of 6 September 2010
# Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> # Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
# #
# Please read the WARNING, DISCLAIMER and PATENTS sections in the # Please read the WARNING, DISCLAIMER and PATENTS sections in the
# README file. # README file.
...@@ -137,7 +137,7 @@ bzip2recover.o: bzip2recover.c ...@@ -137,7 +137,7 @@ bzip2recover.o: bzip2recover.c
distclean: clean distclean: clean
rm -f manual.ps manual.html manual.pdf rm -f manual.ps manual.html manual.pdf
DISTNAME=bzip2-1.0.5 DISTNAME=bzip2-1.0.6
dist: check manual dist: check manual
rm -f $(DISTNAME) rm -f $(DISTNAME)
ln -s -f . $(DISTNAME) ln -s -f . $(DISTNAME)
......
# This Makefile builds a shared version of the library, # This Makefile builds a shared version of the library,
# libbz2.so.1.0.4, with soname libbz2.so.1.0, # libbz2.so.1.0.6, with soname libbz2.so.1.0,
# at least on x86-Linux (RedHat 7.2), # at least on x86-Linux (RedHat 7.2),
# with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98). # with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98).
# Please see the README file for some important info # Please see the README file for some important info
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
# This file is part of bzip2/libbzip2, a program and library for # This file is part of bzip2/libbzip2, a program and library for
# lossless, block-sorting data compression. # lossless, block-sorting data compression.
# #
# bzip2/libbzip2 version 1.0.5 of 10 December 2007 # bzip2/libbzip2 version 1.0.6 of 6 September 2010
# Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> # Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
# #
# Please read the WARNING, DISCLAIMER and PATENTS sections in the # Please read the WARNING, DISCLAIMER and PATENTS sections in the
# README file. # README file.
...@@ -35,13 +35,13 @@ OBJS= blocksort.o \ ...@@ -35,13 +35,13 @@ OBJS= blocksort.o \
bzlib.o bzlib.o
all: $(OBJS) all: $(OBJS)
$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.4 $(OBJS) $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.4 $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
rm -f libbz2.so.1.0 rm -f libbz2.so.1.0
ln -s libbz2.so.1.0.4 libbz2.so.1.0 ln -s libbz2.so.1.0.6 libbz2.so.1.0
clean: clean:
rm -f $(OBJS) bzip2.o libbz2.so.1.0.4 libbz2.so.1.0 bzip2-shared rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared
blocksort.o: blocksort.c blocksort.o: blocksort.c
$(CC) $(CFLAGS) -c blocksort.c $(CC) $(CFLAGS) -c blocksort.c
......
...@@ -6,8 +6,8 @@ This version is fully compatible with the previous public releases. ...@@ -6,8 +6,8 @@ This version is fully compatible with the previous public releases.
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in this file. Please read the WARNING, DISCLAIMER and PATENTS sections in this file.
...@@ -181,6 +181,10 @@ WHAT'S NEW IN 1.0.5 ? ...@@ -181,6 +181,10 @@ WHAT'S NEW IN 1.0.5 ?
See the CHANGES file. See the CHANGES file.
WHAT'S NEW IN 1.0.6 ?
See the CHANGES file.
I hope you find bzip2 useful. Feel free to contact me at I hope you find bzip2 useful. Feel free to contact me at
jseward@bzip.org jseward@bzip.org
...@@ -208,3 +212,4 @@ Cambridge, UK. ...@@ -208,3 +212,4 @@ Cambridge, UK.
15 February 2005 (bzip2, version 1.0.3) 15 February 2005 (bzip2, version 1.0.3)
20 December 2006 (bzip2, version 1.0.4) 20 December 2006 (bzip2, version 1.0.4)
10 December 2007 (bzip2, version 1.0.5) 10 December 2007 (bzip2, version 1.0.5)
6 Sept 2010 (bzip2, version 1.0.6)
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
...@@ -12,7 +12,7 @@ This program is released under the terms of the license contained ...@@ -12,7 +12,7 @@ This program is released under the terms of the license contained
in the file LICENSE. in the file LICENSE.
------------------------------------------------------------------ ------------------------------------------------------------------
bzip2-1.0.5 should compile without problems on the vast majority of bzip2-1.0.6 should compile without problems on the vast majority of
platforms. Using the supplied Makefile, I've built and tested it platforms. Using the supplied Makefile, I've built and tested it
myself for x86-linux and amd64-linux. With makefile.msc, Visual C++ myself for x86-linux and amd64-linux. With makefile.msc, Visual C++
6.0 and nmake, you can build a native Win32 version too. Large file 6.0 and nmake, you can build a native Win32 version too. Large file
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
......
.PU .PU
.TH bzip2 1 .TH bzip2 1
.SH NAME .SH NAME
bzip2, bunzip2 \- a block-sorting file compressor, v1.0.4 bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6
.br .br
bzcat \- decompresses files to stdout bzcat \- decompresses files to stdout
.br .br
...@@ -405,11 +405,11 @@ I/O error messages are not as helpful as they could be. ...@@ -405,11 +405,11 @@ I/O error messages are not as helpful as they could be.
tries hard to detect I/O errors and exit cleanly, but the details of tries hard to detect I/O errors and exit cleanly, but the details of
what the problem is sometimes seem rather misleading. what the problem is sometimes seem rather misleading.
This manual page pertains to version 1.0.4 of This manual page pertains to version 1.0.6 of
.I bzip2. .I bzip2.
Compressed data created by this version is entirely forwards and Compressed data created by this version is entirely forwards and
backwards compatible with the previous public releases, versions backwards compatible with the previous public releases, versions
0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and 1.0.3, but with the following 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and above, but with the following
exception: 0.9.0 and above can correctly decompress multiple exception: 0.9.0 and above can correctly decompress multiple
concatenated compressed files. 0.1pl2 cannot do this; it will stop concatenated compressed files. 0.1pl2 cannot do this; it will stop
after decompressing just the first file in the stream. after decompressing just the first file in the stream.
......
...@@ -3,7 +3,7 @@ bzip2(1) bzip2(1) ...@@ -3,7 +3,7 @@ bzip2(1) bzip2(1)
NNAAMMEE NNAAMMEE
bzip2, bunzip2 − a block‐sorting file compressor, v1.0.4 bzip2, bunzip2 − a block‐sorting file compressor, v1.0.6
bzcat − decompresses files to stdout bzcat − decompresses files to stdout
bzip2recover − recovers data from damaged bzip2 files bzip2recover − recovers data from damaged bzip2 files
...@@ -348,11 +348,11 @@ CCAAVVEEAATTSS ...@@ -348,11 +348,11 @@ CCAAVVEEAATTSS
but the details of what the problem is sometimes seem but the details of what the problem is sometimes seem
rather misleading. rather misleading.
This manual page pertains to version 1.0.4 of _b_z_i_p_2_. Com­ This manual page pertains to version 1.0.6 of _b_z_i_p_2_. Com­
pressed data created by this version is entirely forwards pressed data created by this version is entirely forwards
and backwards compatible with the previous public and backwards compatible with the previous public
releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1,
1.0.2 and 1.0.3, but with the following exception: 0.9.0 1.0.2 and above, but with the following exception: 0.9.0
and above can correctly decompress multiple concatenated and above can correctly decompress multiple concatenated
compressed files. 0.1pl2 cannot do this; it will stop compressed files. 0.1pl2 cannot do this; it will stop
after decompressing just the first file in the stream. after decompressing just the first file in the stream.
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
...@@ -1605,11 +1605,11 @@ void license ( void ) ...@@ -1605,11 +1605,11 @@ void license ( void )
"bzip2, a block-sorting file compressor. " "bzip2, a block-sorting file compressor. "
"Version %s.\n" "Version %s.\n"
" \n" " \n"
" Copyright (C) 1996-2007 by Julian Seward.\n" " Copyright (C) 1996-2010 by Julian Seward.\n"
" \n" " \n"
" This program is free software; you can redistribute it and/or modify\n" " This program is free software; you can redistribute it and/or modify\n"
" it under the terms set out in the LICENSE file, which is included\n" " it under the terms set out in the LICENSE file, which is included\n"
" in the bzip2-1.0.5 source distribution.\n" " in the bzip2-1.0.6 source distribution.\n"
" \n" " \n"
" This program is distributed in the hope that it will be useful,\n" " This program is distributed in the hope that it will be useful,\n"
" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
......
NAME NAME
bzip2, bunzip2 - a block-sorting file compressor, v1.0.4 bzip2, bunzip2 - a block-sorting file compressor, v1.0.6
bzcat - decompresses files to stdout bzcat - decompresses files to stdout
bzip2recover - recovers data from damaged bzip2 files bzip2recover - recovers data from damaged bzip2 files
...@@ -345,11 +345,11 @@ CAVEATS ...@@ -345,11 +345,11 @@ CAVEATS
but the details of what the problem is sometimes seem but the details of what the problem is sometimes seem
rather misleading. rather misleading.
This manual page pertains to version 1.0.4 of bzip2. Com- This manual page pertains to version 1.0.6 of bzip2. Com-
pressed data created by this version is entirely forwards pressed data created by this version is entirely forwards
and backwards compatible with the previous public and backwards compatible with the previous public
releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1,
1.0.2 and 1.0.3, but with the following exception: 0.9.0 1.0.2 and above, but with the following exception: 0.9.0
and above can correctly decompress multiple concatenated and above can correctly decompress multiple concatenated
compressed files. 0.1pl2 cannot do this; it will stop compressed files. 0.1pl2 cannot do this; it will stop
after decompressing just the first file in the stream. after decompressing just the first file in the stream.
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
...@@ -313,7 +313,7 @@ Int32 main ( Int32 argc, Char** argv ) ...@@ -313,7 +313,7 @@ Int32 main ( Int32 argc, Char** argv )
inFileName[0] = outFileName[0] = 0; inFileName[0] = outFileName[0] = 0;
fprintf ( stderr, fprintf ( stderr,
"bzip2recover 1.0.5: extracts blocks from damaged .bz2 files.\n" ); "bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" );
if (argc != 2) { if (argc != 2) {
fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n", fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n",
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
/*-- General stuff. --*/ /*-- General stuff. --*/
#define BZ_VERSION "1.0.5, 10-Dec-2007" #define BZ_VERSION "1.0.6, 6-Sept-2010"
typedef char Char; typedef char Char;
typedef unsigned char Bool; typedef unsigned char Bool;
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
...@@ -381,6 +381,13 @@ Int32 BZ2_decompress ( DState* s ) ...@@ -381,6 +381,13 @@ Int32 BZ2_decompress ( DState* s )
es = -1; es = -1;
N = 1; N = 1;
do { do {
/* Check that N doesn't get too big, so that es doesn't
go negative. The maximum value that can be
RUNA/RUNB encoded is equal to the block size (post
the initial RLE), viz, 900k, so bounding N at 2
million should guard against overflow without
rejecting any legitimate inputs. */
if (N >= 2*1024*1024) RETURN(BZ_DATA_ERROR);
if (nextSym == BZ_RUNA) es = es + (0+1) * N; else if (nextSym == BZ_RUNA) es = es + (0+1) * N; else
if (nextSym == BZ_RUNB) es = es + (1+1) * N; if (nextSym == BZ_RUNB) es = es + (1+1) * N;
N = N * 2; N = N * 2;
...@@ -485,15 +492,28 @@ Int32 BZ2_decompress ( DState* s ) ...@@ -485,15 +492,28 @@ Int32 BZ2_decompress ( DState* s )
RETURN(BZ_DATA_ERROR); RETURN(BZ_DATA_ERROR);
/*-- Set up cftab to facilitate generation of T^(-1) --*/ /*-- Set up cftab to facilitate generation of T^(-1) --*/
/* Check: unzftab entries in range. */
for (i = 0; i <= 255; i++) {
if (s->unzftab[i] < 0 || s->unzftab[i] > nblock)
RETURN(BZ_DATA_ERROR);
}
/* Actually generate cftab. */
s->cftab[0] = 0; s->cftab[0] = 0;
for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1]; for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1];
for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1]; for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1];
/* Check: cftab entries in range. */
for (i = 0; i <= 256; i++) { for (i = 0; i <= 256; i++) {
if (s->cftab[i] < 0 || s->cftab[i] > nblock) { if (s->cftab[i] < 0 || s->cftab[i] > nblock) {
/* s->cftab[i] can legitimately be == nblock */ /* s->cftab[i] can legitimately be == nblock */
RETURN(BZ_DATA_ERROR); RETURN(BZ_DATA_ERROR);
} }
} }
/* Check: cftab entries non-descending. */
for (i = 1; i <= 256; i++) {
if (s->cftab[i-1] > s->cftab[i]) {
RETURN(BZ_DATA_ERROR);
}
}
s->state_out_len = 0; s->state_out_len = 0;
s->state_out_ch = 0; s->state_out_ch = 0;
......
<!-- misc. strings --> <!-- misc. strings -->
<!ENTITY bz-url "http://www.bzip.org"> <!ENTITY bz-url "http://www.bzip.org">
<!ENTITY bz-email "jseward@bzip.org"> <!ENTITY bz-email "jseward@bzip.org">
<!ENTITY bz-lifespan "1996-2007"> <!ENTITY bz-lifespan "1996-2010">
<!ENTITY bz-version "1.0.5"> <!ENTITY bz-version "1.0.6">
<!ENTITY bz-date "10 December 2007"> <!ENTITY bz-date "6 September 2010">
<!ENTITY manual-title "bzip2 Manual"> <!ENTITY manual-title "bzip2 Manual">
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
# This file is part of bzip2/libbzip2, a program and library for # This file is part of bzip2/libbzip2, a program and library for
# lossless, block-sorting data compression. # lossless, block-sorting data compression.
# #
# bzip2/libbzip2 version 1.0.5 of 10 December 2007 # bzip2/libbzip2 version 1.0.6 of 6 September 2010
# Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> # Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
# #
# Please read the WARNING, DISCLAIMER and PATENTS sections in the # Please read the WARNING, DISCLAIMER and PATENTS sections in the
# README file. # README file.
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
This file is part of bzip2/libbzip2, a program and library for This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression. lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.5 of 10 December 2007 bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file. README file.
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
# This file is part of bzip2/libbzip2, a program and library for # This file is part of bzip2/libbzip2, a program and library for
# lossless, block-sorting data compression. # lossless, block-sorting data compression.
# #
# bzip2/libbzip2 version 1.0.5 of 10 December 2007 # bzip2/libbzip2 version 1.0.6 of 6 September 2010
# Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> # Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
# #
# Please read the WARNING, DISCLAIMER and PATENTS sections in the # Please read the WARNING, DISCLAIMER and PATENTS sections in the
# README file. # README file.
......
Libpng 1.4.3 - June 26, 2010 Libpng 1.4.4 - September 23, 2010
This is a public release of libpng, intended for use in production codes. This is a public release of libpng, intended for use in production codes.
...@@ -8,29 +8,55 @@ Files available for download: ...@@ -8,29 +8,55 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a Source files with LF line endings (for Unix/Linux) and with a
"configure" script "configure" script
libpng-1.4.3.tar.xz (LZMA-compressed, recommended) libpng-1.4.4.tar.xz (LZMA-compressed, recommended)
libpng-1.4.3.tar.gz libpng-1.4.4.tar.gz
libpng-1.4.3.tar.bz2 libpng-1.4.4.tar.bz2
Source files with CRLF line endings (for Windows), without the Source files with CRLF line endings (for Windows), without the
"configure" script "configure" script
lpng143.zip lpng144.zip
lpng143.7z lpng144.7z
Other information: Other information:
libpng-1.4.3-README.txt libpng-1.4.4-README.txt
libpng-1.4.3-LICENSE.txt libpng-1.4.4-LICENSE.txt
Changes since the last public release (1.4.2): Changes since the last public release (1.4.3):
Added missing quotation marks in the aix block of configure.ac Removed extraneous new_push_process_row.c file.
The new "vstudio" project was missing from the zip and 7z distributions. Revised the "SEE ALSO" style of libpng.3, libpngpf.3, and png.5
Rewrote png_process_IDAT_data to consistently treat extra data as warnings Removed some newly-added TAB characters from pngpread.c.
and handle end conditions more cleanly. Fixed some indentation in pngpread.c and pngrutil.c
Removed the now-redundant check for out-of-bounds new_row from example.c Changed "extern PNG_EXPORT" to "PNG_EXPORT" in png.h (Jan Nijtmans)
Changed char *msg to PNG_CONST char *msg in pngrutil.c Changed "extern" to "PNG_EXTERN" in pngpriv.h (except for the 'extern "C" {')
Stop memory leak when reading a malformed sCAL chunk. Put "#ifndef PNG_EXTERN, #endif" around "#define PNG_EXTERN" in pngpriv.h
Added -DNO_PNG_SNPRINTF to CFLAGS in scripts/makefile.dj2
Moved the definition of png_snprintf() outside of the enclosing
#ifdef blocks in pngconf.h
Made a special case "#define PNGAPI" in pngconf.h for WATCOM.
Removed reference to cbuilder5/* from Makefile.in and Makefile.am
Updated the read macros and functions from 1.5.0beta38.
Updated projects/visualc71 so it can find scripts/pnglibconf.h
Removed unused png_mem_* defines from pngconf.h.
Correct use of _WINDOWS_ in pngconf.h
Don't try to use version-script with cygwin/mingw.
Revised contrib/gregbook to work under cygwin/mingw.
Updated prebuilt aclocal.m4 and ltmain.sh
Add .dll.a to the list of extensions to be symlinked by Makefile.am (Yaakov)
Updated CMakelists.txt to use CMAKE_INSTALL_LIBDIR variable; useful for
installing libpng in /usr/lib64 (Funda Wang).
Revised CMakeLists.txt to put the man pages in share/man/man* not man/man*
Revised CMakeLists.txt to make symlinks instead of copies when installing.
Moved "#include pngusr.h" ahead of PNG_USER_PRIVATEBUILD test in pngconf.h
Eliminated a deprecated reference to png_ptr->io_ptr in pngtest.c
Eliminated new unnecessary #if tests regarding the sCAL chunk from pngrutil.c
Updated the xcode project to work with libpng-1.4.x and added iOS targets
for simulator and device (Philippe Hausler).
Revised autogen.sh to recognize and use $AUTOCONF, $AUTOMAKE, $AUTOHEADER,
$AUTOPOINT, $ACLOCAL and $LIBTOOLIZE
Rebuilt configure scripts with automake-1.11.1 instead of automake-1.11.
Removed unused mkinstalldirs file.
Send comments/corrections/commendations to glennrp at users.sourceforge.net Send comments/corrections/commendations to glennrp at users.sourceforge.net
or to png-mng-implement at lists.sf.net (subscription required; visit or to png-mng-implement at lists.sf.net (subscription required; visit
......
...@@ -2610,6 +2610,76 @@ version 1.4.3rc03 [June 23, 2010] ...@@ -2610,6 +2610,76 @@ version 1.4.3rc03 [June 23, 2010]
version 1.4.3 [June 26, 2010] version 1.4.3 [June 26, 2010]
Updated some of the "last changed" dates. Updated some of the "last changed" dates.
version 1.4.4beta01 [July 12, 2010]
Removed extraneous new_push_process_row.c file.
Revised the "SEE ALSO" style of libpng.3, libpngpf.3, and png.5
Removed some newly-added TAB characters from pngpread.c.
Fixed some indentation in pngpread.c and pngrutil.c
Changed "extern PNG_EXPORT" to "PNG_EXPORT" in png.h (Jan Nijtmans)
Changed "extern" to "PNG_EXTERN" in pngpriv.h (except for the 'extern "C" {')
Put "#ifndef PNG_EXTERN, #endif" around "#define PNG_EXTERN" in pngpriv.h
version 1.4.4beta02 [July 24, 2010]
Added -DNO_PNG_SNPRINTF to CFLAGS in scripts/makefile.dj2
Moved the definition of png_snprintf() outside of the enclosing
#ifdef blocks in pngconf.h
Added a special case typedef of png_longjmp_ptr for WATCOM.
version 1.4.4beta03 [July 24, 2010]
Removed reference to cbuilder5/* from Makefile.in and Makefile.am
Eliminated the new special case typedef of png_longjmp_ptr for WATCOM
and made a special case "#define PNGAPI" in pngconf.h instead.
version 1.4.4beta04 [July 31, 2010]
Updated the read macros and functions from 1.5.0beta38.
version 1.4.4beta05 [August 6, 2010]
Updated projects/visualc71 so it can find scripts/pnglibconf.h
Removed unused png_mem_* defines from pngconf.h.
Correct use of _WINDOWS_ in pngconf.h
version 1.4.4beta06 [August 11, 2010]
Don't try to use version-script with cygwin/mingw.
Revised contrib/gregbook to work under cygwin/mingw.
version 1.4.4beta07 [August 26, 2010]
Updated prebuilt aclocal.m4 and ltmain.sh
Add .dll.a to the list of extensions to be symlinked by Makefile.am (Yaakov)
Updated CMakeLists.txt to use CMAKE_INSTALL_LIBDIR variable; useful for
installing libpng in /usr/lib64 (Funda Wang).
Revised CMakeLists.txt to put the man pages in share/man/man* not man/man*
Revised CMakeLists.txt to make symlinks instead of copies when installing.
Changed PNG_LIB_NAME from pngNN to libpngNN in CMakeLists.txt (Philip Lowman)
Moved "#include pngusr.h" ahead of PNG_USER_PRIVATEBUILD test in pngconf.h
Eliminated a deprecated reference to png_ptr->io_ptr in pngtest.c
Eliminated new unnecessary #if tests regarding the sCAL chunk from pngrutil.c
version 1.4.4beta08 [September 2, 2010]
Updated the xcode project to work with libpng-1.4.x and added iOS targets
for simulator and device (Philippe Hausler).
version 1.4.4rc01 [September 10, 2010]
No changes.
version 1.4.4rc02 [September 13, 2010]
Revised CMakeLists.txt (Philip Lowman).
version 1.4.4rc03 [September 14, 2010]
Removed an extraneous close-double-quote from CMakeLists.txt
Eliminated another deprecated reference to png_ptr->io_ptr in pngtest.c
version 1.4.4rc04 [September 16, 2010]
Fixed indentation and removed debugging message from CMakeLists.txt
Revised autogen.sh to recognize and use $AUTOCONF, $AUTOMAKE, $AUTOHEADER,
$AUTOPOINT, $ACLOCAL and $LIBTOOLIZE
version 1.4.4rc05 [September 20, 2010]
Rebuilt configure scripts with automake-1.11.1 instead of automake-1.11.
Removed unused mkinstalldirs file.
version 1.4.4 [September 23, 2010]
No changes.
Send comments/corrections/commendations to glennrp at users.sourceforge.net Send comments/corrections/commendations to glennrp at users.sourceforge.net
or to png-mng-implement at lists.sf.net (subscription required; visit or to png-mng-implement at lists.sf.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement). https://lists.sourceforge.net/lists/listinfo/png-mng-implement).
......
cmake_minimum_required(VERSION 2.4.3) cmake_minimum_required(VERSION 2.4.4)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
if(UNIX AND NOT DEFINED CMAKE_BUILD_TYPE) if(UNIX AND NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING if(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 4)
"Choose the type of build, options are: # workaround CMake 2.4.x bug
None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
Debug else()
Release set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
RelWithDebInfo "Choose the type of build, options are:
MinSizeRel.") None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used)
Debug
Release
RelWithDebInfo
MinSizeRel.")
endif()
endif() endif()
project(libpng C) project(libpng C)
...@@ -22,7 +27,7 @@ enable_testing() ...@@ -22,7 +27,7 @@ enable_testing()
set(PNGLIB_MAJOR 1) set(PNGLIB_MAJOR 1)
set(PNGLIB_MINOR 4) set(PNGLIB_MINOR 4)
set(PNGLIB_RELEASE 3) set(PNGLIB_RELEASE 4)
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR}) set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
...@@ -101,7 +106,7 @@ set(CMAKE_DEBUG_POSTFIX "d") ...@@ -101,7 +106,7 @@ set(CMAKE_DEBUG_POSTFIX "d")
set(libpng_sources set(libpng_sources
png.h png.h
pngconf.h pngconf.h
pngpriv.h pngpriv.h
png.c png.c
pngerror.c pngerror.c
pngget.c pngget.c
...@@ -167,6 +172,7 @@ if(PNG_SHARED) ...@@ -167,6 +172,7 @@ if(PNG_SHARED)
if(MSVC) if(MSVC)
# msvc does not append 'lib' - do it here to have consistent name # msvc does not append 'lib' - do it here to have consistent name
set_target_properties(${PNG_LIB_NAME} PROPERTIES PREFIX "lib") set_target_properties(${PNG_LIB_NAME} PROPERTIES PREFIX "lib")
set_target_properties(${PNG_LIB_NAME} PROPERTIES IMPORT_PREFIX "lib")
endif() endif()
target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY}) target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY})
endif() endif()
...@@ -179,6 +185,7 @@ if(PNG_STATIC) ...@@ -179,6 +185,7 @@ if(PNG_STATIC)
# msvc does not append 'lib' - do it here to have consistent name # msvc does not append 'lib' - do it here to have consistent name
set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES PREFIX "lib") set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES PREFIX "lib")
endif() endif()
target_link_libraries(${PNG_LIB_NAME_STATIC} ${ZLIB_LIBRARY} ${M_LIBRARY})
endif() endif()
...@@ -190,55 +197,116 @@ if(PNG_TESTS AND PNG_SHARED) ...@@ -190,55 +197,116 @@ if(PNG_TESTS AND PNG_SHARED)
# does not work with msvc due to png_lib_ver issue # does not work with msvc due to png_lib_ver issue
add_executable(pngtest ${pngtest_sources}) add_executable(pngtest ${pngtest_sources})
target_link_libraries(pngtest ${PNG_LIB_NAME}) target_link_libraries(pngtest ${PNG_LIB_NAME})
add_test(pngtest pngtest ${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png) add_test(pngtest ./pngtest ${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png)
endif() endif()
#
# Set a variable with CMake code which:
# Creates a symlink from src to dest (if possible) or alternatively
# copies if different.
macro(_png_generate_symlink_code CODE SRC DEST)
if(WIN32 AND NOT CYGWIN)
set(_png_gsc_message "Copying ${SRC} to ${DEST} if needed")
set(_png_gsc_operation "copy_if_different")
else()
set(_png_gsc_message "Symlinking ${SRC} to ${DEST}")
set(_png_gsc_operation "create_symlink")
endif()
set(${CODE} "
message(STATUS \"${_png_gsc_message}\")
execute_process(COMMAND \${CMAKE_COMMAND} -E ${_png_gsc_operation}
\"${SRC}\" \"${DEST}\")
")
endmacro()
# CREATE PKGCONFIG FILES # CREATE PKGCONFIG FILES
# we use the same files like ./configure, so we have to set its vars # we use the same files like ./configure, so we have to set its vars
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
endif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(prefix ${CMAKE_INSTALL_PREFIX}) set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix ${CMAKE_INSTALL_PREFIX})
set(libdir ${CMAKE_INSTALL_PREFIX}/lib) set(libdir ${CMAKE_INSTALL_LIBDIR})
set(includedir ${CMAKE_INSTALL_PREFIX}/include) set(includedir ${CMAKE_INSTALL_PREFIX}/include)
set(LIBS "-lz -lm")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libpng.pc) ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in _png_generate_symlink_code(PNG_PC_INSTALL_CODE ${PNGLIB_NAME}.pc libpng.pc)
${CMAKE_CURRENT_BINARY_DIR}/libpng-config) install(CODE ${PNG_PC_INSTALL_CODE})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config) ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY)
_png_generate_symlink_code(PNG_CONFIG_INSTALL_CODE ${PNGLIB_NAME}-config libpng-config)
install(CODE ${PNG_CONFIG_INSTALL_CODE})
# SET UP LINKS # SET UP LINKS
if(PNG_SHARED) if(PNG_SHARED)
set_target_properties(${PNG_LIB_NAME} PROPERTIES set_target_properties(${PNG_LIB_NAME} PROPERTIES
# VERSION 14.${PNGLIB_RELEASE}.1.4.3 # VERSION 14.${PNGLIB_RELEASE}.1.4.4
VERSION 14.${PNGLIB_RELEASE}.0 VERSION 14.${PNGLIB_RELEASE}.0
SOVERSION 14 SOVERSION 14
CLEAN_DIRECT_OUTPUT 1) CLEAN_DIRECT_OUTPUT 1)
endif() endif()
if(PNG_STATIC) if(PNG_STATIC)
if(NOT WIN32) # MSVC doesn't use a different file extension for shared vs. static
# that's uncool on win32 - it overwrites our static import lib... # libs. We are able to change OUTPUT_NAME to remove the _static
# for all other platforms.
if(NOT MSVC)
set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES
OUTPUT_NAME ${PNG_LIB_NAME} OUTPUT_NAME ${PNG_LIB_NAME}
CLEAN_DIRECT_OUTPUT 1) CLEAN_DIRECT_OUTPUT 1)
endif() endif()
endif() endif()
# If CMake > 2.4.x, we set a variable used below to export
# targets to an export file.
# TODO: Use VERSION_GREATER after our cmake_minimum_required >= 2.6.2
if(CMAKE_MAJOR_VERSION GREATER 1 AND CMAKE_MINOR_VERSION GREATER 4)
set(PNG_EXPORT_RULE EXPORT libpng)
elseif(CMAKE_MAJOR_VERSION GREATER 2) # future proof
set(PNG_EXPORT_RULE EXPORT libpng)
endif()
# INSTALL # INSTALL
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
if(PNG_SHARED) if(PNG_SHARED)
install(TARGETS ${PNG_LIB_NAME} install(TARGETS ${PNG_LIB_NAME}
RUNTIME DESTINATION bin ${PNG_EXPORT_RULE}
LIBRARY DESTINATION lib RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib) LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
# Create a symlink for libpng.dll.a => libpng14.dll.a on Cygwin
if(CYGWIN)
_png_generate_symlink_code(PNG_SHARED_IMPLIB_INSTALL_CODE
${PNGLIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}
libpng${CMAKE_IMPORT_LIBRARY_SUFFIX})
install(CODE ${PNG_SHARED_IMPLIB_INSTALL_CODE})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
if(NOT WIN32)
_png_generate_symlink_code(PNG_SHARED_INSTALL_CODE
${PNGLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
install(CODE ${PNG_SHARED_INSTALL_CODE})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
endif() endif()
if(PNG_STATIC) if(PNG_STATIC)
install(TARGETS ${PNG_LIB_NAME_STATIC} install(TARGETS ${PNG_LIB_NAME_STATIC}
LIBRARY DESTINATION lib ${PNG_EXPORT_RULE}
ARCHIVE DESTINATION lib) LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(NOT WIN32 OR CYGWIN)
_png_generate_symlink_code(PNG_STATIC_INSTALL_CODE
${PNGLIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
libpng${CMAKE_STATIC_LIBRARY_SUFFIX})
install(CODE ${PNG_STATIC_INSTALL_CODE})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
endif() endif()
endif() endif()
...@@ -253,19 +321,28 @@ if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL ) ...@@ -253,19 +321,28 @@ if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL )
endif() endif()
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
# Install man pages # Install man pages
install(FILES libpng.3 libpngpf.3 DESTINATION man/man3) if(NOT PNG_MAN_DIR)
install(FILES png.5 DESTINATION man/man5) set(PNG_MAN_DIR "share/man")
endif()
install(FILES libpng.3 libpngpf.3 DESTINATION ${PNG_MAN_DIR}/man3)
install(FILES png.5 DESTINATION ${PNG_MAN_DIR}/man5)
# Install pkg-config files # Install pkg-config files
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc
DESTINATION lib/pkgconfig) DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng-config install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config
DESTINATION bin) DESTINATION bin)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc
DESTINATION lib/pkgconfig) DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config
DESTINATION bin) DESTINATION bin)
endif() endif()
# On versions of CMake that support it, create an export file CMake
# users can include() to import our targets
if(PNG_EXPORT_RULE AND NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL )
install(EXPORT libpng DESTINATION lib/libpng FILE lib${PNG_LIB_NAME}.cmake)
endif()
# what's with libpng.txt and all the extra files? # what's with libpng.txt and all the extra files?
......
Installing libpng version 1.4.3 - June 26, 2010 Installing libpng version 1.4.4 - September 23, 2010
On Unix/Linux and similar systems, you can simply type On Unix/Linux and similar systems, you can simply type
...@@ -46,7 +46,7 @@ to have access to the zlib.h and zconf.h include files that ...@@ -46,7 +46,7 @@ to have access to the zlib.h and zconf.h include files that
correspond to the version of zlib that's installed. correspond to the version of zlib that's installed.
You can rename the directories that you downloaded (they You can rename the directories that you downloaded (they
might be called "libpng-1.4.3" or "libpng14" and "zlib-1.2.3" might be called "libpng-1.4.4" or "libpng14" and "zlib-1.2.3"
or "zlib123") so that you have directories called "zlib" and "libpng". or "zlib123") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this: Your directory structure should look like this:
...@@ -62,7 +62,7 @@ Your directory structure should look like this: ...@@ -62,7 +62,7 @@ Your directory structure should look like this:
configure.ac, configure, Makefile.am, Makefile.in, configure.ac, configure, Makefile.am, Makefile.in,
autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in, autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in,
libpng-config.in, aclocal.m4, config.h.in, config.sub, libpng-config.in, aclocal.m4, config.h.in, config.sub,
depcomp, install-sh, mkinstalldirs, test-pngtest.sh depcomp, install-sh, test-pngtest.sh
contrib contrib
gregbook gregbook
pngminim pngminim
...@@ -73,6 +73,7 @@ Your directory structure should look like this: ...@@ -73,6 +73,7 @@ Your directory structure should look like this:
cbuilder5 (Borland) cbuilder5 (Borland)
visualc6 (msvc) visualc6 (msvc)
visualc71 visualc71
vstudio
xcode xcode
scripts scripts
makefile.* makefile.*
......
...@@ -10,8 +10,8 @@ this sentence. ...@@ -10,8 +10,8 @@ this sentence.
This code is released under the libpng license. This code is released under the libpng license.
libpng versions 1.2.6, August 15, 2004, through 1.4.3, June 26, 2010, are libpng versions 1.2.6, August 15, 2004, through 1.4.4, September 23, 2010, are
Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5 distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors with the following individual added to the list of Contributing Authors
...@@ -108,4 +108,4 @@ certification mark of the Open Source Initiative. ...@@ -108,4 +108,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson Glenn Randers-Pehrson
glennrp at users.sourceforge.net glennrp at users.sourceforge.net
June 26, 2010 September 23, 2010
README for libpng version 1.4.3 - June 26, 2010 (shared library 14.0) README for libpng version 1.4.4 - September 23, 2010 (shared library 14.0)
See the note about version numbers near the top of png.h See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng. See INSTALL for instructions on how to install libpng.
...@@ -185,9 +185,9 @@ Files in this distribution: ...@@ -185,9 +185,9 @@ Files in this distribution:
makefile.std => Generic UNIX makefile (cc, creates static makefile.std => Generic UNIX makefile (cc, creates static
libpng.a) libpng.a)
makefile.elf => Linux/ELF makefile symbol versioning, makefile.elf => Linux/ELF makefile symbol versioning,
gcc, creates libpng14.so.14.1.4.3) (gcc, creates libpng14.so.14.1.4.4)
makefile.linux => Linux/ELF makefile makefile.linux => Linux/ELF makefile
(gcc, creates libpng14.so.14.1.4.3) (gcc, creates libpng14.so.14.1.4.4)
makefile.gcc => Generic makefile (gcc, creates static libpng.a) makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from ansi2knr (Requires ansi2knr.c from
...@@ -209,12 +209,12 @@ Files in this distribution: ...@@ -209,12 +209,12 @@ Files in this distribution:
makefile.openbsd => OpenBSD makefile makefile.openbsd => OpenBSD makefile
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib) makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics makefile.sggcc => Silicon Graphics
(gcc, creates libpng14.so.14.1.4.3) (gcc, creates libpng14.so.14.1.4.4)
makefile.sunos => Sun makefile makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng14.so.14.1.4.3) (gcc, creates libpng14.so.14.1.4.4)
makefile.so9 => Solaris 9 makefile makefile.so9 => Solaris 9 makefile
(gcc, creates libpng14.so.14.1.4.3) (gcc, creates libpng14.so.14.1.4.4)
makefile.32sunu => Sun Ultra 32-bit makefile makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile makefile.64sunu => Sun Ultra 64-bit makefile
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
......
#!/bin/sh #!/bin/sh
echo " echo "
There is no \"configure\" script in this distribution of There is no \"configure\" script in this distribution of
libpng-1.4.3. libpng-1.4.4.
Instead, please copy the appropriate makefile for your system from the Instead, please copy the appropriate makefile for your system from the
\"scripts\" directory. Read the INSTALL file for more details. \"scripts\" directory. Read the INSTALL file for more details.
Update, July 2004: you can get a \"configure\" based distribution Update, July 2004: you can get a \"configure\" based distribution
from the libpng distribution sites. Download the file from the libpng distribution sites. Download the file
libpng-1.4.3.tar.gz, libpng-1.4.3.tar.xz, or libpng-1.4.3.tar.bz2 libpng-1.4.4.tar.gz, libpng-1.4.4.tar.xz, or libpng-1.4.4.tar.bz2
" "
...@@ -165,7 +165,7 @@ RUNNING THE PROGRAMS: (VERY) BRIEF INTRO ...@@ -165,7 +165,7 @@ RUNNING THE PROGRAMS: (VERY) BRIEF INTRO
rpng is a simple PNG viewer that can display transparent PNGs with a rpng is a simple PNG viewer that can display transparent PNGs with a
specified background color; for example, specified background color; for example,
rpng -bgcolor #ff0000 toucan.png rpng -bgcolor \#ff0000 toucan.png
would display the image with a red background. rpng2 is a progressive would display the image with a red background. rpng2 is a progressive
viewer that simulates a web browser in some respects; it can display viewer that simulates a web browser in some respects; it can display
......
...@@ -138,7 +138,7 @@ int readpng2_init(mainprog_info *mainprog_ptr) ...@@ -138,7 +138,7 @@ int readpng2_init(mainprog_info *mainprog_ptr)
* version recognizes more chunks, add them to this list. If a * version recognizes more chunks, add them to this list. If a
* future version of readpng2.c recognizes more chunks, delete them * future version of readpng2.c recognizes more chunks, delete them
* from this list. */ * from this list. */
static const png_byte chunks_to_ignore[] = { static /* const */ png_byte chunks_to_ignore[] = {
99, 72, 82, 77, '\0', /* cHRM */ 99, 72, 82, 77, '\0', /* cHRM */
104, 73, 83, 84, '\0', /* hIST */ 104, 73, 83, 84, '\0', /* hIST */
105, 67, 67, 80, '\0', /* iCCP */ 105, 67, 67, 80, '\0', /* iCCP */
......
...@@ -85,7 +85,33 @@ ...@@ -85,7 +85,33 @@
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include <windows.h> #include <windows.h>
#ifdef __CYGWIN__
/* getch replacement. Turns out, we don't really need this,
* but leave it here if we ever enable any of the uses of
* _getch in the main code
*/
#include <unistd.h>
#include <termio.h>
#include <sys/ioctl.h>
int repl_getch( void )
{
char ch;
int fd = fileno(stdin);
struct termio old_tty, new_tty;
ioctl(fd, TCGETA, &old_tty);
new_tty = old_tty;
new_tty.c_lflag &= ~(ICANON | ECHO | ISIG);
ioctl(fd, TCSETA, &new_tty);
fread(&ch, 1, sizeof(ch), stdin);
ioctl(fd, TCSETA, &old_tty);
return ch;
}
#define _getch repl_getch
#else
#include <conio.h> /* only for _getch() */ #include <conio.h> /* only for _getch() */
#endif
/* #define DEBUG : this enables the Trace() macros */ /* #define DEBUG : this enables the Trace() macros */
...@@ -153,7 +179,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) ...@@ -153,7 +179,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
filename = (char *)NULL; filename = (char *)NULL;
#ifndef __CYGWIN__
/* First reenable console output, which normally goes to the bit bucket /* First reenable console output, which normally goes to the bit bucket
* for windowed apps. Closing the console window will terminate the * for windowed apps. Closing the console window will terminate the
* app. Thanks to David.Geldreich@realviz.com for supplying the magical * app. Thanks to David.Geldreich@realviz.com for supplying the magical
...@@ -162,6 +188,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) ...@@ -162,6 +188,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
AllocConsole(); AllocConsole();
freopen("CONOUT$", "a", stderr); freopen("CONOUT$", "a", stderr);
freopen("CONOUT$", "a", stdout); freopen("CONOUT$", "a", stdout);
#endif
/* Next set the default value for our display-system exponent, i.e., /* Next set the default value for our display-system exponent, i.e.,
...@@ -279,7 +306,9 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) ...@@ -279,7 +306,9 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
/* print usage screen if any errors up to this point */ /* print usage screen if any errors up to this point */
if (error) { if (error) {
#ifndef __CYGWIN__
int ch; int ch;
#endif
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname); fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
readpng_version_info(); readpng_version_info();
...@@ -293,11 +322,15 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) ...@@ -293,11 +322,15 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n" "\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
"\t\t used with transparent images\n" "\t\t used with transparent images\n"
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n" "\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
#ifndef __CYGWIN__
"Press Q or Esc to quit this usage screen.\n" "Press Q or Esc to quit this usage screen.\n"
#endif
"\n", PROGNAME, default_display_exponent); "\n", PROGNAME, default_display_exponent);
#ifndef __CYGWIN__
do do
ch = _getch(); ch = _getch();
while (ch != 'q' && ch != 'Q' && ch != 0x1B); while (ch != 'q' && ch != 'Q' && ch != 0x1B);
#endif
exit(1); exit(1);
} }
...@@ -333,18 +366,24 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) ...@@ -333,18 +366,24 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
if (error) { if (error) {
#ifndef __CYGWIN__
int ch; int ch;
#endif
fprintf(stderr, PROGNAME ": aborting.\n"); fprintf(stderr, PROGNAME ": aborting.\n");
#ifndef __CYGWIN__
do do
ch = _getch(); ch = _getch();
while (ch != 'q' && ch != 'Q' && ch != 0x1B); while (ch != 'q' && ch != 'Q' && ch != 0x1B);
#endif
exit(2); exit(2);
} else { } else {
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname); fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
#ifndef __CYGWIN__
fprintf(stderr, fprintf(stderr,
"\n [console window: closing this window will terminate %s]\n\n", "\n [console window: closing this window will terminate %s]\n\n",
PROGNAME); PROGNAME);
#endif
} }
...@@ -417,7 +456,12 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) ...@@ -417,7 +456,12 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
/* wait for the user to tell us when to quit */ /* wait for the user to tell us when to quit */
printf( printf(
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"); #ifndef __CYGWIN__
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"
#else
"Done. Press mouse button 1 (within image window) to quit.\n"
#endif
);
fflush(stdout); fflush(stdout);
while (GetMessage(&msg, NULL, 0, 0)) { while (GetMessage(&msg, NULL, 0, 0)) {
......
...@@ -96,7 +96,33 @@ ...@@ -96,7 +96,33 @@
#include <time.h> #include <time.h>
#include <math.h> /* only for PvdM background code */ #include <math.h> /* only for PvdM background code */
#include <windows.h> #include <windows.h>
#ifdef __CYGWIN__
/* getch replacement. Turns out, we don't really need this,
* but leave it here if we ever enable any of the uses of
* _getch in the main code
*/
#include <unistd.h>
#include <termio.h>
#include <sys/ioctl.h>
int repl_getch( void )
{
char ch;
int fd = fileno(stdin);
struct termio old_tty, new_tty;
ioctl(fd, TCGETA, &old_tty);
new_tty = old_tty;
new_tty.c_lflag &= ~(ICANON | ECHO | ISIG);
ioctl(fd, TCSETA, &new_tty);
fread(&ch, 1, sizeof(ch), stdin);
ioctl(fd, TCSETA, &old_tty);
return ch;
}
#define _getch repl_getch
#else
#include <conio.h> /* only for _getch() */ #include <conio.h> /* only for _getch() */
#endif
/* all for PvdM background code: */ /* all for PvdM background code: */
#ifndef PI #ifndef PI
...@@ -270,7 +296,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) ...@@ -270,7 +296,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
filename = (char *)NULL; filename = (char *)NULL;
memset(&rpng2_info, 0, sizeof(mainprog_info)); memset(&rpng2_info, 0, sizeof(mainprog_info));
#ifndef __CYGWIN__
/* Next reenable console output, which normally goes to the bit bucket /* Next reenable console output, which normally goes to the bit bucket
* for windowed apps. Closing the console window will terminate the * for windowed apps. Closing the console window will terminate the
* app. Thanks to David.Geldreich@realviz.com for supplying the magical * app. Thanks to David.Geldreich@realviz.com for supplying the magical
...@@ -279,7 +305,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) ...@@ -279,7 +305,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
AllocConsole(); AllocConsole();
freopen("CONOUT$", "a", stderr); freopen("CONOUT$", "a", stderr);
freopen("CONOUT$", "a", stdout); freopen("CONOUT$", "a", stdout);
#endif
/* Set the default value for our display-system exponent, i.e., the /* Set the default value for our display-system exponent, i.e., the
* product of the CRT exponent and the exponent corresponding to * product of the CRT exponent and the exponent corresponding to
...@@ -413,7 +439,9 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) ...@@ -413,7 +439,9 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
/* print usage screen if any errors up to this point */ /* print usage screen if any errors up to this point */
if (error) { if (error) {
#ifndef __CYGWIN__
int ch; int ch;
#endif
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname); fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
readpng2_version_info(); readpng2_version_info();
...@@ -432,16 +460,23 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) ...@@ -432,16 +460,23 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
" -timing\tenables delay for every block read, to simulate modem\n" " -timing\tenables delay for every block read, to simulate modem\n"
"\t\t download of image (~36 Kbps)\n" "\t\t download of image (~36 Kbps)\n"
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n" "\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
#ifndef __CYGWIN__
"Press Q or Esc to quit this usage screen. ", "Press Q or Esc to quit this usage screen. ",
#else
,
#endif
PROGNAME, PROGNAME,
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)) #if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)) && \
!(defined(__CYGWIN__) || defined(__MINGW32__))
(int)strlen(PROGNAME), " ", (int)strlen(PROGNAME), " ",
#endif #endif
(int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat); (int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat);
fflush(stderr); fflush(stderr);
#ifndef __CYGWIN__
do do
ch = _getch(); ch = _getch();
while (ch != 'q' && ch != 'Q' && ch != 0x1B); while (ch != 'q' && ch != 'Q' && ch != 0x1B);
#endif
exit(1); exit(1);
} }
...@@ -478,18 +513,24 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode) ...@@ -478,18 +513,24 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
if (error) { if (error) {
#ifndef __CYGWIN__
int ch; int ch;
#endif
fprintf(stderr, PROGNAME ": aborting.\n"); fprintf(stderr, PROGNAME ": aborting.\n");
#ifndef __CYGWIN__
do do
ch = _getch(); ch = _getch();
while (ch != 'q' && ch != 'Q' && ch != 0x1B); while (ch != 'q' && ch != 'Q' && ch != 0x1B);
#endif
exit(2); exit(2);
} else { } else {
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname); fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
#ifndef __CYGWIN__
fprintf(stderr, fprintf(stderr,
"\n [console window: closing this window will terminate %s]\n\n", "\n [console window: closing this window will terminate %s]\n\n",
PROGNAME); PROGNAME);
#endif
fflush(stderr); fflush(stderr);
} }
...@@ -1132,7 +1173,12 @@ static void rpng2_win_finish_display() ...@@ -1132,7 +1173,12 @@ static void rpng2_win_finish_display()
rpng2_info.state = kDone; rpng2_info.state = kDone;
printf( printf(
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"); #ifndef __CYGWIN__
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"
#else
"Done. Press mouse button 1 (within image window) to quit.\n"
#endif
);
fflush(stdout); fflush(stdout);
} }
......
...@@ -12,10 +12,6 @@ ...@@ -12,10 +12,6 @@
#ifndef MINRDPNGCONF_H #ifndef MINRDPNGCONF_H
#define MINRDPNGCONF_H #define MINRDPNGCONF_H
#ifdef NJET
/* No 16-bit support beyond reading with strip_16 */
#endif
#define PNG_NO_WARNINGS #define PNG_NO_WARNINGS
#define png_warning(s1,s2) "" #define png_warning(s1,s2) ""
#define png_chunk_warning(s1,s2) "" #define png_chunk_warning(s1,s2) ""
......
libpng.txt - A description on how to use and modify libpng libpng.txt - A description on how to use and modify libpng
libpng version 1.4.3 - June 26, 2010 libpng version 1.4.4 - September 23, 2010
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net> <glennrp at users.sourceforge.net>
Copyright (c) 1998-2009 Glenn Randers-Pehrson Copyright (c) 1998-2010 Glenn Randers-Pehrson
This document is released under the libpng license. This document is released under the libpng license.
For conditions of distribution and use, see the disclaimer For conditions of distribution and use, see the disclaimer
...@@ -11,9 +11,9 @@ libpng.txt - A description on how to use and modify libpng ...@@ -11,9 +11,9 @@ libpng.txt - A description on how to use and modify libpng
Based on: Based on:
libpng versions 0.97, January 1998, through 1.4.3 - June 26, 2010 libpng versions 0.97, January 1998, through 1.4.4 - September 23, 2010
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2009 Glenn Randers-Pehrson Copyright (c) 1998-2010 Glenn Randers-Pehrson
libpng 1.0 beta 6 version 0.96 May 28, 1997 libpng 1.0 beta 6 version 0.96 May 28, 1997
Updated and distributed by Andreas Dilger Updated and distributed by Andreas Dilger
...@@ -903,7 +903,7 @@ things. ...@@ -903,7 +903,7 @@ things.
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
added. It expands the sample depth without changing tRNS to alpha. added. It expands the sample depth without changing tRNS to alpha.
As of libpng version 1.4.3, not all possible expansions are supported. As of libpng version 1.4.4, not all possible expansions are supported.
In the following table, the 01 means grayscale with depth<8, 31 means In the following table, the 01 means grayscale with depth<8, 31 means
indexed with depth<8, other numerals represent the color type, "T" means indexed with depth<8, other numerals represent the color type, "T" means
...@@ -3297,13 +3297,13 @@ Other rules can be inferred by inspecting the libpng source. ...@@ -3297,13 +3297,13 @@ Other rules can be inferred by inspecting the libpng source.
XIII. Y2K Compliance in libpng XIII. Y2K Compliance in libpng
June 26, 2010 September 23, 2010
Since the PNG Development group is an ad-hoc body, we can't make Since the PNG Development group is an ad-hoc body, we can't make
an official declaration. an official declaration.
This is your unofficial assurance that libpng from version 0.71 and This is your unofficial assurance that libpng from version 0.71 and
upward through 1.4.3 are Y2K compliant. It is my belief that earlier upward through 1.4.4 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant. versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that Libpng only has three year fields. One is a 2-byte unsigned integer that
......
.TH LIBPNG 3 "June 26, 2010" .TH LIBPNG 3 "September 23, 2010"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3 libpng \- Portable Network Graphics (PNG) Reference Library 1.4.4
.SH SYNOPSIS .SH SYNOPSIS
\fI\fB \fI\fB
...@@ -785,10 +785,10 @@ Following is a copy of the libpng.txt file that accompanies libpng. ...@@ -785,10 +785,10 @@ Following is a copy of the libpng.txt file that accompanies libpng.
.SH LIBPNG.TXT .SH LIBPNG.TXT
libpng.txt - A description on how to use and modify libpng libpng.txt - A description on how to use and modify libpng
libpng version 1.4.3 - June 26, 2010 libpng version 1.4.4 - September 23, 2010
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net> <glennrp at users.sourceforge.net>
Copyright (c) 1998-2009 Glenn Randers-Pehrson Copyright (c) 1998-2010 Glenn Randers-Pehrson
This document is released under the libpng license. This document is released under the libpng license.
For conditions of distribution and use, see the disclaimer For conditions of distribution and use, see the disclaimer
...@@ -796,9 +796,9 @@ libpng.txt - A description on how to use and modify libpng ...@@ -796,9 +796,9 @@ libpng.txt - A description on how to use and modify libpng
Based on: Based on:
libpng versions 0.97, January 1998, through 1.4.3 - June 26, 2010 libpng versions 0.97, January 1998, through 1.4.4 - September 23, 2010
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2009 Glenn Randers-Pehrson Copyright (c) 1998-2010 Glenn Randers-Pehrson
libpng 1.0 beta 6 version 0.96 May 28, 1997 libpng 1.0 beta 6 version 0.96 May 28, 1997
Updated and distributed by Andreas Dilger Updated and distributed by Andreas Dilger
...@@ -1688,7 +1688,7 @@ things. ...@@ -1688,7 +1688,7 @@ things.
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
added. It expands the sample depth without changing tRNS to alpha. added. It expands the sample depth without changing tRNS to alpha.
As of libpng version 1.4.3, not all possible expansions are supported. As of libpng version 1.4.4, not all possible expansions are supported.
In the following table, the 01 means grayscale with depth<8, 31 means In the following table, the 01 means grayscale with depth<8, 31 means
indexed with depth<8, other numerals represent the color type, "T" means indexed with depth<8, other numerals represent the color type, "T" means
...@@ -4082,13 +4082,13 @@ Other rules can be inferred by inspecting the libpng source. ...@@ -4082,13 +4082,13 @@ Other rules can be inferred by inspecting the libpng source.
.SH XIII. Y2K Compliance in libpng .SH XIII. Y2K Compliance in libpng
June 26, 2010 September 23, 2010
Since the PNG Development group is an ad-hoc body, we can't make Since the PNG Development group is an ad-hoc body, we can't make
an official declaration. an official declaration.
This is your unofficial assurance that libpng from version 0.71 and This is your unofficial assurance that libpng from version 0.71 and
upward through 1.4.3 are Y2K compliant. It is my belief that earlier upward through 1.4.4 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant. versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that Libpng only has three year fields. One is a 2-byte unsigned integer that
...@@ -4272,6 +4272,8 @@ the first widely used release: ...@@ -4272,6 +4272,8 @@ the first widely used release:
1.4.3beta01-05 14 10403 14.so.14.3[.0] 1.4.3beta01-05 14 10403 14.so.14.3[.0]
1.4.3rc01-03 14 10403 14.so.14.3[.0] 1.4.3rc01-03 14 10403 14.so.14.3[.0]
1.4.3 14 10403 14.so.14.3[.0] 1.4.3 14 10403 14.so.14.3[.0]
1.4.4beta01-08 14 10404 14.so.14.4[.0]
1.4.4rc01-06 14 10404 14.so.14.4[.0]
Henceforth the source version will match the shared-library minor Henceforth the source version will match the shared-library minor
and patch numbers; the shared-library major version number will be and patch numbers; the shared-library major version number will be
...@@ -4284,7 +4286,7 @@ version 1.0.6j; from then on they were given the upcoming public ...@@ -4284,7 +4286,7 @@ version 1.0.6j; from then on they were given the upcoming public
release number plus "betaNN" or "rcN". release number plus "betaNN" or "rcN".
.SH "SEE ALSO" .SH "SEE ALSO"
libpngpf(3), png(5) .BR "png"(5), " libpngpf"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
.LP .LP
.IR libpng : .IR libpng :
.IP .IP
...@@ -4327,7 +4329,7 @@ possible without all of you. ...@@ -4327,7 +4329,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation. Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.4.3 - June 26, 2010: Libpng version 1.4.4 - September 23, 2010:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
...@@ -4350,7 +4352,7 @@ this sentence. ...@@ -4350,7 +4352,7 @@ this sentence.
This code is released under the libpng license. This code is released under the libpng license.
libpng versions 1.2.6, August 15, 2004, through 1.4.3, June 26, 2010, are libpng versions 1.2.6, August 15, 2004, through 1.4.4, September 23, 2010, are
Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5 distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors with the following individual added to the list of Contributing Authors
...@@ -4449,7 +4451,7 @@ certification mark of the Open Source Initiative. ...@@ -4449,7 +4451,7 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson Glenn Randers-Pehrson
glennrp at users.sourceforge.net glennrp at users.sourceforge.net
June 26, 2010 September 23, 2010
.\" end of man page .\" end of man page
.TH LIBPNGPF 3 "June 26, 2010" .TH LIBPNGPF 3 "September 23, 2010"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3 libpng \- Portable Network Graphics (PNG) Reference Library 1.4.4
(private functions) (private functions)
.SH SYNOPSIS .SH SYNOPSIS
\fB#include <png.h>\fP \fB#include <png.h>\fP
...@@ -803,6 +803,6 @@ are listed alphabetically here as an aid to libpng maintainers. ...@@ -803,6 +803,6 @@ are listed alphabetically here as an aid to libpng maintainers.
See png.h for more information on these functions. See png.h for more information on these functions.
.SH SEE ALSO .SH SEE ALSO
libpng(3), png(5) .BR "png"(5), " libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
.SH AUTHOR .SH AUTHOR
Glenn Randers-Pehrson Glenn Randers-Pehrson
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;
png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
png_ptr->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]));
png_memcpy(png_ptr->prev_row, png_ptr->row_buf, png_ptr->rowbytes + 1);
if (png_ptr->transformations || (png_ptr->flags&PNG_FLAG_STRIP_ALPHA))
png_do_read_transformations(png_ptr);
#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);
switch (png_ptr->pass)
{
case 0:
{
int i;
for (i = 0; i < 8 && png_ptr->pass == 0; i++)
{
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
png_read_push_finish_row(png_ptr); /* Updates png_ptr->pass */
}
if (png_ptr->pass == 2) /* Pass 1 might be empty */
{
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
{
png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr);
}
}
if (png_ptr->pass == 4 && png_ptr->height <= 4)
{
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
{
png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr);
}
}
if (png_ptr->pass == 6 && png_ptr->height <= 4)
{
png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr);
}
break;
}
case 1:
{
int i;
for (i = 0; i < 8 && png_ptr->pass == 1; i++)
{
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
png_read_push_finish_row(png_ptr);
}
if (png_ptr->pass == 2) /* Skip top 4 generated rows */
{
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
{
png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr);
}
}
break;
}
case 2:
{
int i;
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
{
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
png_read_push_finish_row(png_ptr);
}
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
{
png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr);
}
if (png_ptr->pass == 4) /* Pass 3 might be empty */
{
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
{
png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr);
}
}
break;
}
case 3:
{
int i;
for (i = 0; i < 4 && png_ptr->pass == 3; i++)
{
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
png_read_push_finish_row(png_ptr);
}
if (png_ptr->pass == 4) /* Skip top two generated rows */
{
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
{
png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr);
}
}
break;
}
case 4:
{
int i;
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
{
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
png_read_push_finish_row(png_ptr);
}
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
{
png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr);
}
if (png_ptr->pass == 6) /* Pass 5 might be empty */
{
png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr);
}
break;
}
case 5:
{
int i;
for (i = 0; i < 2 && png_ptr->pass == 5; i++)
{
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
png_read_push_finish_row(png_ptr);
}
if (png_ptr->pass == 6) /* Skip top generated row */
{
png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr);
}
break;
}
case 6:
{
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
png_read_push_finish_row(png_ptr);
if (png_ptr->pass != 6)
break;
png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr);
}
}
}
else
#endif
{
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
png_read_push_finish_row(png_ptr);
}
}
.TH PNG 5 "June 26, 2010" .TH PNG 5 "September 23, 2010"
.SH NAME .SH NAME
png \- Portable Network Graphics (PNG) format png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION .SH DESCRIPTION
...@@ -18,7 +18,7 @@ gamma and chromaticity data for improved color matching on heterogeneous ...@@ -18,7 +18,7 @@ gamma and chromaticity data for improved color matching on heterogeneous
platforms. platforms.
.SH "SEE ALSO" .SH "SEE ALSO"
.IR libpng(3), zlib(3), deflate(5), and zlib(5) .BR "libpng"(3), " libpngpf"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
.LP .LP
PNG specification (second edition), November 2003: PNG specification (second edition), November 2003:
.IP .IP
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "pngpriv.h" #include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */ /* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_4_3 Your_png_h_is_not_version_1_4_3; typedef version_1_4_4 Your_png_h_is_not_version_1_4_4;
/* Version information for C files. This had better match the version /* Version information for C files. This had better match the version
* string defined in png.h. * string defined in png.h.
...@@ -551,13 +551,13 @@ png_get_copyright(png_structp png_ptr) ...@@ -551,13 +551,13 @@ png_get_copyright(png_structp png_ptr)
#else #else
#ifdef __STDC__ #ifdef __STDC__
return ((png_charp) PNG_STRING_NEWLINE \ return ((png_charp) PNG_STRING_NEWLINE \
"libpng version 1.4.3 - June 26, 2010" PNG_STRING_NEWLINE \ "libpng version 1.4.4 - September 23, 2010" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2010 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2010 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE); PNG_STRING_NEWLINE);
#else #else
return ((png_charp) "libpng version 1.4.3 - June 26, 2010\ return ((png_charp) "libpng version 1.4.4 - September 23, 2010\
Copyright (c) 1998-2010 Glenn Randers-Pehrson\ Copyright (c) 1998-2010 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."); Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
......
This diff is collapsed.
/* pngconf.h - machine configurable file for libpng /* pngconf.h - machine configurable file for libpng
* *
* libpng version 1.4.3 - June 26, 2010 * libpng version 1.4.4 - September 23, 2010
* For conditions of distribution and use, see copyright notice in png.h * For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2010 Glenn Randers-Pehrson * Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
...@@ -44,14 +44,14 @@ ...@@ -44,14 +44,14 @@
* includes the resource compiler for Windows DLL configurations. * includes the resource compiler for Windows DLL configurations.
*/ */
#ifdef PNG_USER_CONFIG #ifdef PNG_USER_CONFIG
# include "pngusr.h"
# ifndef PNG_USER_PRIVATEBUILD # ifndef PNG_USER_PRIVATEBUILD
# define PNG_USER_PRIVATEBUILD # define PNG_USER_PRIVATEBUILD
# endif # endif
# include "pngusr.h"
#endif #endif
/* /*
* If you create a private DLL you need to define in "pngusr.h" the followings: * If you create a private DLL you should define in "pngusr.h" the following:
* #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of
* the DLL was built> * the DLL was built>
* e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons." * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons."
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
* distinguish your DLL from those of the official release. These * distinguish your DLL from those of the official release. These
* correspond to the trailing letters that come after the version * correspond to the trailing letters that come after the version
* number and must match your private DLL name> * number and must match your private DLL name>
* e.g. // private DLL "libpng13gx.dll" * e.g. // private DLL "libpng14gx.dll"
* #define PNG_USER_DLLFNAME_POSTFIX "gx" * #define PNG_USER_DLLFNAME_POSTFIX "gx"
* *
* The following macros are also at your disposal if you want to complete the * The following macros are also at your disposal if you want to complete the
...@@ -269,11 +269,19 @@ ...@@ -269,11 +269,19 @@
* #define PNG_NO_STDIO * #define PNG_NO_STDIO
*/ */
#ifdef _WIN32_WCE
# define PNG_NO_CONSOLE_IO
# define PNG_NO_STDIO
# define PNG_NO_TIME_RFC1123
# ifdef PNG_DEBUG
# undef PNG_DEBUG
# endif
#endif
#if !defined(PNG_NO_STDIO) && !defined(PNG_STDIO_SUPPORTED) #if !defined(PNG_NO_STDIO) && !defined(PNG_STDIO_SUPPORTED)
# define PNG_STDIO_SUPPORTED # define PNG_STDIO_SUPPORTED
#endif #endif
#ifdef PNG_BUILD_DLL #ifdef PNG_BUILD_DLL
# if !defined(PNG_CONSOLE_IO_SUPPORTED) && !defined(PNG_NO_CONSOLE_IO) # if !defined(PNG_CONSOLE_IO_SUPPORTED) && !defined(PNG_NO_CONSOLE_IO)
# define PNG_NO_CONSOLE_IO # define PNG_NO_CONSOLE_IO
...@@ -439,7 +447,7 @@ ...@@ -439,7 +447,7 @@
/* The following uses const char * instead of char * for error /* The following uses const char * instead of char * for error
* and warning message functions, so some compilers won't complain. * and warning message functions, so some compilers won't complain.
* If you do not want to use const, define PNG_NO_CONST here. * If you do not want to use const, define PNG_NO_CONST.
*/ */
#ifndef PNG_CONST #ifndef PNG_CONST
...@@ -454,8 +462,10 @@ ...@@ -454,8 +462,10 @@
* library that you will not be using. I wish I could figure out how to * library that you will not be using. I wish I could figure out how to
* automate this, but I can't do that without making it seriously hard * automate this, but I can't do that without making it seriously hard
* on the users. So if you are not using an ability, change the #define * on the users. So if you are not using an ability, change the #define
* to and #undef, and that part of the library will not be compiled. If * to an #undef, or pass in PNG_NO_feature and that part of the library
* your linker can't find a function, you may want to make sure the * will not be compiled.
* If your linker can't find a function, you may want to make sure the
* ability is defined here. Some of these depend upon some others being * ability is defined here. Some of these depend upon some others being
* defined. I haven't figured out all the interactions here, so you may * defined. I haven't figured out all the interactions here, so you may
* have to experiment awhile to get everything to compile. If you are * have to experiment awhile to get everything to compile. If you are
...@@ -1114,7 +1124,7 @@ typedef unsigned char png_byte; ...@@ -1114,7 +1124,7 @@ typedef unsigned char png_byte;
#else #else
typedef size_t png_size_t; typedef size_t png_size_t;
#endif #endif
#define png_sizeof(x) sizeof(x) #define png_sizeof(x) (sizeof (x))
/* The following is needed for medium model support. It cannot be in the /* The following is needed for medium model support. It cannot be in the
* pngpriv.h header. Needs modification for other compilers besides * pngpriv.h header. Needs modification for other compilers besides
...@@ -1236,6 +1246,13 @@ typedef char FAR * FAR * FAR * png_charppp; ...@@ -1236,6 +1246,13 @@ typedef char FAR * FAR * FAR * png_charppp;
# define PNG_DLL # define PNG_DLL
#endif #endif
/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
* you may get warnings regarding the linkage of png_zalloc and png_zfree.
* Don't ignore those warnings; you must also reset the default calling
* convention in your compiler to match your PNGAPI, and you must build
* zlib and your applications the same way you build libpng.
*/
#ifdef __CYGWIN__ #ifdef __CYGWIN__
# undef PNGAPI # undef PNGAPI
# define PNGAPI __cdecl # define PNGAPI __cdecl
...@@ -1243,14 +1260,11 @@ typedef char FAR * FAR * FAR * png_charppp; ...@@ -1243,14 +1260,11 @@ typedef char FAR * FAR * FAR * png_charppp;
# define PNG_IMPEXP # define PNG_IMPEXP
#endif #endif
#define PNG_USE_LOCAL_ARRAYS /* Not used in libpng, defined for legacy apps */ #ifdef __WATCOMC__
# ifndef PNGAPI
/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", # define PNGAPI
* you may get warnings regarding the linkage of png_zalloc and png_zfree. # endif
* Don't ignore those warnings; you must also reset the default calling #endif
* convention in your compiler to match your PNGAPI, and you must build
* zlib and your applications the same way you build libpng.
*/
#if defined(__MINGW32__) && !defined(PNG_MODULEDEF) #if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
# ifndef PNG_NO_MODULEDEF # ifndef PNG_NO_MODULEDEF
...@@ -1335,6 +1349,8 @@ typedef char FAR * FAR * FAR * png_charppp; ...@@ -1335,6 +1349,8 @@ typedef char FAR * FAR * FAR * png_charppp;
# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol # define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
#endif #endif
#define PNG_USE_LOCAL_ARRAYS /* Not used in libpng, defined for legacy apps */
/* Support for compiler specific function attributes. These are used /* Support for compiler specific function attributes. These are used
* so that where compiler support is available incorrect use of API * so that where compiler support is available incorrect use of API
* functions in png.h will generate compiler warnings. * functions in png.h will generate compiler warnings.
...@@ -1412,7 +1428,7 @@ typedef char FAR * FAR * FAR * png_charppp; ...@@ -1412,7 +1428,7 @@ typedef char FAR * FAR * FAR * png_charppp;
/* memory model/platform independent fns */ /* memory model/platform independent fns */
#ifndef PNG_ABORT #ifndef PNG_ABORT
# ifdef _WINDOWS_ # if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_))
# define PNG_ABORT() ExitProcess(0) # define PNG_ABORT() ExitProcess(0)
# else # else
# define PNG_ABORT() abort() # define PNG_ABORT() abort()
...@@ -1433,7 +1449,8 @@ typedef char FAR * FAR * FAR * png_charppp; ...@@ -1433,7 +1449,8 @@ typedef char FAR * FAR * FAR * png_charppp;
# define png_memset _fmemset # define png_memset _fmemset
# define png_sprintf sprintf # define png_sprintf sprintf
#else #else
# ifdef _WINDOWS_ /* Favor Windows over C runtime fns */ # if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_))
# /* Favor Windows over C runtime fns */
# define CVT_PTR(ptr) (ptr) # define CVT_PTR(ptr) (ptr)
# define CVT_PTR_NOCHECK(ptr) (ptr) # define CVT_PTR_NOCHECK(ptr) (ptr)
# define png_strcpy lstrcpyA # define png_strcpy lstrcpyA
...@@ -1453,31 +1470,32 @@ typedef char FAR * FAR * FAR * png_charppp; ...@@ -1453,31 +1470,32 @@ typedef char FAR * FAR * FAR * png_charppp;
# define png_memcpy memcpy # define png_memcpy memcpy
# define png_memset memset # define png_memset memset
# define png_sprintf sprintf # define png_sprintf sprintf
# ifndef PNG_NO_SNPRINTF
# ifdef _MSC_VER
# define png_snprintf _snprintf /* Added to v 1.2.19 */
# define png_snprintf2 _snprintf
# define png_snprintf6 _snprintf
# else
# define png_snprintf snprintf /* Added to v 1.2.19 */
# define png_snprintf2 snprintf
# define png_snprintf6 snprintf
# endif
# else
/* You don't have or don't want to use snprintf(). Caution: Using
* sprintf instead of snprintf exposes your application to accidental
* or malevolent buffer overflows. If you don't have snprintf()
* as a general rule you should provide one (you can get one from
* Portable OpenSSH).
*/
# define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1)
# define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2)
# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
# endif
# endif # endif
#endif #endif
#ifndef PNG_NO_SNPRINTF
# ifdef _MSC_VER
# define png_snprintf _snprintf /* Added to v 1.2.19 */
# define png_snprintf2 _snprintf
# define png_snprintf6 _snprintf
# else
# define png_snprintf snprintf /* Added to v 1.2.19 */
# define png_snprintf2 snprintf
# define png_snprintf6 snprintf
# endif
#else
/* You don't have or don't want to use snprintf(). Caution: Using
* sprintf instead of snprintf exposes your application to accidental
* or malevolent buffer overflows. If you don't have snprintf()
* as a general rule you should provide one (you can get one from
* Portable OpenSSH).
*/
# define png_snprintf(s1,n,fmt,x1) png_sprintf(s1,fmt,x1)
# define png_snprintf2(s1,n,fmt,x1,x2) png_sprintf(s1,fmt,x1,x2)
# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
png_sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
#endif
/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, /* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
* and no smaller than png_uint_32. Casts from png_size_t or png_uint_32 * and no smaller than png_uint_32. Casts from png_size_t or png_uint_32
* to png_alloc_size_t are not necessary; in fact, it is recommended * to png_alloc_size_t are not necessary; in fact, it is recommended
...@@ -1488,22 +1506,19 @@ typedef char FAR * FAR * FAR * png_charppp; ...@@ -1488,22 +1506,19 @@ typedef char FAR * FAR * FAR * png_charppp;
* to encounter practical situations that require such conversions. * to encounter practical situations that require such conversions.
*/ */
#if defined(__TURBOC__) && !defined(__FLAT__) #if defined(__TURBOC__) && !defined(__FLAT__)
# define png_mem_alloc farmalloc
# define png_mem_free farfree
typedef unsigned long png_alloc_size_t; typedef unsigned long png_alloc_size_t;
#else #else
# if defined(_MSC_VER) && defined(MAXSEG_64K) # if defined(_MSC_VER) && defined(MAXSEG_64K)
# define png_mem_alloc(s) halloc(s, 1)
# define png_mem_free hfree
typedef unsigned long png_alloc_size_t; typedef unsigned long png_alloc_size_t;
# else # else
# if defined(_WINDOWS_) && (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL) /* This is an attempt to detect an old Windows system where (int) is
# define png_mem_alloc(s) HeapAlloc(GetProcessHeap(), 0, s) * actually 16 bits, in that case png_malloc must have an argument with a
# define png_mem_free(p) HeapFree(GetProcessHeap(), 0, p) * bigger size to accomodate the requirements of the library.
typedef DWORD png_alloc_size_t; */
# if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
(!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
typedef DWORD png_alloc_size_t;
# else # else
# define png_mem_alloc malloc
# define png_mem_free free
typedef png_size_t png_alloc_size_t; typedef png_size_t png_alloc_size_t;
# endif # endif
# endif # endif
......
...@@ -843,7 +843,7 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer, ...@@ -843,7 +843,7 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
* or the stream marked as finished. * or the stream marked as finished.
*/ */
while (png_ptr->zstream.avail_in > 0 && while (png_ptr->zstream.avail_in > 0 &&
!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) !(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
{ {
int ret; int ret;
...@@ -872,49 +872,49 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer, ...@@ -872,49 +872,49 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
/* Check for any failure before proceeding. */ /* Check for any failure before proceeding. */
if (ret != Z_OK && ret != Z_STREAM_END) if (ret != Z_OK && ret != Z_STREAM_END)
{ {
/* Terminate the decompression. */ /* Terminate the decompression. */
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
/* This may be a truncated stream (missing or /* This may be a truncated stream (missing or
* damaged end code). Treat that as a warning. * damaged end code). Treat that as a warning.
*/ */
if (png_ptr->row_number >= png_ptr->num_rows || if (png_ptr->row_number >= png_ptr->num_rows ||
png_ptr->pass > 6) png_ptr->pass > 6)
png_warning(png_ptr, "Truncated compressed data in IDAT"); png_warning(png_ptr, "Truncated compressed data in IDAT");
else else
png_error(png_ptr, "Decompression error in IDAT"); png_error(png_ptr, "Decompression error in IDAT");
/* Skip the check on unprocessed input */ /* Skip the check on unprocessed input */
return; return;
} }
/* Did inflate output any data? */ /* Did inflate output any data? */
if (png_ptr->zstream.next_out != png_ptr->row_buf) if (png_ptr->zstream.next_out != png_ptr->row_buf)
{ {
/* Is this unexpected data after the last row? /* Is this unexpected data after the last row?
* If it is, artificially terminate the LZ output * If it is, artificially terminate the LZ output
* here. * here.
*/ */
if (png_ptr->row_number >= png_ptr->num_rows || if (png_ptr->row_number >= png_ptr->num_rows ||
png_ptr->pass > 6) png_ptr->pass > 6)
{ {
/* Extra data. */ /* Extra data. */
png_warning(png_ptr, "Extra compressed data in IDAT"); png_warning(png_ptr, "Extra compressed data in IDAT");
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
/* Do no more processing; skip the unprocessed /* Do no more processing; skip the unprocessed
* input check below. * input check below.
*/ */
return; return;
} }
/* Do we have a complete row? */ /* Do we have a complete row? */
if (png_ptr->zstream.avail_out == 0) if (png_ptr->zstream.avail_out == 0)
png_push_process_row(png_ptr); png_push_process_row(png_ptr);
} }
/* And check for the end of the stream. */ /* And check for the end of the stream. */
if (ret == Z_STREAM_END) if (ret == Z_STREAM_END)
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
} }
/* All the data should have been processed, if anything /* All the data should have been processed, if anything
...@@ -988,7 +988,7 @@ png_push_process_row(png_structp png_ptr) ...@@ -988,7 +988,7 @@ png_push_process_row(png_structp png_ptr)
if (png_ptr->pass == 6 && png_ptr->height <= 4) if (png_ptr->pass == 6 && png_ptr->height <= 4)
{ {
png_push_have_row(png_ptr, NULL); png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr); png_read_push_finish_row(png_ptr);
} }
...@@ -1028,7 +1028,7 @@ png_push_process_row(png_structp png_ptr) ...@@ -1028,7 +1028,7 @@ png_push_process_row(png_structp png_ptr)
for (i = 0; i < 4 && png_ptr->pass == 2; i++) for (i = 0; i < 4 && png_ptr->pass == 2; i++)
{ {
png_push_have_row(png_ptr, NULL); png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr); png_read_push_finish_row(png_ptr);
} }
...@@ -1078,13 +1078,13 @@ png_push_process_row(png_structp png_ptr) ...@@ -1078,13 +1078,13 @@ png_push_process_row(png_structp png_ptr)
for (i = 0; i < 2 && png_ptr->pass == 4; i++) for (i = 0; i < 2 && png_ptr->pass == 4; i++)
{ {
png_push_have_row(png_ptr, NULL); png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr); png_read_push_finish_row(png_ptr);
} }
if (png_ptr->pass == 6) /* Pass 5 might be empty */ if (png_ptr->pass == 6) /* Pass 5 might be empty */
{ {
png_push_have_row(png_ptr, NULL); png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr); png_read_push_finish_row(png_ptr);
} }
...@@ -1103,7 +1103,7 @@ png_push_process_row(png_structp png_ptr) ...@@ -1103,7 +1103,7 @@ png_push_process_row(png_structp png_ptr)
if (png_ptr->pass == 6) /* Skip top generated row */ if (png_ptr->pass == 6) /* Skip top generated row */
{ {
png_push_have_row(png_ptr, NULL); png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr); png_read_push_finish_row(png_ptr);
} }
...@@ -1117,7 +1117,7 @@ png_push_process_row(png_structp png_ptr) ...@@ -1117,7 +1117,7 @@ png_push_process_row(png_structp png_ptr)
if (png_ptr->pass != 6) if (png_ptr->pass != 6)
break; break;
png_push_have_row(png_ptr, NULL); png_push_have_row(png_ptr, NULL);
png_read_push_finish_row(png_ptr); png_read_push_finish_row(png_ptr);
} }
} }
......
/* pngpriv.h - private declarations for use inside libpng /* pngpriv.h - private declarations for use inside libpng
* *
* libpng version 1.4.3 - June 26, 2010 * libpng version 1.4.4 - September 23, 2010
* For conditions of distribution and use, see copyright notice in png.h * For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2010 Glenn Randers-Pehrson * Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
...@@ -28,14 +28,16 @@ ...@@ -28,14 +28,16 @@
#include <stdlib.h> #include <stdlib.h>
#ifndef PNG_EXTERN
/* The functions exported by PNG_EXTERN are internal functions, which /* 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 * 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 * debatable if they should be exported at all. In the future, when it
* is possible to have run-time registry of chunk-handling functions, * is possible to have run-time registry of chunk-handling functions,
* some of these will be made available again. * some of these will be made available again.
#define PNG_EXTERN extern # define PNG_EXTERN extern
*/ */
#define PNG_EXTERN # define PNG_EXTERN
#endif
/* Other defines specific to compilers can go here. Try to keep /* Other defines specific to compilers can go here. Try to keep
* them inside an appropriate ifdef/endif pair for portability. * them inside an appropriate ifdef/endif pair for portability.
...@@ -75,10 +77,6 @@ ...@@ -75,10 +77,6 @@
#if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \ #if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \
defined(_WIN32) || defined(__WIN32__) defined(_WIN32) || defined(__WIN32__)
# include <windows.h> /* defines _WINDOWS_ macro */ # include <windows.h> /* defines _WINDOWS_ macro */
/* I have no idea why is this necessary... */
# ifdef _MSC_VER
# include <malloc.h>
# endif
#endif #endif
/* Various modes of operation. Note that after an init, mode is set to /* Various modes of operation. Note that after an init, mode is set to
...@@ -672,7 +670,7 @@ PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr, ...@@ -672,7 +670,7 @@ PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr,
#endif #endif
#ifdef PNG_READ_iCCP_SUPPORTED #ifdef PNG_READ_iCCP_SUPPORTED
extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr, PNG_EXTERN void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length)); png_uint_32 length));
#endif /* PNG_READ_iCCP_SUPPORTED */ #endif /* PNG_READ_iCCP_SUPPORTED */
...@@ -707,7 +705,7 @@ PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr, ...@@ -707,7 +705,7 @@ PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
#endif #endif
#ifdef PNG_READ_sPLT_SUPPORTED #ifdef PNG_READ_sPLT_SUPPORTED
extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr, PNG_EXTERN void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length)); png_uint_32 length));
#endif /* PNG_READ_sPLT_SUPPORTED */ #endif /* PNG_READ_sPLT_SUPPORTED */
...@@ -828,14 +826,14 @@ PNG_EXTERN void png_check_IHDR PNGARG((png_structp png_ptr, ...@@ -828,14 +826,14 @@ PNG_EXTERN void png_check_IHDR PNGARG((png_structp png_ptr,
int filter_type)); int filter_type));
/* Free all memory used by the read (old method - NOT DLL EXPORTED) */ /* Free all memory used by the read (old method - NOT DLL EXPORTED) */
extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr, PNG_EXTERN void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr,
png_infop end_info_ptr)); png_infop end_info_ptr));
/* Free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */ /* Free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */
extern void png_write_destroy PNGARG((png_structp png_ptr)); PNG_EXTERN void png_write_destroy PNGARG((png_structp png_ptr));
#ifdef USE_FAR_KEYWORD /* memory model conversion function */ #ifdef USE_FAR_KEYWORD /* memory model conversion function */
extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr, PNG_EXTERN void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr,
int check)); int check));
#endif /* USE_FAR_KEYWORD */ #endif /* USE_FAR_KEYWORD */
......
/* pngrutil.c - utilities to read a PNG file /* pngrutil.c - utilities to read a PNG file
* *
* Last changed in libpng 1.4.3 [June 26, 2010] * Last changed in libpng 1.4.4 [August 26, 2010]
* Copyright (c) 1998-2010 Glenn Randers-Pehrson * Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
...@@ -30,38 +30,41 @@ png_get_uint_31(png_structp png_ptr, png_bytep buf) ...@@ -30,38 +30,41 @@ png_get_uint_31(png_structp png_ptr, png_bytep buf)
} }
#ifndef PNG_USE_READ_MACROS #ifndef PNG_USE_READ_MACROS
/* Grab an unsigned 32-bit integer from a buffer in big-endian format. */ /* Grab an unsigned 32-bit integer from a buffer in big-endian format. */
png_uint_32 PNGAPI png_uint_32 (PNGAPI
png_get_uint_32(png_bytep buf) png_get_uint_32)(png_bytep buf)
{ {
png_uint_32 i = ((png_uint_32)(*buf) << 24) + png_uint_32 i =
((png_uint_32)(*(buf + 1)) << 16) + ((png_uint_32)(*(buf )) << 24) +
((png_uint_32)(*(buf + 2)) << 8) + ((png_uint_32)(*(buf + 1)) << 16) +
(png_uint_32)(*(buf + 3)); ((png_uint_32)(*(buf + 2)) << 8) +
((png_uint_32)(*(buf + 3)) ) ;
return (i); return (i);
} }
/* Grab a signed 32-bit integer from a buffer in big-endian format. The /* Grab a signed 32-bit integer from a buffer in big-endian format. The
* data is stored in the PNG file in two's complement format, and it is * data is stored in the PNG file in two's complement format and there
* assumed that the machine format for signed integers is the same. * is no guarantee that a 'png_int_32' is exactly 32 bits, therefore
* the following code does a two's complement to native conversion.
*/ */
png_int_32 PNGAPI png_int_32 (PNGAPI
png_get_int_32(png_bytep buf) png_get_int_32)(png_bytep buf)
{ {
png_int_32 i = ((png_int_32)(*buf) << 24) + png_uint_32 u = png_get_uint_32(buf);
((png_int_32)(*(buf + 1)) << 16) + if ((u & 0x80000000) == 0) /* non-negative */
((png_int_32)(*(buf + 2)) << 8) + return u;
(png_int_32)(*(buf + 3));
return (i); u = (u ^ 0xffffffff) + 1; /* 2's complement: -x = ~x+1 */
return -(png_int_32)u;
} }
/* Grab an unsigned 16-bit integer from a buffer in big-endian format. */ /* Grab an unsigned 16-bit integer from a buffer in big-endian format. */
png_uint_16 PNGAPI png_uint_16 (PNGAPI
png_get_uint_16(png_bytep buf) png_get_uint_16)(png_bytep buf)
{ {
png_uint_16 i = (png_uint_16)(((png_uint_16)(*buf) << 8) + png_uint_16 i =
(png_uint_16)(*(buf + 1))); ((png_uint_32)(*buf) << 8) +
((png_uint_32)(*(buf + 1)));
return (i); return (i);
} }
...@@ -1128,20 +1131,20 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ...@@ -1128,20 +1131,20 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
if (profile_size > profile_length) if (profile_size > profile_length)
{ {
#ifdef PNG_STDIO_SUPPORTED
char umsg[50];
#endif
png_free(png_ptr, png_ptr->chunkdata); png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = NULL; png_ptr->chunkdata = NULL;
png_warning(png_ptr, "Ignoring truncated iCCP profile"); png_warning(png_ptr, "Ignoring truncated iCCP profile");
#ifdef PNG_STDIO_SUPPORTED #ifdef PNG_STDIO_SUPPORTED
{
char umsg[50];
png_snprintf(umsg, 50, "declared profile size = %lu", png_snprintf(umsg, 50, "declared profile size = %lu",
(unsigned long)profile_size); (unsigned long)profile_size);
png_warning(png_ptr, umsg); png_warning(png_ptr, umsg);
png_snprintf(umsg, 50, "actual profile length = %lu", png_snprintf(umsg, 50, "actual profile length = %lu",
(unsigned long)profile_length); (unsigned long)profile_length);
png_warning(png_ptr, umsg); png_warning(png_ptr, umsg);
}
#endif #endif
return; return;
} }
...@@ -1875,9 +1878,6 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ...@@ -1875,9 +1878,6 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_warning(png_ptr, "malformed height string in sCAL chunk"); png_warning(png_ptr, "malformed height string in sCAL chunk");
png_free(png_ptr, png_ptr->chunkdata); png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = NULL; png_ptr->chunkdata = NULL;
#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED)
png_free(png_ptr, swidth);
#endif
return; return;
} }
#else #else
...@@ -1888,9 +1888,7 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ...@@ -1888,9 +1888,7 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_warning(png_ptr, "Out of memory while processing sCAL chunk height"); png_warning(png_ptr, "Out of memory while processing sCAL chunk height");
png_free(png_ptr, png_ptr->chunkdata); png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = NULL; png_ptr->chunkdata = NULL;
#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED)
png_free(png_ptr, swidth); png_free(png_ptr, swidth);
#endif
return; return;
} }
png_memcpy(sheight, ep, png_strlen(ep)); png_memcpy(sheight, ep, png_strlen(ep));
......
...@@ -302,7 +302,7 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length) ...@@ -302,7 +302,7 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
/* Check if data really is near. If so, use usual code. */ /* Check if data really is near. If so, use usual code. */
n_data = (png_byte *)CVT_PTR_NOCHECK(data); n_data = (png_byte *)CVT_PTR_NOCHECK(data);
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); io_ptr = (png_FILE_p)CVT_PTR(png_get_io_ptr(png_ptr));
if ((png_bytep)n_data == data) if ((png_bytep)n_data == data)
{ {
check = fread(n_data, 1, length, io_ptr); check = fread(n_data, 1, length, io_ptr);
...@@ -351,8 +351,10 @@ static void ...@@ -351,8 +351,10 @@ static void
pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length) pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
{ {
png_size_t check; png_size_t check;
png_FILE_p io_ptr;
io_ptr = (png_FILE_p)CVT_PTR(png_get_io_ptr(png_ptr));
check = fwrite(data, 1, length, (png_FILE_p)png_ptr->io_ptr); check = fwrite(data, 1, length, io_ptr);
if (check != length) if (check != length)
{ {
png_error(png_ptr, "Write Error"); png_error(png_ptr, "Write Error");
...@@ -1627,4 +1629,4 @@ main(int argc, char *argv[]) ...@@ -1627,4 +1629,4 @@ main(int argc, char *argv[])
} }
/* Generate a compiler error if there is an old png.h in the search path. */ /* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_4_3 your_png_h_is_not_version_1_4_3; typedef version_1_4_4 your_png_h_is_not_version_1_4_4;
...@@ -673,5 +673,5 @@ png_get_user_transform_ptr(png_structp png_ptr) ...@@ -673,5 +673,5 @@ png_get_user_transform_ptr(png_structp png_ptr)
#endif #endif
} }
#endif /* PNG_READ_USER_TRANSFORM_SUPPORTED || #endif /* PNG_READ_USER_TRANSFORM_SUPPORTED ||
PNG_WRITE_USER_TRANSFORM_SUPPORTED */ PNG_WRITE_USER_TRANSFORM_SUPPORTED */
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..;..\..\..\zlib" AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib"
PreprocessorDefinitions="WIN32;NDEBUG;PNG_BUILD_DLL;ZLIB_DLL;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;NDEBUG;PNG_BUILD_DLL;ZLIB_DLL;_CRT_SECURE_NO_WARNINGS"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="2"
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG" PreprocessorDefinitions="NDEBUG"
Culture="1033" Culture="1033"
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/> AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib;$(IntDir)"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool <Tool
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..;..\..\..\zlib" AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib"
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_BUILD_DLL;ZLIB_DLL;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_BUILD_DLL;ZLIB_DLL;_CRT_SECURE_NO_WARNINGS"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG,PNG_DEBUG=1" PreprocessorDefinitions="_DEBUG,PNG_DEBUG=1"
Culture="1033" Culture="1033"
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/> AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib;$(IntDir)"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool <Tool
...@@ -113,8 +113,8 @@ ...@@ -113,8 +113,8 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..;..\..\..\zlib" AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib"
PreprocessorDefinitions="WIN32;NDEBUG;PNG_BUILD_DLL;ZLIB_DLL;PNGAPI=__stdcall;PNG_NO_MODULEDEF;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;NDEBUG;PNG_BUILD_DLL;ZLIB_DLL;PNGAPI=__stdcall;PNG_NO_MODULEDEF;PNG_LIBPNG_SPECIALBUILD;PNG_USER_PRIVATEBUILD;_CRT_SECURE_NO_WARNINGS"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
AdditionalOptions="/d PNG_NO_PEDANTIC_WARNINGS /d PNG_LIBPNG_DLLFNAME_POSTFIX=&quot;&quot;&quot;&quot;VB&quot;&quot;&quot;&quot; /d PNG_LIBPNG_SPECIALBUILD=&quot;&quot;&quot;&quot;__stdcall calling convention used for exported functions&quot;&quot;&quot;&quot;" AdditionalOptions="/d PNG_NO_PEDANTIC_WARNINGS /d PNG_LIBPNG_DLLFNAME_POSTFIX=&quot;&quot;&quot;&quot;VB&quot;&quot;&quot;&quot; /d PNG_LIBPNG_SPECIALBUILD=&quot;&quot;&quot;&quot;__stdcall calling convention used for exported functions&quot;&quot;&quot;&quot;"
PreprocessorDefinitions="NDEBUG" PreprocessorDefinitions="NDEBUG"
Culture="1033" Culture="1033"
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/> AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib;$(IntDir)"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool <Tool
...@@ -161,10 +161,10 @@ ...@@ -161,10 +161,10 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..;..\..\..\zlib" AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib"
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="3" UsePrecompiledHeader="3"
PrecompiledHeaderThrough="png.h" PrecompiledHeaderThrough="png.h"
...@@ -202,10 +202,10 @@ ...@@ -202,10 +202,10 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..;..\..\..\zlib" AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib"
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;_CRT_SECURE_NO_WARNINGS"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="1"
UsePrecompiledHeader="3" UsePrecompiledHeader="3"
PrecompiledHeaderThrough="png.h" PrecompiledHeaderThrough="png.h"
WarningLevel="3" WarningLevel="3"
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\zlib" AdditionalIncludeDirectories="..\..\scripts;..\..\..\zlib"
PreprocessorDefinitions="WIN32;NDEBUG;PNG_DLL;PNG_NO_STDIO;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;NDEBUG;PNG_DLL;PNG_NO_STDIO;_CRT_SECURE_NO_WARNINGS"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="2"
...@@ -64,7 +64,7 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png" ...@@ -64,7 +64,7 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png"
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\..\zlib" AdditionalIncludeDirectories="..\..\scripts;..\..\..\zlib"
PreprocessorDefinitions="WIN32;_DEBUG;PNG_DLL;PNG_NO_STDIO;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;_DEBUG;PNG_DLL;PNG_NO_STDIO;_CRT_SECURE_NO_WARNINGS"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
...@@ -112,8 +112,8 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png" ...@@ -112,8 +112,8 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png"
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\zlib" AdditionalIncludeDirectories="..\..\scripts;..\..\..\zlib"
PreprocessorDefinitions="WIN32;NDEBUG;PNG_DLL;PNG_NO_STDIO;PNGAPI=__stdcall;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;NDEBUG;PNG_DLL;PNG_NO_STDIO;PNGAPI=__stdcall;PNG_USER_PRIVATEBUILD;_CRT_SECURE_NO_WARNINGS"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"
...@@ -162,10 +162,10 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png" ...@@ -162,10 +162,10 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png"
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\zlib" AdditionalIncludeDirectories="..\..\scripts;..\..\..\zlib"
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"
WarningLevel="3" WarningLevel="3"
CompileAs="0"/> CompileAs="0"/>
...@@ -210,10 +210,10 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png" ...@@ -210,10 +210,10 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png"
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\..\zlib" AdditionalIncludeDirectories="..\..\scripts;..\..\..\zlib"
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="1"
WarningLevel="3" WarningLevel="3"
DebugInformationFormat="4" DebugInformationFormat="4"
CompileAs="0"/> CompileAs="0"/>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\zlib" AdditionalIncludeDirectories="..\..\..\zlib"
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\..\zlib" AdditionalIncludeDirectories="..\..\..\zlib"
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
WarningLevel="3" WarningLevel="3"
...@@ -107,9 +107,9 @@ ...@@ -107,9 +107,9 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\zlib" AdditionalIncludeDirectories="..\..\..\zlib"
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"
WarningLevel="3" WarningLevel="3"
CompileAs="1"/> CompileAs="1"/>
...@@ -146,9 +146,9 @@ ...@@ -146,9 +146,9 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\..\zlib" AdditionalIncludeDirectories="..\..\..\zlib"
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="1"
WarningLevel="3" WarningLevel="3"
DebugInformationFormat="4" DebugInformationFormat="4"
CompileAs="1"/> CompileAs="1"/>
...@@ -196,7 +196,16 @@ ...@@ -196,7 +196,16 @@
RelativePath="..\..\..\zlib\deflate.c"> RelativePath="..\..\..\zlib\deflate.c">
</File> </File>
<File <File
RelativePath="..\..\..\zlib\gzio.c"> RelativePath="..\..\..\zlib\gzlib.c">
</File>
<File
RelativePath="..\..\..\zlib\gzclose.c">
</File>
<File
RelativePath="..\..\..\zlib\gzread.c">
</File>
<File
RelativePath="..\..\..\zlib\gzwrite.c">
</File> </File>
<File <File
RelativePath="..\..\..\zlib\infback.c"> RelativePath="..\..\..\zlib\infback.c">
......
VisualStudio instructions VisualStudio instructions
libpng version 1.4.3 - June 26, 2010 libpng version 1.4.4 - September 23, 2010
Copyright (c) 1998-2010 Glenn Randers-Pehrson Copyright (c) 1998-2010 Glenn Randers-Pehrson
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!-- <!--
* zlib.props - location of zlib source and build * zlib.props - location of zlib source and build
* *
* libpng version 1.4.3 - June 26, 2010 * libpng version 1.4.4 - September 23, 2010
* *
* Copyright (c) 1998-2010 Glenn Randers-Pehrson * Copyright (c) 1998-2010 Glenn Randers-Pehrson
* *
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>libpng</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.apple.carbonframeworktemplate</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>
The xcode project has not been entirely updated to libpng-1.4.0.
It needs to *not* depend on pnggccrd.c or pngvcrd.c 1 September 2010: Philippe Hausler updated the xcode project to work
with libpng-1.4.x and added iOS targets for simulator and device.
It needs to PNG_NO_PEDANTIC_WARNINGS in the CFLAGS while building
the library, but not while building an application.
If an updated version is not received, this project will
be removed when libpng-1.4.0 is released.
Makefiles for libpng version 1.4.3 - June 26, 2010 Makefiles for libpng version 1.4.4 - September 23, 2010
makefile.linux => Linux/ELF makefile makefile.linux => Linux/ELF makefile
(gcc, creates libpng14.so.14.1.4.3) (gcc, creates libpng14.so.14.1.4.4)
makefile.gcc => Generic makefile (gcc, creates static libpng.a) makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from ansi2knr (Requires ansi2knr.c from
...@@ -20,7 +20,7 @@ Makefiles for libpng version 1.4.3 - June 26, 2010 ...@@ -20,7 +20,7 @@ Makefiles for libpng version 1.4.3 - June 26, 2010
makefile.dec => DEC Alpha UNIX makefile makefile.dec => DEC Alpha UNIX makefile
makefile.dj2 => DJGPP 2 makefile makefile.dj2 => DJGPP 2 makefile
makefile.elf => Linux/ELF makefile symbol versioning, makefile.elf => Linux/ELF makefile symbol versioning,
gcc, creates libpng14.so.14.1.4.3) (gcc, creates libpng14.so.14.1.4.4)
makefile.freebsd => FreeBSD makefile makefile.freebsd => FreeBSD makefile
makefile.gcc => Generic gcc makefile makefile.gcc => Generic gcc makefile
makefile.hpgcc => HPUX makefile using gcc makefile.hpgcc => HPUX makefile using gcc
...@@ -36,12 +36,12 @@ Makefiles for libpng version 1.4.3 - June 26, 2010 ...@@ -36,12 +36,12 @@ Makefiles for libpng version 1.4.3 - June 26, 2010
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def) makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.sggcc => Silicon Graphics (gcc, makefile.sggcc => Silicon Graphics (gcc,
creates libpng14.so.14.1.4.3) creates libpng14.so.14.1.4.4)
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib) makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.solaris => Solaris 2.X makefile (gcc, makefile.solaris => Solaris 2.X makefile (gcc,
creates libpng14.so.14.1.4.3) creates libpng14.so.14.1.4.4)
makefile.so9 => Solaris 9 makefile (gcc, makefile.so9 => Solaris 9 makefile (gcc,
creates libpng14.so.14.1.4.3) creates libpng14.so.14.1.4.4)
makefile.std => Generic UNIX makefile (cc, creates static libpng.a) makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.sunos => Sun makefile makefile.sunos => Sun makefile
makefile.32sunu => Sun Ultra 32-bit makefile makefile.32sunu => Sun Ultra 32-bit makefile
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# Modeled after libxml-config. # Modeled after libxml-config.
version=1.4.3 version=1.4.4
prefix="" prefix=""
libdir="" libdir=""
libs="" libs=""
......
...@@ -5,6 +5,6 @@ includedir=@includedir@/libpng14 ...@@ -5,6 +5,6 @@ includedir=@includedir@/libpng14
Name: libpng Name: libpng
Description: Loads and saves PNG files Description: Loads and saves PNG files
Version: 1.4.3 Version: 1.4.4
Libs: -L${libdir} -lpng14 Libs: -L${libdir} -lpng14
Cflags: -I${includedir} Cflags: -I${includedir}
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
VERMAJ = 1 VERMAJ = 1
VERMIN = 4 VERMIN = 4
VERMIC = 3 VERMIC = 4
VER = $(VERMAJ).$(VERMIN).$(VERMIC) VER = $(VERMAJ).$(VERMIN).$(VERMIC)
NAME = libpng NAME = libpng
PACKAGE = $(NAME)-$(VER) PACKAGE = $(NAME)-$(VER)
......
# DJGPP (DOS gcc) makefile for libpng # DJGPP (DOS gcc) makefile for libpng
# Copyright (C) 2002, 2006, 2009 Glenn Randers-Pehrson # Copyright (C) 2002, 2006, 2009-2010 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# #
# This code is released under the libpng license. # This code is released under the libpng license.
...@@ -13,7 +13,7 @@ INCPATH=$(prefix)/include ...@@ -13,7 +13,7 @@ INCPATH=$(prefix)/include
LIBPATH=$(prefix)/lib LIBPATH=$(prefix)/lib
CC=gcc CC=gcc
CFLAGS=-I../zlib -O CFLAGS=-I../zlib -O -DPNG_NO_SNPRINTF
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
RANLIB=ranlib RANLIB=ranlib
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# Library name: # Library name:
LIBNAME = libpng14 LIBNAME = libpng14
PNGMAJ = 14 PNGMAJ = 14
RELEASE = 3 RELEASE = 4
# Shared library names: # Shared library names:
LIBSO=$(LIBNAME).so LIBSO=$(LIBNAME).so
......
...@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include/libpng14 ...@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include/libpng14
LIB= png14 LIB= png14
SHLIB_MAJOR= 0 SHLIB_MAJOR= 0
SHLIB_MINOR= 1.4.3 SHLIB_MINOR= 1.4.4
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c pngwtran.c pngmem.c pngerror.c pngpread.c
......
...@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include ...@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include
LIB= png LIB= png
SHLIB_MAJOR= 3 SHLIB_MAJOR= 3
SHLIB_MINOR= 1.4.3 SHLIB_MINOR= 1.4.4
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c pngwtran.c pngmem.c pngerror.c pngpread.c
......
...@@ -11,7 +11,7 @@ LIBDIR= ${PREFIX}/lib ...@@ -11,7 +11,7 @@ LIBDIR= ${PREFIX}/lib
MANDIR= ${PREFIX}/man/cat MANDIR= ${PREFIX}/man/cat
SHLIB_MAJOR= 0 SHLIB_MAJOR= 0
SHLIB_MINOR= 1.4.3 SHLIB_MINOR= 1.4.4
LIB= png LIB= png
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \ SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
......
...@@ -15,7 +15,7 @@ LIBRARY lpngce ...@@ -15,7 +15,7 @@ LIBRARY lpngce
png_get_int_32 png_get_int_32
EXPORTS EXPORTS
;Version 1.4.3 ;Version 1.4.4
png_build_grayscale_palette @1 png_build_grayscale_palette @1
; png_check_sig @2 ; png_check_sig @2
png_chunk_error @3 png_chunk_error @3
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
; PNG.LIB module definition file for OS/2 ; PNG.LIB module definition file for OS/2
;---------------------------------------- ;----------------------------------------
; Version 1.4.3 ; Version 1.4.4
LIBRARY PNG LIBRARY PNG
DESCRIPTION "PNG image compression library for OS/2" DESCRIPTION "PNG image compression library for OS/2"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
LIBRARY LIBRARY
EXPORTS EXPORTS
;Version 1.4.3 ;Version 1.4.4
png_build_grayscale_palette png_build_grayscale_palette
png_chunk_error png_chunk_error
png_chunk_warning png_chunk_warning
......
/* LzmaDec.c -- LZMA Decoder /* LzmaDec.c -- LZMA Decoder
2008-11-06 : Igor Pavlov : Public domain */ 2009-09-20 : Igor Pavlov : Public domain */
#include "LzmaDec.h" #include "LzmaDec.h"
...@@ -113,12 +113,6 @@ ...@@ -113,12 +113,6 @@
StopCompilingDueBUG StopCompilingDueBUG
#endif #endif
static const Byte kLiteralNextStates[kNumStates * 2] =
{
0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5,
7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10
};
#define LZMA_DIC_MIN (1 << 12) #define LZMA_DIC_MIN (1 << 12)
/* First LZMA-symbol is always decoded. /* First LZMA-symbol is always decoded.
...@@ -175,6 +169,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte ...@@ -175,6 +169,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
if (state < kNumLitStates) if (state < kNumLitStates)
{ {
state -= (state < 4) ? state : 3;
symbol = 1; symbol = 1;
do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100); do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100);
} }
...@@ -182,6 +177,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte ...@@ -182,6 +177,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
{ {
unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
unsigned offs = 0x100; unsigned offs = 0x100;
state -= (state < 10) ? 3 : 6;
symbol = 1; symbol = 1;
do do
{ {
...@@ -196,9 +192,6 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte ...@@ -196,9 +192,6 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
} }
dic[dicPos++] = (Byte)symbol; dic[dicPos++] = (Byte)symbol;
processedPos++; processedPos++;
state = kLiteralNextStates[state];
/* if (state < 4) state = 0; else if (state < 10) state -= 3; else state -= 6; */
continue; continue;
} }
else else
...@@ -378,7 +371,6 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte ...@@ -378,7 +371,6 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
else if (distance >= checkDicSize) else if (distance >= checkDicSize)
return SZ_ERROR_DATA; return SZ_ERROR_DATA;
state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3;
/* state = kLiteralNextStates[state]; */
} }
len += kMatchMinLen; len += kMatchMinLen;
......
/* LzmaDec.h -- LZMA Decoder /* LzmaDec.h -- LZMA Decoder
2008-10-04 : Igor Pavlov : Public domain */ 2009-02-07 : Igor Pavlov : Public domain */
#ifndef __LZMADEC_H #ifndef __LZMA_DEC_H
#define __LZMADEC_H #define __LZMA_DEC_H
#ifdef __cplusplus
extern "C" {
#endif
#include "Types.h" #include "Types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* #define _LZMA_PROB32 */ /* #define _LZMA_PROB32 */
/* _LZMA_PROB32 can increase the speed on some CPUs, /* _LZMA_PROB32 can increase the speed on some CPUs,
but memory usage for CLzmaDec::probs will be doubled in that case */ but memory usage for CLzmaDec::probs will be doubled in that case */
...@@ -224,8 +224,8 @@ SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ...@@ -224,8 +224,8 @@ SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
ELzmaStatus *status, ISzAlloc *alloc); ELzmaStatus *status, ISzAlloc *alloc);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
/* Types.h -- Basic types /* Types.h -- Basic types
2008-11-23 : Igor Pavlov : Public domain */ 2010-10-09 : Igor Pavlov : Public domain */
#ifndef __7Z_TYPES_H #ifndef __7Z_TYPES_H
#define __7Z_TYPES_H #define __7Z_TYPES_H
...@@ -10,6 +10,18 @@ ...@@ -10,6 +10,18 @@
#include <windows.h> #include <windows.h>
#endif #endif
#ifndef EXTERN_C_BEGIN
#ifdef __cplusplus
#define EXTERN_C_BEGIN extern "C" {
#define EXTERN_C_END }
#else
#define EXTERN_C_BEGIN
#define EXTERN_C_END
#endif
#endif
EXTERN_C_BEGIN
#define SZ_OK 0 #define SZ_OK 0
#define SZ_ERROR_DATA 1 #define SZ_ERROR_DATA 1
...@@ -65,9 +77,11 @@ typedef unsigned long UInt64; ...@@ -65,9 +77,11 @@ typedef unsigned long UInt64;
#if defined(_MSC_VER) || defined(__BORLANDC__) #if defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 Int64; typedef __int64 Int64;
typedef unsigned __int64 UInt64; typedef unsigned __int64 UInt64;
#define UINT64_CONST(n) n
#else #else
typedef long long int Int64; typedef long long int Int64;
typedef unsigned long long int UInt64; typedef unsigned long long int UInt64;
#define UINT64_CONST(n) n ## ULL
#endif #endif
#endif #endif
...@@ -83,6 +97,12 @@ typedef int Bool; ...@@ -83,6 +97,12 @@ typedef int Bool;
#define False 0 #define False 0
#ifdef _WIN32
#define MY_STD_CALL __stdcall
#else
#define MY_STD_CALL
#endif
#ifdef _MSC_VER #ifdef _MSC_VER
#if _MSC_VER >= 1300 #if _MSC_VER >= 1300
...@@ -92,13 +112,11 @@ typedef int Bool; ...@@ -92,13 +112,11 @@ typedef int Bool;
#endif #endif
#define MY_CDECL __cdecl #define MY_CDECL __cdecl
#define MY_STD_CALL __stdcall #define MY_FAST_CALL __fastcall
#define MY_FAST_CALL MY_NO_INLINE __fastcall
#else #else
#define MY_CDECL #define MY_CDECL
#define MY_STD_CALL
#define MY_FAST_CALL #define MY_FAST_CALL
#endif #endif
...@@ -106,6 +124,16 @@ typedef int Bool; ...@@ -106,6 +124,16 @@ typedef int Bool;
/* The following interfaces use first parameter as pointer to structure */ /* The following interfaces use first parameter as pointer to structure */
typedef struct
{
Byte (*Read)(void *p); /* reads one byte, returns 0 in case of EOF or error */
} IByteIn;
typedef struct
{
void (*Write)(void *p, Byte b);
} IByteOut;
typedef struct typedef struct
{ {
SRes (*Read)(void *p, void *buf, size_t *size); SRes (*Read)(void *p, void *buf, size_t *size);
...@@ -140,7 +168,7 @@ typedef struct ...@@ -140,7 +168,7 @@ typedef struct
typedef struct typedef struct
{ {
SRes (*Look)(void *p, void **buf, size_t *size); SRes (*Look)(void *p, const void **buf, size_t *size);
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
(output(*size) > input(*size)) is not allowed (output(*size) > input(*size)) is not allowed
(output(*size) < input(*size)) is allowed */ (output(*size) < input(*size)) is allowed */
...@@ -205,4 +233,22 @@ typedef struct ...@@ -205,4 +233,22 @@ typedef struct
#define IAlloc_Alloc(p, size) (p)->Alloc((p), size) #define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
#define IAlloc_Free(p, a) (p)->Free((p), a) #define IAlloc_Free(p, a) (p)->Free((p), a)
#ifdef _WIN32
#define CHAR_PATH_SEPARATOR '\\'
#define WCHAR_PATH_SEPARATOR L'\\'
#define STRING_PATH_SEPARATOR "\\"
#define WSTRING_PATH_SEPARATOR L"\\"
#else
#define CHAR_PATH_SEPARATOR '/'
#define WCHAR_PATH_SEPARATOR L'/'
#define STRING_PATH_SEPARATOR "/"
#define WSTRING_PATH_SEPARATOR L"/"
#endif
EXTERN_C_END
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment