Imported from libpng-1.0.7beta16.tar
diff --git a/ANNOUNCE b/ANNOUNCE
index c8612f7..a0518ca 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,5 @@
 
-Libpng 1.0.7beta15 - May 29, 2000
+Libpng 1.0.7beta16 - June 4, 2000
 
 This is a public release of libpng, intended for use in production codes.
 
@@ -81,6 +81,14 @@
   Worked around a problem in pngconf.h; AIX's strings.h defines an "index"
     macro that conflicts with libpng's png_color_16.index. (Dimitri Papadapoulos)
   Added "msvc" directory with MSVC++ project files (Simon-Pierre Cadieux).
+  Added PNG_NO_POINTER_INDEXING macro to use array-indexing instead of pointer
+    indexing in pngrutil.c and pngwutil.c to accommodate a buggy compiler.
+  Added a check for overlength PLTE chunk in pngrutil.c.
+  Added PNG_NO_POINTER_INDEXING macro to use array-indexing instead of pointer
+    indexing in pngrutil.c and pngwutil.c to accommodate a buggy compiler.
+  Added a warning in png_decompress_chunk() when it runs out of data.
+  Added PNG_USE_DLL macro.
+  Revised the copyright/disclaimer/license notice.
 
 Send comments/corrections/commendations to
 png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
diff --git a/CHANGES b/CHANGES
index 17389c0..ee77fd5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -771,6 +771,14 @@
   Worked around a problem in pngconf.h; AIX's strings.h defines an "index"
     macro that conflicts with libpng's png_color_16.index. (Dimitri Papadapoulos)
   Added "msvc" directory with MSVC++ project files (Simon-Pierre Cadieux).
+version 1.0.7beta16 [June 4, 2000]
+  Revised the workaround of AIX string.h "index" bug.
+  Added a check for overlength PLTE chunk in pngrutil.c.
+  Added PNG_NO_POINTER_INDEXING macro to use array-indexing instead of pointer
+    indexing in pngrutil.c and pngwutil.c to accommodate a buggy compiler.
+  Added a warning in png_decompress_chunk() when it runs out of data.
+  Added PNG_USE_DLL macro.
+  Revised the copyright/disclaimer/license notice.
 
 Send comments/corrections/commendations to
 png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
diff --git a/INSTALL b/INSTALL
index 573e8a6..b3fc612 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,5 +1,5 @@
 
-Installing libpng version 1.0.7beta15 - May 29, 2000
+Installing libpng version 1.0.7beta16 - June 4, 2000
 
 Before installing libpng, you must first install zlib.  zlib
 can usually be found wherever you got libpng.  zlib can be
@@ -10,7 +10,7 @@
 version of zlib that's installed.
 
 You can rename the directories that you downloaded (they
-might be called "libpng-1.0.7beta15" or "lpng106" and "zlib-1.1.3"
+might be called "libpng-1.0.7beta16" or "lpng106" and "zlib-1.1.3"
 or "zlib113") so that you have directories called "zlib" and "libpng".
 
 Your directory structure should look like this:
@@ -23,8 +23,10 @@
           *.c
           contrib
              gregbook
+             msvctest
              pngminus
              pngsuite
+          msvc
           scripts
              makefile.*
           pngtest.png
@@ -40,15 +42,18 @@
 distribution of libpng.  It is available in both tar.gz (UNIX style line
 endings) and zip (DOS style line endings) formats.
 
-First enter the zlib directory and follow the instructions in zlib/README.
+If you are building libpng with MSVC, you can enter the msvc directory and
+follow the instructions in msvc/README.txt.
+
+Else enter the zlib directory and follow the instructions in zlib/README.
 Then come back here and choose the appropriate makefile.sys in the scripts
 directory.  
 The files that are presently available in the scripts directory
 include
 
  makefile.std      =>  Generic UNIX makefile (cc, creates static libpng.a)
- makefile.linux    =>  Linux/ELF makefile (gcc, creates libpng.so.2.1.0.7beta15)
- makefile.gcmmx    =>  Linux/ELF makefile (gcc, creates libpng.so.2.1.0.7beta15,
+ makefile.linux    =>  Linux/ELF makefile (gcc, creates libpng.so.2.1.0.7beta16)
+ makefile.gcmmx    =>  Linux/ELF makefile (gcc, creates libpng.so.2.1.0.7beta16,
                        uses assembler code tuned for Intel MMX platform)
  makefile.gcc      =>  Generic makefile (gcc, creates static libpng.a)
  makefile.knr      =>  Archaic UNIX Makefile that converts files with
@@ -60,9 +65,9 @@
  makefile.intel    =>  Intel C/C++ version 4.0 and later
  libpng.icc        =>  Project file for IBM VisualAge/C++ version 4.0 or later
  makefile.sgi      =>  Silicon Graphics IRIX makefile (cc, creates static lib)
- makefile.sggcc    =>  Silicon Graphics (gcc, creates libpng.so.2.1.0.7beta15)
+ makefile.sggcc    =>  Silicon Graphics (gcc, creates libpng.so.2.1.0.7beta16)
  makefile.sunos    =>  Sun makefile
- makefile.solaris  =>  Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.7beta15)
+ makefile.solaris  =>  Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.7beta16)
  makefile.sco      =>  For SCO OSr5  ELF and Unixware 7 with Native cc
  makefile.mips     =>  MIPS makefile
  makefile.acorn    =>  Acorn makefile
diff --git a/LICENSE b/LICENSE
index 9c1c445..822fc04 100644
--- a/LICENSE
+++ b/LICENSE
@@ -5,7 +5,7 @@
 Copyright (c) 1996, 1997 Andreas Dilger
 (libpng versions 0.90, December 1996, through 0.96, May 1997)
 Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
-(libpng versions 0.97, January 1998, through 1.0.7beta15, May 29, 2000)
+(libpng versions 0.97, January 1998, through 1.0.7beta16, June 4, 2000)
 
 For the purposes of this copyright and license, "Contributing Authors"
 is defined as the following set of individuals:
@@ -68,4 +68,4 @@
 
 Glenn Randers-Pehrson
 randeg@alum.rpi.edu
-May 29, 2000
+June 4, 2000
diff --git a/README b/README
index 5c1ec6e..244f997 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-README for libpng 1.0.7beta15 - May 29, 2000 (shared library 2.1)
+README for libpng 1.0.7beta16 - June 4, 2000 (shared library 2.1)
 See the note about version numbers near the top of png.h
 
 See INSTALL for instructions on how to install libpng.
@@ -166,15 +166,18 @@
        gregbook         =>  source code for PNG reading and writing, from
                             Greg Roelofs' "PNG: The Definitive Guide",
                             O'Reilly, 1999
+       msvctest     =>  Builds and runs pngtest using a MSVC workspace
        pngminus     =>  Simple pnm2png and png2pnm programs
        pngsuite     =>  Test images
+      msvc          =>  Contains a Microsoft Visual C++ (MSVC) workspace
+                        for building libpng and zlib
       scripts       =>  Directory containing scripts for building libpng:
        descrip.mms      =>  VMS makefile for MMS or MMK
        makefile.std     =>  Generic UNIX makefile (cc, creates static libpng.a)
        makefile.linux   =>  Linux/ELF makefile
-                            (gcc, creates libpng.so.2.1.0.7beta15)
+                            (gcc, creates libpng.so.2.1.0.7beta16)
        makefile.gcmmx   =>  Linux/ELF makefile (gcc, creates
-                            libpng.so.2.1.0.7beta15, uses assembler code
+                            libpng.so.2.1.0.7beta16, uses assembler code
                             tuned for Intel MMX platform)
        makefile.gcc     =>  Generic makefile (gcc, creates static libpng.a)
        makefile.knr     =>  Archaic UNIX Makefile that converts files with
@@ -186,10 +189,10 @@
        makefile.intel   =>  Intel C/C++ version 4.0 and later
        libpng.icc       =>  Project file, IBM VisualAge/C++ 4.0 or later
        makefile.sgi     =>  Silicon Graphics IRIX (cc, creates static lib)
-       makefile.sggcc   =>  Silicon Graphics (gcc, creates libpng.so.2.1.0.7beta15)
+       makefile.sggcc   =>  Silicon Graphics (gcc, creates libpng.so.2.1.0.7beta16)
        makefile.sunos   =>  Sun makefile
        makefile.solaris =>  Solaris 2.X makefile
-                            (gcc, creates libpng.so.2.1.0.7beta15)
+                            (gcc, creates libpng.so.2.1.0.7beta16)
        makefile.sco     =>  For SCO OSr5  ELF and Unixware 7 with Native cc
        makefile.mips    =>  MIPS makefile
        makefile.acorn   =>  Acorn makefile
diff --git a/Y2KINFO b/Y2KINFO
index ec37ba6..395d8c7 100644
--- a/Y2KINFO
+++ b/Y2KINFO
@@ -1,13 +1,13 @@
    Y2K compliance in libpng:
    =========================
 
-      May 29, 2000
+      June 4, 2000
 
       Since the PNG Development group is an ad-hoc body, we can't make
       an official declaration.
 
       This is your unofficial assurance that libpng from version 0.71 and
-      upward through 1.0.7beta15 are Y2K compliant.  It is my belief that earlier
+      upward through 1.0.7beta16 are Y2K compliant.  It is my belief that earlier
       versions were also Y2K compliant.
 
       Libpng only has three year fields.  One is a 2-byte unsigned integer
diff --git a/configure b/configure
index eb72079..556f271 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 echo "
-  There is no \"configure\" script for Libpng-1.0.7beta15.  Instead, please
+  There is no \"configure\" script for Libpng-1.0.7beta16.  Instead, please
   copy the appropriate makefile for your system from the \"scripts\"
   directory.  Read the INSTALL file for more details.
 "
diff --git a/contrib/msvctest/README.txt b/contrib/msvctest/README.txt
new file mode 100644
index 0000000..1805780
--- /dev/null
+++ b/contrib/msvctest/README.txt
@@ -0,0 +1,22 @@
+Microsoft Developer Studio Build File, Format Version 6.00 for
+msvctest
+
+Assumes that libpng DLLs and LIBs are in ..\..\msvc\win32\libpng
+Assumes that zlib DLLs and LIBs are in ..\..\msvc\win32\zlib
+
+To build:
+
+1) On the main menu Select "Build|Set Active configuration".
+   Choose the configuration that corresponds to the library you want to test.
+   This library must have been built using the libpng MS project located in
+   the "mscv" subdirectory.
+
+2) Select "Build|Clean"
+
+3) Select "Build|Rebuild All"
+
+4) The test results should appear in the "Build" pane of the Output Window.
+
+
+Simon-Pierre Cadieux
+Methodex Computer Systems Inc.
diff --git a/contrib/msvctest/msvctest.dsp b/contrib/msvctest/msvctest.dsp
new file mode 100644
index 0000000..926e5ed
--- /dev/null
+++ b/contrib/msvctest/msvctest.dsp
@@ -0,0 +1,247 @@
+# Microsoft Developer Studio Project File - Name="msvctest" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=msvctest - Win32 Debug DLL
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "msvctest.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "msvctest.mak" CFG="msvctest - Win32 Debug DLL"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "msvctest - Win32 DLL" (based on "Win32 (x86) Console Application")
+!MESSAGE "msvctest - Win32 Debug DLL" (based on "Win32 (x86) Console Application")
+!MESSAGE "msvctest - Win32 ASM DLL" (based on "Win32 (x86) Console Application")
+!MESSAGE "msvctest - Win32 Debug ASM DLL" (based on "Win32 (x86) Console Application")
+!MESSAGE "msvctest - Win32 LIB" (based on "Win32 (x86) Console Application")
+!MESSAGE "msvctest - Win32 Debug LIB" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "msvctest - Win32 DLL"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "dll"
+# PROP BASE Intermediate_Dir "dll"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "dll"
+# PROP Intermediate_Dir "dll"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# ADD CPP /nologo /MD /W3 /O1 /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "PNG_DLL" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\msvc\win32\libpng\dll\libpng1.lib /nologo /subsystem:console /machine:I386
+# Begin Special Build Tool
+OutDir=.\dll
+SOURCE="$(InputPath)"
+PostBuild_Desc=[Run Test]
+PostBuild_Cmds=set path=..\..\msvc\win32\libpng\dll;..\..\msvc\win32\zlib\dll;	$(outdir)\msvctest.exe ..\..\pngtest.png
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "msvctest - Win32 Debug DLL"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "dll_dbg"
+# PROP BASE Intermediate_Dir "dll_dbg"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "dll_dbg"
+# PROP Intermediate_Dir "dll_dbg"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Zi /Od /I "..\..\..\zlib" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "PNG_DLL" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\msvc\win32\libpng\dll_dbg\libpng1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# Begin Special Build Tool
+OutDir=.\dll_dbg
+SOURCE="$(InputPath)"
+PostBuild_Desc=[Run Test]
+PostBuild_Cmds=set path=..\..\msvc\win32\libpng\dll_dbg;..\..\msvc\win32\zlib\dll_dbg;	$(outdir)\msvctest.exe ..\..\pngtest.png
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "msvctest - Win32 ASM DLL"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "dll_asm"
+# PROP BASE Intermediate_Dir "dll_asm"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "dll_asm"
+# PROP Intermediate_Dir "dll_asm"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# ADD CPP /nologo /MD /W3 /O1 /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "PNG_DLL" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\msvc\win32\libpng\dll_asm\libpng1a.lib /nologo /subsystem:console /machine:I386
+# Begin Special Build Tool
+OutDir=.\dll_asm
+SOURCE="$(InputPath)"
+PostBuild_Desc=[Run Test]
+PostBuild_Cmds=set path=..\..\msvc\win32\libpng\dll_asm;..\..\msvc\win32\zlib\dll;	$(outdir)\msvctest.exe ..\..\pngtest.png
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "msvctest - Win32 Debug ASM DLL"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "dll_dbga"
+# PROP BASE Intermediate_Dir "dll_dbga"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "dll_dbga"
+# PROP Intermediate_Dir "dll_dbga"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Zi /Od /I "..\..\..\zlib" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "PNG_DLL" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\msvc\win32\libpng\dll_dbga\libpng1b.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# Begin Special Build Tool
+OutDir=.\dll_dbga
+SOURCE="$(InputPath)"
+PostBuild_Desc=[Run Test]
+PostBuild_Cmds=set path=..\..\msvc\win32\libpng\dll_dbga;..\..\msvc\win32\zlib\dll_dbg;	$(outdir)\msvctest.exe ..\..\pngtest.png
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "msvctest - Win32 LIB"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "lib"
+# PROP BASE Intermediate_Dir "lib"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "lib"
+# PROP Intermediate_Dir "lib"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# ADD CPP /nologo /W3 /O1 /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
+# ADD LINK32 ..\..\msvc\win32\libpng\lib\libpng.lib /nologo /subsystem:console /machine:I386
+# Begin Special Build Tool
+OutDir=.\lib
+SOURCE="$(InputPath)"
+PostBuild_Desc=[Run Test]
+PostBuild_Cmds=$(outdir)\msvctest.exe ..\..\pngtest.png
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "msvctest - Win32 Debug LIB"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "lib_dbg"
+# PROP BASE Intermediate_Dir "lib_dbg"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "lib_dbg"
+# PROP Intermediate_Dir "lib_dbg"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Zi /Od /I "..\..\..\zlib" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ..\..\msvc\win32\libpng\lib_dbg\libpng.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# Begin Special Build Tool
+OutDir=.\lib_dbg
+SOURCE="$(InputPath)"
+PostBuild_Desc=[Run Test]
+PostBuild_Cmds=$(outdir)\msvctest.exe ..\..\pngtest.png
+# End Special Build Tool
+
+!ENDIF 
+
+# Begin Target
+
+# Name "msvctest - Win32 DLL"
+# Name "msvctest - Win32 Debug DLL"
+# Name "msvctest - Win32 ASM DLL"
+# Name "msvctest - Win32 Debug ASM DLL"
+# Name "msvctest - Win32 LIB"
+# Name "msvctest - Win32 Debug LIB"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\pngtest.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\README.txt
+# PROP Exclude_From_Build 1
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/contrib/msvctest/msvctest.dsw b/contrib/msvctest/msvctest.dsw
new file mode 100644
index 0000000..a2bb056
--- /dev/null
+++ b/contrib/msvctest/msvctest.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "msvctest"=.\msvctest.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/libpng.3 b/libpng.3
index 0611767..5faba90 100644
--- a/libpng.3
+++ b/libpng.3
@@ -1,6 +1,6 @@
-.TH LIBPNG 3 "May 29, 2000"
+.TH LIBPNG 3 "June 4, 2000"
 .SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta15
+libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta16
 .SH SYNOPSIS
 \fI\fB
 
@@ -747,7 +747,7 @@
 .SH LIBPNG.TXT
 libpng.txt - A description on how to use and modify libpng
 
- libpng version 1.0.7beta15 - May 29, 2000
+ libpng version 1.0.7beta16 - June 4, 2000
  Updated and distributed by Glenn Randers-Pehrson
  <randeg@alum.rpi.edu>
  Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@@ -3379,13 +3379,13 @@
 
 .SH VII. Y2K Compliance in libpng
 
-May 29, 2000
+June 4, 2000
 
 Since the PNG Development group is an ad-hoc body, we can't make
 an official declaration.
 
 This is your unofficial assurance that libpng from version 0.71 and
-upward through 1.0.7beta15 are Y2K compliant.  It is my belief that earlier
+upward through 1.0.7beta16 are Y2K compliant.  It is my belief that earlier
 versions were also Y2K compliant.
 
 Libpng only has three year fields.  One is a 2-byte unsigned integer that
@@ -3526,7 +3526,7 @@
 
 Thanks to Frank J. T. Wojcik for helping with the documentation.
 
-Libpng version 1.0.7beta15 - May 29, 2000:
+Libpng version 1.0.7beta16 - June 4, 2000:
 Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
 Currently maintained by Glenn Randers-Pehrson (randeg@alum.rpi.edu).
 
@@ -3541,7 +3541,7 @@
 Copyright (c) 1996, 1997 Andreas Dilger
 (libpng versions 0.89c, May 1996, through 0.96, May 1997)
 Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
-(libpng versions 0.97, January 1998, through 1.0.7beta15, May 29, 2000)
+(libpng versions 0.97, January 1998, through 1.0.7beta16, June 4, 2000)
 
 For the purposes of this copyright and license, "Contributing Authors"
 is defined as the following set of individuals:
diff --git a/libpng.txt b/libpng.txt
index dd5fa37..1c77a6f 100644
--- a/libpng.txt
+++ b/libpng.txt
@@ -1,6 +1,6 @@
 libpng.txt - A description on how to use and modify libpng
 
- libpng version 1.0.7beta15 - May 29, 2000
+ libpng version 1.0.7beta16 - June 4, 2000
  Updated and distributed by Glenn Randers-Pehrson
  <randeg@alum.rpi.edu>
  Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@@ -2632,13 +2632,13 @@
 
 VII. Y2K Compliance in libpng
 
-May 29, 2000
+June 4, 2000
 
 Since the PNG Development group is an ad-hoc body, we can't make
 an official declaration.
 
 This is your unofficial assurance that libpng from version 0.71 and
-upward through 1.0.7beta15 are Y2K compliant.  It is my belief that earlier
+upward through 1.0.7beta16 are Y2K compliant.  It is my belief that earlier
 versions were also Y2K compliant.
 
 Libpng only has three year fields.  One is a 2-byte unsigned integer that
diff --git a/libpngpf.3 b/libpngpf.3
index 3247108..ab9c6a5 100644
--- a/libpngpf.3
+++ b/libpngpf.3
@@ -1,6 +1,6 @@
-.TH LIBPNGPF 3 "May 29, 2000"
+.TH LIBPNGPF 3 "June 4, 2000"
 .SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta15
+libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta16
 (private functions)
 .SH SYNOPSIS
 \fB#include <png.h>\fP
diff --git a/msvc/README.txt b/msvc/README.txt
index b551526..11c82dd 100644
--- a/msvc/README.txt
+++ b/msvc/README.txt
@@ -1,5 +1,5 @@
 Microsoft Developer Studio Build File, Format Version 6.00 for
-libpng 1.0.7beta15 (May 29, 2000) and zlib
+libpng 1.0.7beta16 (June 4, 2000) and zlib
 
 Copyright (C) 2000 Simon-Pierre Cadieux
 For conditions of distribution and use, see copyright notice in png.h
@@ -25,14 +25,23 @@
 libpng and zlib libraries:
 
    libpng1.dll          (default version, currently C code only)
+   libpng1a.dll         (C + Assembler version)
+   libpng1b.dll         (C + Assembler debug version)
    libpng1d.dll         (C code debug version)
-   libpng1[a-c,e-m].dll (reserved for official versions)
+   libpng1[c,e-m].dll   (reserved for official versions) 
    libpng1[n-z].dll     (available for private versions)
-   zlib.dll             (default version)
+   zlib.dll             (default version, currently C code only)
    zlibd.dll            (debug version)
 
 If you change anything in libpng, or select different compiler settings,
 please change the library name to an unreserved name, and define
-PRIVATEBUILD or SPECIALBUILD accordingly.
+DLLFNAME_POSTFIX and (PRIVATEBUILD or SPECIALBUILD) accordingly. DLLFNAME_POSTFIX
+should correspond to a string in the range of "N" to "Z" depending on the letter 
+you choose for your private version.
 
+All DLLs built by this project use the Microsoft dynamic C runtime library
+MSVCRT.DLL (MSVCRTD.DLL for debug versions). If you distribute any of the
+above mentioned libraries you should also include this DLL in your package.
+For a list of files that are redistributable in Visual C++ 6.0, see
+Common\Redist\Redist.txt on Disc 1 of the Visual C++ 6.0 product CDs. 
 
diff --git a/msvc/libpng.dsp b/msvc/libpng.dsp
index 57259f6..8bd7611 100644
--- a/msvc/libpng.dsp
+++ b/msvc/libpng.dsp
@@ -19,9 +19,11 @@
 !MESSAGE Possible choices for configuration are:
 !MESSAGE 
 !MESSAGE "libpng - Win32 DLL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "libpng - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "libpng - Win32 Debug DLL" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "libpng - Win32 ASM DLL" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "libpng - Win32 Debug ASM DLL" (based on "Win32 (x86) Dynamic-Link Library")
 !MESSAGE "libpng - Win32 LIB" (based on "Win32 (x86) Static Library")
-!MESSAGE "libpng - Win32 LIB Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "libpng - Win32 Debug LIB" (based on "Win32 (x86) Static Library")
 !MESSAGE 
 
 # Begin Project
@@ -43,7 +45,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 CPP=cl.exe
-# ADD BASE CPP /nologo /MD /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /c
+# ADD BASE CPP /nologo /MD /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
 # ADD CPP /nologo /MD /W3 /O1 /I ".." /I "..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /Yu"png.h" /FD /c
 MTL=midl.exe
 RSC=rc.exe
@@ -53,11 +55,11 @@
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
 LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD BASE LINK32  /nologo /dll /machine:I386
 # ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll\libpng1.dll"
 # SUBTRACT LINK32 /pdb:none
 
-!ELSEIF  "$(CFG)" == "libpng - Win32 DLL Debug"
+!ELSEIF  "$(CFG)" == "libpng - Win32 Debug DLL"
 
 # PROP BASE Use_MFC 0
 # PROP BASE Use_Debug_Libraries 1
@@ -71,7 +73,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 CPP=cl.exe
-# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /GZ /c
+# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /GZ /c
 # ADD CPP /nologo /MDd /W3 /Zi /Od /I ".." /I "..\..\zlib" /D "DEBUG" /D "_DEBUG" /D PNG_DEBUG=1 /D "WIN32" /D "_WINDOWS" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /Yu"png.h" /FD /GZ /c
 MTL=midl.exe
 RSC=rc.exe
@@ -81,9 +83,64 @@
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
 LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
 # ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libpng\dll_dbg\libpng1d.dll"
 
+!ELSEIF  "$(CFG)" == "libpng - Win32 ASM DLL"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ".\win32\libpng\dll_asm"
+# PROP Intermediate_Dir ".\win32\libpng\dll_asm"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MD /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
+# ADD CPP /nologo /MD /W3 /O1 /I ".." /I "..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PNG_USE_PNGVCRD" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /Yu"png.h" /FD /c
+MTL=midl.exe
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /i ".." /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /dll /machine:I386
+# ADD LINK32 .\win32\zlib\dll\zlib.lib /nologo /dll /machine:I386 /out:".\win32\libpng\dll_asm\libpng1a.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "libpng - Win32 Debug ASM DLL"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ".\win32\libpng\dll_dbga"
+# PROP Intermediate_Dir ".\win32\libpng\dll_dbga"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Zi /Od /I ".." /I "..\..\zlib" /D "DEBUG" /D "_DEBUG" /D PNG_DEBUG=1 /D "WIN32" /D "_WINDOWS" /D "PNG_USE_PNGVCRD" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /Yu"png.h" /FD /GZ /c
+MTL=midl.exe
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /i ".." /d "_DEBUG" /d PNG_DEBUG=1
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 .\win32\zlib\dll_dbg\zlibd.lib /nologo /dll /debug /machine:I386 /out:".\win32\libpng\dll_dbga\libpng1b.dll"
+
 !ELSEIF  "$(CFG)" == "libpng - Win32 LIB"
 
 # PROP BASE Use_MFC 0
@@ -110,7 +167,7 @@
 # ADD BASE LIB32 /nologo
 # ADD LIB32 /nologo
 
-!ELSEIF  "$(CFG)" == "libpng - Win32 LIB Debug"
+!ELSEIF  "$(CFG)" == "libpng - Win32 Debug LIB"
 
 # PROP BASE Use_MFC 0
 # PROP BASE Use_Debug_Libraries 1
@@ -124,7 +181,7 @@
 # PROP Target_Dir ""
 MTL=midl.exe
 CPP=cl.exe
-# ADD BASE CPP /nologo /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_LIB" /FD /GZ /c
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_LIB" /FD /GZ /c
 # ADD CPP /nologo /W3 /Zi /Od /I ".." /I "..\..\zlib" /D "DEBUG" /D "_DEBUG" /D PNG_DEBUG=1 /D "WIN32" /Yu"png.h" /FD /GZ /c
 RSC=rc.exe
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
@@ -141,9 +198,11 @@
 # Begin Target
 
 # Name "libpng - Win32 DLL"
-# Name "libpng - Win32 DLL Debug"
+# Name "libpng - Win32 Debug DLL"
+# Name "libpng - Win32 ASM DLL"
+# Name "libpng - Win32 Debug ASM DLL"
 # Name "libpng - Win32 LIB"
-# Name "libpng - Win32 LIB Debug"
+# Name "libpng - Win32 Debug LIB"
 # Begin Group "Source Files"
 
 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
@@ -158,13 +217,17 @@
 
 !IF  "$(CFG)" == "libpng - Win32 DLL"
 
-!ELSEIF  "$(CFG)" == "libpng - Win32 DLL Debug"
+!ELSEIF  "$(CFG)" == "libpng - Win32 Debug DLL"
+
+!ELSEIF  "$(CFG)" == "libpng - Win32 ASM DLL"
+
+!ELSEIF  "$(CFG)" == "libpng - Win32 Debug ASM DLL"
 
 !ELSEIF  "$(CFG)" == "libpng - Win32 LIB"
 
 # PROP Exclude_From_Build 1
 
-!ELSEIF  "$(CFG)" == "libpng - Win32 LIB Debug"
+!ELSEIF  "$(CFG)" == "libpng - Win32 Debug LIB"
 
 # PROP Exclude_From_Build 1
 
@@ -177,13 +240,17 @@
 
 !IF  "$(CFG)" == "libpng - Win32 DLL"
 
-!ELSEIF  "$(CFG)" == "libpng - Win32 DLL Debug"
+!ELSEIF  "$(CFG)" == "libpng - Win32 Debug DLL"
+
+!ELSEIF  "$(CFG)" == "libpng - Win32 ASM DLL"
+
+!ELSEIF  "$(CFG)" == "libpng - Win32 Debug ASM DLL"
 
 !ELSEIF  "$(CFG)" == "libpng - Win32 LIB"
 
 # PROP Exclude_From_Build 1
 
-!ELSEIF  "$(CFG)" == "libpng - Win32 LIB Debug"
+!ELSEIF  "$(CFG)" == "libpng - Win32 Debug LIB"
 
 # PROP Exclude_From_Build 1
 
@@ -233,6 +300,33 @@
 # End Source File
 # Begin Source File
 
+SOURCE=..\pngvcrd.c
+
+!IF  "$(CFG)" == "libpng - Win32 DLL"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF  "$(CFG)" == "libpng - Win32 Debug DLL"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF  "$(CFG)" == "libpng - Win32 ASM DLL"
+
+!ELSEIF  "$(CFG)" == "libpng - Win32 Debug ASM DLL"
+
+!ELSEIF  "$(CFG)" == "libpng - Win32 LIB"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF  "$(CFG)" == "libpng - Win32 Debug LIB"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
 SOURCE=..\pngwio.c
 # End Source File
 # Begin Source File
diff --git a/msvc/png.rc b/msvc/png.rc
index e42ff63..cba4c66 100644
--- a/msvc/png.rc
+++ b/msvc/png.rc
@@ -8,60 +8,66 @@
 
 #define PNG_LIBPNG_DLLFNAME "LIBPNG"
 
+#if defined(DLLFNAME_POSTFIX) && !defined(PRIVATEBUILD) && !defined(SPECIALBUILD)
+#  error PRIVATEBUILD or SPECIALBUILD must be defined as a string describing the type of change brought to the standard library
+#endif /* defined(DLLFNAME_POSTFIX)... */
+
 #if defined(PNG_DEBUG) && (PNG_DEBUG > 0)
-#	define VS_DEBUG VS_FF_DEBUG
-#	define DEBUG_POSTFIX "D"
-#	ifndef COMMENTS 
-#		define COMMENTS "PNG_DEBUG=" QUOTE(PNG_DEBUG)
-#	endif /* COMMENTS */
+#  define VS_DEBUG VS_FF_DEBUG
+#  ifndef DLLFNAME_POSTFIX
+#    define DLLFNAME_POSTFIX "D"
+#  endif /* DLLFNAME_POSTFIX */
+#  ifndef COMMENTS 
+#    define COMMENTS "PNG_DEBUG=" QUOTE(PNG_DEBUG)
+#  endif /* COMMENTS */
 #else
-#	define VS_DEBUG 0
-#	define DEBUG_POSTFIX
+#  define VS_DEBUG 0
+#  define DLLFNAME_POSTFIX
 #endif /* defined(DEBUG)... */
 
 #ifdef PRIVATEBUILD
-#	define VS_PRIVATEBUILD VS_FF_PRIVATEBUILD
+#  define VS_PRIVATEBUILD VS_FF_PRIVATEBUILD
 #else
-#	define VS_PRIVATEBUILD 0
+#  define VS_PRIVATEBUILD 0
 #endif /* PRIVATEBUILD */
 
 #ifdef SPECIALBUILD
-#	define VS_SPECIALBUILD VS_FF_SPECIALBUILD
+#  define VS_SPECIALBUILD VS_FF_SPECIALBUILD
 #else
-#	define VS_SPECIALBUILD 0
+#  define VS_SPECIALBUILD 0
 #endif /* SPECIALBUILD */
 
 VS_VERSION_INFO VERSIONINFO 
-FILEVERSION		PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE, PNG_LIBPNG_VER_BUILD
-PRODUCTVERSION	PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE, PNG_LIBPNG_VER_BUILD
-FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK
-FILEFLAGS		VS_DEBUG | VS_PRIVATEBUILD | VS_SPECIALBUILD
-FILEOS			VOS__WINDOWS32
-FILETYPE			VFT_DLL
+FILEVERSION PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE, PNG_LIBPNG_VER_BUILD
+PRODUCTVERSION PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE, PNG_LIBPNG_VER_BUILD
+FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+FILEFLAGS VS_DEBUG | VS_PRIVATEBUILD | VS_SPECIALBUILD
+FILEOS VOS__WINDOWS32
+FILETYPE VFT_DLL
 BEGIN
-	BLOCK "StringFileInfo"
-	BEGIN BLOCK "040904E4" /* Language type = U.S English(0x0409) and Character Set = Windows, Multilingual(0x04E4) */
-	BEGIN
+  BLOCK "StringFileInfo"
+  BEGIN BLOCK "040904E4" /* Language type = U.S English(0x0409) and Character Set = Windows, Multilingual(0x04E4) */
+    BEGIN
 #ifdef COMMENTS
-		VALUE "Comments", COMMENTS "\000"
+      VALUE "Comments", COMMENTS "\000"
 #endif /* COMMENTS */
-		VALUE "FileDescription", "PNG image compression library\000"
-		VALUE "FileVersion", PNG_LIBPNG_VER_STRING "\000"
-		VALUE "InternalName", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_MAJOR) DEBUG_POSTFIX " (Windows 32 bit)\000"
-		VALUE "LegalCopyright", "Copyright 1998-2000 Glenn Randers-Pehrson\000"
-		VALUE "OriginalFilename", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_MAJOR) DEBUG_POSTFIX ".DLL\000"
+      VALUE "FileDescription", "PNG image compression library\000"
+      VALUE "FileVersion", PNG_LIBPNG_VER_STRING "\000"
+      VALUE "InternalName", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_MAJOR) DLLFNAME_POSTFIX " (Windows 32 bit)\000"
+      VALUE "LegalCopyright", "Copyright 1998-2000 Glenn Randers-Pehrson\000"
+      VALUE "OriginalFilename", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_MAJOR) DLLFNAME_POSTFIX ".DLL\000"
 #ifdef PRIVATEBUILD
-		VALUE "PrivateBuild", PRIVATEBUILD
+      VALUE "PrivateBuild", PRIVATEBUILD
 #endif /* PRIVATEBUILD */
-		VALUE "ProductName", "LibPNG\000"
-		VALUE "ProductVersion", "1\000"
+      VALUE "ProductName", "LibPNG\000"
+      VALUE "ProductVersion", "1\000"
 #ifdef SPECIALBUILD
-		VALUE "SpecialBuild", SPECIALBUILD
+      VALUE "SpecialBuild", SPECIALBUILD
 #endif /* SPECIALBUILD */
-	END
-	END
-	BLOCK "VarFileInfo"
-	BEGIN
-	VALUE "Translation", 0x0409, 0x04E4
-	END
+    END
+  END
+  BLOCK "VarFileInfo"
+  BEGIN
+    VALUE "Translation", 0x0409, 0x04E4
+  END
 END
diff --git a/msvc/png32ms.def b/msvc/png32ms.def
index e35ec4f..7771347 100644
--- a/msvc/png32ms.def
+++ b/msvc/png32ms.def
@@ -6,172 +6,173 @@
 DESCRIPTION "PNG image compression library for Windows"
 
 EXPORTS
-;Version 1.0.7beta15
-	png_build_grayscale_palette			@1
-	png_check_sig								@2
-	png_chunk_error							@3
-	png_chunk_warning							@4
-	png_convert_from_struct_tm				@5
-	png_convert_from_time_t					@6
-	png_create_info_struct					@7
-	png_create_read_struct					@8
-	png_create_write_struct					@9
-	png_data_freer								@10
-	png_destroy_info_struct					@11
-	png_destroy_read_struct					@12
-	png_destroy_write_struct				@13
-	png_error									@14
-	png_free										@15
-	png_free_data								@16
-	png_get_IHDR								@17
-	png_get_PLTE								@18
-	png_get_bKGD								@19
-	png_get_bit_depth							@20
-	png_get_cHRM								@21
-	png_get_cHRM_fixed						@22
-	png_get_channels							@23
-	png_get_color_type						@24
-	png_get_compression_buffer_size		@25
-	png_get_compression_type				@26
-	png_get_copyright							@27
-	png_get_error_ptr							@28
-	png_get_filter_type						@29
-	png_get_gAMA								@30
-	png_get_gAMA_fixed						@31
-	png_get_hIST								@32
-	png_get_header_ver						@33
-	png_get_header_version					@34
-	png_get_iCCP								@35
-	png_get_image_height						@36
-	png_get_image_width						@37
-	png_get_interlace_type					@38
-	png_get_io_ptr								@39
-	png_get_libpng_ver						@40
-	png_get_oFFs								@41
-	png_get_pCAL								@42
-	png_get_pHYs								@43
-	png_get_pixel_aspect_ratio				@44
-	png_get_pixels_per_meter				@45
-	png_get_progressive_ptr					@46
-	png_get_rgb_to_gray_status				@47
-	png_get_rowbytes							@48
-	png_get_rows								@49
-	png_get_sBIT								@50
-	png_get_sCAL								@51
-	png_get_sPLT								@52
-	png_get_sRGB								@53
-	png_get_signature							@54
-	png_get_tIME								@55
-	png_get_tRNS								@56
-	png_get_text								@57
-	png_get_unknown_chunks					@58
-	png_get_user_chunk_ptr					@59
-	png_get_user_transform_ptr				@60
-	png_get_valid								@61
-	png_get_x_offset_microns				@62
-	png_get_x_offset_pixels					@63
-	png_get_x_pixels_per_meter				@64
-	png_get_y_offset_microns				@65
-	png_get_y_offset_pixels					@66
-	png_get_y_pixels_per_meter				@67
-	png_malloc									@68
-	png_memcpy_check							@69
-	png_memset_check							@70
-	png_permit_empty_plte					@71
-	png_process_data							@72
-	png_progressive_combine_row			@73
-	png_read_end								@74
-	png_read_image								@75
-	png_read_info								@76
-	png_read_init								@77
-	png_read_png								@78
-	png_read_row								@79
-	png_read_rows								@80
-	png_read_update_info						@81
-	png_reset_zstream							@82
-	png_set_IHDR								@83
-	png_set_PLTE								@84
-	png_set_bKGD								@85
-	png_set_background						@86
-	png_set_bgr									@87
-	png_set_cHRM								@88
-	png_set_cHRM_fixed						@89
-	png_set_compression_buffer_size		@90
-	png_set_compression_level				@91
-	png_set_compression_mem_level			@92
-	png_set_compression_method				@93
-	png_set_compression_strategy			@94
-	png_set_compression_window_bits		@95
-	png_set_crc_action						@96
-	png_set_dither								@97
-	png_set_error_fn							@98
-	png_set_expand								@99
-	png_set_filler								@100
-	png_set_filter								@101
-	png_set_filter_heuristics				@102
-	png_set_flush								@103
-	png_set_gAMA								@104
-	png_set_gAMA_fixed						@105
-	png_set_gamma								@106
-	png_set_gray_1_2_4_to_8					@107
-	png_set_gray_to_rgb						@108
-	png_set_hIST								@109
-	png_set_iCCP								@110
-	png_set_interlace_handling				@111
-	png_set_invert_alpha						@112
-	png_set_invert_mono						@113
-	png_set_keep_unknown_chunks			@114
-	png_set_oFFs								@115
-	png_set_pCAL								@116
-	png_set_pHYs								@117
-	png_set_packing							@118
-	png_set_packswap							@119
-	png_set_palette_to_rgb					@120
-	png_set_progressive_read_fn			@121
-	png_set_read_fn							@122
-	png_set_read_status_fn					@123
-	png_set_read_user_chunk_fn				@124
-	png_set_read_user_transform_fn		@125
-	png_set_rgb_to_gray						@126
-	png_set_rgb_to_gray_fixed				@127
-	png_set_rows								@128
-	png_set_sBIT								@129
-	png_set_sCAL								@130
-	png_set_sPLT								@131
-	png_set_sRGB								@132
-	png_set_sRGB_gAMA_and_cHRM				@133
-	png_set_shift								@134
-	png_set_sig_bytes							@135
-	png_set_strip_16							@136
-	png_set_strip_alpha						@137
-	png_set_swap								@138
-	png_set_swap_alpha						@139
-	png_set_tIME								@140
-	png_set_tRNS								@141
-	png_set_tRNS_to_alpha					@142
-	png_set_text								@143
-	png_set_unknown_chunk_location		@144
-	png_set_unknown_chunks					@145
-	png_set_user_transform_info			@146
-	png_set_write_fn							@147
-	png_set_write_status_fn					@148
-	png_set_write_user_transform_fn		@149
-	png_sig_cmp									@150
-	png_start_read_image						@151
-	png_warning									@152
-	png_write_chunk							@153
-	png_write_chunk_data						@154
-	png_write_chunk_end						@155
-	png_write_chunk_start					@156
-	png_write_end								@157
-	png_write_flush							@158
-	png_write_image							@159
-	png_write_info								@160
-	png_write_info_before_PLTE				@161
-	png_write_init								@162
-	png_write_png								@163
-	png_write_row								@164
-	png_write_rows								@165
-	png_read_init_2							@166
-	png_write_init_2							@167
-;	png_sig_bytes								@168
+;Version 1.0.7beta16
+  png_build_grayscale_palette  @1
+  png_check_sig        @2
+  png_chunk_error      @3
+  png_chunk_warning      @4
+  png_convert_from_struct_tm   @5
+  png_convert_from_time_t    @6
+  png_create_info_struct     @7
+  png_create_read_struct     @8
+  png_create_write_struct    @9
+  png_data_freer    @10
+  png_destroy_info_struct  @11
+  png_destroy_read_struct  @12
+  png_destroy_write_struct  @13
+  png_error    @14
+  png_free      @15
+  png_free_data    @16
+  png_get_IHDR    @17
+  png_get_PLTE    @18
+  png_get_bKGD    @19
+  png_get_bit_depth    @20
+  png_get_cHRM    @21
+  png_get_cHRM_fixed  @22
+  png_get_channels    @23
+  png_get_color_type  @24
+  png_get_compression_buffer_size  @25
+  png_get_compression_type  @26
+  png_get_copyright    @27
+  png_get_error_ptr    @28
+  png_get_filter_type  @29
+  png_get_gAMA    @30
+  png_get_gAMA_fixed  @31
+  png_get_hIST    @32
+  png_get_header_ver  @33
+  png_get_header_version  @34
+  png_get_iCCP    @35
+  png_get_image_height  @36
+  png_get_image_width  @37
+  png_get_interlace_type  @38
+  png_get_io_ptr    @39
+  png_get_libpng_ver  @40
+  png_get_oFFs    @41
+  png_get_pCAL    @42
+  png_get_pHYs    @43
+  png_get_pixel_aspect_ratio  @44
+  png_get_pixels_per_meter  @45
+  png_get_progressive_ptr  @46
+  png_get_rgb_to_gray_status  @47
+  png_get_rowbytes    @48
+  png_get_rows    @49
+  png_get_sBIT    @50
+  png_get_sCAL    @51
+  png_get_sPLT    @52
+  png_get_sRGB    @53
+  png_get_signature    @54
+  png_get_tIME    @55
+  png_get_tRNS    @56
+  png_get_text    @57
+  png_get_unknown_chunks  @58
+  png_get_user_chunk_ptr  @59
+  png_get_user_transform_ptr  @60
+  png_get_valid    @61
+  png_get_x_offset_microns  @62
+  png_get_x_offset_pixels  @63
+  png_get_x_pixels_per_meter  @64
+  png_get_y_offset_microns  @65
+  png_get_y_offset_pixels  @66
+  png_get_y_pixels_per_meter  @67
+  png_malloc    @68
+  png_memcpy_check    @69
+  png_memset_check    @70
+  png_permit_empty_plte  @71
+  png_process_data    @72
+  png_progressive_combine_row  @73
+  png_read_end    @74
+  png_read_image    @75
+  png_read_info    @76
+  png_read_init    @77
+  png_read_png    @78
+  png_read_row    @79
+  png_read_rows    @80
+  png_read_update_info  @81
+  png_reset_zstream    @82
+  png_set_IHDR    @83
+  png_set_PLTE    @84
+  png_set_bKGD    @85
+  png_set_background  @86
+  png_set_bgr    @87
+  png_set_cHRM    @88
+  png_set_cHRM_fixed  @89
+  png_set_compression_buffer_size  @90
+  png_set_compression_level  @91
+  png_set_compression_mem_level  @92
+  png_set_compression_method  @93
+  png_set_compression_strategy  @94
+  png_set_compression_window_bits  @95
+  png_set_crc_action  @96
+  png_set_dither    @97
+  png_set_error_fn    @98
+  png_set_expand    @99
+  png_set_filler    @100
+  png_set_filter    @101
+  png_set_filter_heuristics  @102
+  png_set_flush    @103
+  png_set_gAMA    @104
+  png_set_gAMA_fixed  @105
+  png_set_gamma    @106
+  png_set_gray_1_2_4_to_8  @107
+  png_set_gray_to_rgb  @108
+  png_set_hIST    @109
+  png_set_iCCP    @110
+  png_set_interlace_handling  @111
+  png_set_invert_alpha  @112
+  png_set_invert_mono  @113
+  png_set_keep_unknown_chunks  @114
+  png_set_oFFs    @115
+  png_set_pCAL    @116
+  png_set_pHYs    @117
+  png_set_packing    @118
+  png_set_packswap    @119
+  png_set_palette_to_rgb  @120
+  png_set_progressive_read_fn  @121
+  png_set_read_fn    @122
+  png_set_read_status_fn  @123
+  png_set_read_user_chunk_fn  @124
+  png_set_read_user_transform_fn  @125
+  png_set_rgb_to_gray  @126
+  png_set_rgb_to_gray_fixed  @127
+  png_set_rows    @128
+  png_set_sBIT    @129
+  png_set_sCAL    @130
+  png_set_sPLT    @131
+  png_set_sRGB    @132
+  png_set_sRGB_gAMA_and_cHRM  @133
+  png_set_shift    @134
+  png_set_sig_bytes    @135
+  png_set_strip_16    @136
+  png_set_strip_alpha  @137
+  png_set_swap    @138
+  png_set_swap_alpha  @139
+  png_set_tIME    @140
+  png_set_tRNS    @141
+  png_set_tRNS_to_alpha  @142
+  png_set_text    @143
+  png_set_unknown_chunk_location  @144
+  png_set_unknown_chunks  @145
+  png_set_user_transform_info  @146
+  png_set_write_fn    @147
+  png_set_write_status_fn  @148
+  png_set_write_user_transform_fn  @149
+  png_sig_cmp    @150
+  png_start_read_image  @151
+  png_warning    @152
+  png_write_chunk    @153
+  png_write_chunk_data  @154
+  png_write_chunk_end  @155
+  png_write_chunk_start  @156
+  png_write_end    @157
+  png_write_flush    @158
+  png_write_image    @159
+  png_write_info    @160
+  png_write_info_before_PLTE  @161
+  png_write_init    @162
+  png_write_png    @163
+  png_write_row    @164
+  png_write_rows    @165
+  png_read_init_2    @166
+  png_write_init_2    @167
+  png_access_version_number  @168
+;  png_sig_bytes    @169
diff --git a/msvc/zlib.def b/msvc/zlib.def
index f40fa35..022aa45 100644
--- a/msvc/zlib.def
+++ b/msvc/zlib.def
@@ -1,4 +1,5 @@
 LIBRARY
+DESCRIPTION "zlib compression library for Windows"
 
 EXPORTS
     adler32                        @1
diff --git a/msvc/zlib.dsp b/msvc/zlib.dsp
index 65169df..1d6f7e3 100644
--- a/msvc/zlib.dsp
+++ b/msvc/zlib.dsp
@@ -19,9 +19,9 @@
 !MESSAGE Possible choices for configuration are:
 !MESSAGE 
 !MESSAGE "zlib - Win32 DLL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "zlib - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlib - Win32 Debug DLL" (based on "Win32 (x86) Dynamic-Link Library")
 !MESSAGE "zlib - Win32 LIB" (based on "Win32 (x86) Static Library")
-!MESSAGE "zlib - Win32 LIB Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "zlib - Win32 Debug LIB" (based on "Win32 (x86) Static Library")
 !MESSAGE 
 
 # Begin Project
@@ -57,7 +57,7 @@
 # ADD LINK32 /nologo /dll /machine:I386
 # SUBTRACT LINK32 /pdb:none
 
-!ELSEIF  "$(CFG)" == "zlib - Win32 DLL Debug"
+!ELSEIF  "$(CFG)" == "zlib - Win32 Debug DLL"
 
 # PROP BASE Use_MFC 0
 # PROP BASE Use_Debug_Libraries 1
@@ -110,7 +110,7 @@
 # ADD BASE LIB32 /nologo
 # ADD LIB32 /nologo
 
-!ELSEIF  "$(CFG)" == "zlib - Win32 LIB Debug"
+!ELSEIF  "$(CFG)" == "zlib - Win32 Debug LIB"
 
 # PROP BASE Use_MFC 0
 # PROP BASE Use_Debug_Libraries 1
@@ -141,9 +141,9 @@
 # Begin Target
 
 # Name "zlib - Win32 DLL"
-# Name "zlib - Win32 DLL Debug"
+# Name "zlib - Win32 Debug DLL"
 # Name "zlib - Win32 LIB"
-# Name "zlib - Win32 LIB Debug"
+# Name "zlib - Win32 Debug LIB"
 # Begin Group "Source Files"
 
 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
@@ -212,13 +212,13 @@
 
 !IF  "$(CFG)" == "zlib - Win32 DLL"
 
-!ELSEIF  "$(CFG)" == "zlib - Win32 DLL Debug"
+!ELSEIF  "$(CFG)" == "zlib - Win32 Debug DLL"
 
 !ELSEIF  "$(CFG)" == "zlib - Win32 LIB"
 
 # PROP Exclude_From_Build 1
 
-!ELSEIF  "$(CFG)" == "zlib - Win32 LIB Debug"
+!ELSEIF  "$(CFG)" == "zlib - Win32 Debug LIB"
 
 # PROP Exclude_From_Build 1
 
@@ -231,13 +231,13 @@
 
 !IF  "$(CFG)" == "zlib - Win32 DLL"
 
-!ELSEIF  "$(CFG)" == "zlib - Win32 DLL Debug"
+!ELSEIF  "$(CFG)" == "zlib - Win32 Debug DLL"
 
 !ELSEIF  "$(CFG)" == "zlib - Win32 LIB"
 
 # PROP Exclude_From_Build 1
 
-!ELSEIF  "$(CFG)" == "zlib - Win32 LIB Debug"
+!ELSEIF  "$(CFG)" == "zlib - Win32 Debug LIB"
 
 # PROP Exclude_From_Build 1
 
diff --git a/png.5 b/png.5
index ed1144f..c5cbdfc 100644
--- a/png.5
+++ b/png.5
@@ -1,4 +1,4 @@
-.TH PNG 5 "May 29, 2000"
+.TH PNG 5 "June 4, 2000"
 .SH NAME
 png \- Portable Network Graphics (PNG) format
 .SH DESCRIPTION
diff --git a/png.c b/png.c
index 29fbb11..08b7ff1 100644
--- a/png.c
+++ b/png.c
@@ -1,10 +1,10 @@
 
 /* png.c - location for general purpose libpng functions
  *
- * libpng version 1.0.7beta15 - May 29, 2000
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
+ * libpng version 1.0.7beta16 - June 4, 2000
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
  */
 
@@ -14,14 +14,14 @@
 #include "png.h"
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef version_1_0_7beta15 Your_png_h_is_not_version_1_0_7beta15;
+typedef version_1_0_7beta16 Your_png_h_is_not_version_1_0_7beta16;
 
 /* Version information for C files.  This had better match the version
  * string defined in png.h.  */
 
 #ifdef PNG_USE_GLOBAL_ARRAYS
 /* png_libpng_ver was changed to a function in version 1.0.5c */
-char png_libpng_ver[12] = "1.0.7beta15";
+char png_libpng_ver[12] = "1.0.7beta16";
 
 /* png_sig was changed to a function in version 1.0.5c */
 /* Place to hold the signature string for a PNG file. */
@@ -605,10 +605,10 @@
 png_get_copyright(png_structp png_ptr)
 {
    if (png_ptr != NULL || png_ptr == NULL)  /* silence compiler warning */
-   return ("\n libpng version 1.0.7beta15 - May 29, 2000\n\
-   Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n\
+   return ("\n libpng version 1.0.7beta16 - June 4, 2000\n\
+   Copyright (c) 1998-2000 Glenn Randers-Pehrson\n\
    Copyright (c) 1996, 1997 Andreas Dilger\n\
-   Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson\n");
+   Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n");
    return ("");
 }
 
@@ -623,8 +623,8 @@
 {
    /* Version of *.c files used when building libpng */
    if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */
-      return("1.0.7beta15");
-   return("1.0.7beta15");
+      return("1.0.7beta16");
+   return("1.0.7beta16");
 }
 
 png_charp PNGAPI
diff --git a/png.h b/png.h
index 06bbea8..85ed922 100644
--- a/png.h
+++ b/png.h
@@ -1,15 +1,15 @@
 
 /* png.h - header file for PNG reference library
  *
- * libpng version 1.0.7beta15 - May 29, 2000
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
+ * libpng version 1.0.7beta16 - June 4, 2000
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
  * Authors and maintainers:
  *  libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
  *  libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
- *  libpng versions 0.97, January 1998, through 1.0.7beta15 - May 29, 2000: Glenn
+ *  libpng versions 0.97, January 1998, through 1.0.7beta16 - June 4, 2000: Glenn
  *  See also "Contributing Authors", below.
  *
  * Note about libpng version numbers:
@@ -52,7 +52,7 @@
  *    1.0.6h                        10007  10.6h (testing xy.z so-numbering)
  *    1.0.6i                        10007  10.6i
  *    1.0.6j                        10007  2.1.0.6j (incompatible with 1.0.0)
- *    1.0.7beta11-15                10007  2.1.0.7beta11-15 (binary compatible)
+ *    1.0.7beta11-16                10007  2.1.0.7beta11-16 (binary compatible)
  *    planned:
  *    1.0.7rc1                      10007  2.1.0.7rc1 (binary compatible)
  *    1.0.6patch4 (w/4 patches)     10006  2.1.0.6 (binary compatible)
@@ -80,32 +80,49 @@
 /*
  * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
  *
- * If you modify libpng you may insert additional notices after this sentence.
+ * If you modify libpng you may insert additional notices immediately following
+ * this sentence.
  *
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * (libpng versions 0.5, May 1995, through 0.88, January 1996)
+ * libpng versions 1.0.6, March 20, 2000, through 1.0.7beta16, June 4, 2000, are
+ * Copyright (c) 2000 Glenn Randers-Pehrson
+ * Distributed according to the same disclaimer and license as libpng-1.0.5
+ * with the following individuals added to the list of Contributing Authors:
+ *
+ *    Simon-Pierre Cadieux
+ *    Eric S. Raymond
+ *    Gilles Vollant
+ *
+ * libpng versions 0.97, January 1998, through 1.0.5, October 15, 1999, are
+ * Copyright (c) 1998, 1999 Glenn Randers-Pehrson
+ * Distributed according to the same disclaimer and license as libpng-0.96,
+ * with the following individuals added to the list of Contributing Authors:
+ *
+ *    Tom Lane
+ *    Glenn Randers-Pehrson
+ *    Willem van Schaik
+ *
+ * libpng versions 0.89, June 1996, through 0.96, May 1997, are
  * Copyright (c) 1996, 1997 Andreas Dilger
- * (libpng versions 0.89c, June 1996, through 0.96, May 1997)
- * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
- * (libpng versions 0.97, January 1998, through 1.0.7beta15, May 29, 2000)
- *
- * For the purposes of this copyright and license, "Contributing Authors"
- * is defined as the following set of individuals:
+ * Distributed according to the same disclaimer and license as libpng-0.88,
+ * with the following individuals added to the list of Contributing Authors:
  *
  *    John Bowler
  *    Kevin Bracey
  *    Sam Bushell
- *    Andreas Dilger
  *    Magnus Holmgren
- *    Tom Lane
- *    Dave Martindale
- *    Glenn Randers-Pehrson
- *    Eric S. Raymond
  *    Greg Roelofs
+ *    Tom Tanner
+ *
+ * libpng versions 0.5, May 1995, through 0.88, January 1996, are
+ * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
+ *
+ * For the purposes of this copyright and license, "Contributing Authors"
+ * is defined as the following set of individuals:
+ *
+ *    Andreas Dilger
+ *    Dave Martindale
  *    Guy Eric Schalnat
  *    Paul Schmidt
- *    Tom Tanner
- *    Willem van Schaik
  *    Tim Wegner
  *
  * The PNG Reference Library is supplied "AS IS".  The Contributing Authors
@@ -162,13 +179,13 @@
  * Y2K compliance in libpng:
  * =========================
  *
- *    May 29, 2000
+ *    June 4, 2000
  *
  *    Since the PNG Development group is an ad-hoc body, we can't make
  *    an official declaration.
  *
  *    This is your unofficial assurance that libpng from version 0.71 and
- *    upward through 1.0.7beta15 are Y2K compliant.  It is my belief that earlier
+ *    upward through 1.0.7beta16 are Y2K compliant.  It is my belief that earlier
  *    versions were also Y2K compliant.
  *
  *    Libpng only has three year fields.  One is a 2-byte unsigned integer
@@ -224,7 +241,7 @@
  */
 
 /* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.0.7beta15"
+#define PNG_LIBPNG_VER_STRING "1.0.7beta16"
 
 #define PNG_LIBPNG_VER_SONUM   2
 
@@ -234,7 +251,7 @@
 #define PNG_LIBPNG_VER_RELEASE 7
 /* This should match the numeric part of the final component of
  * PNG_LIBPNG_VER_STRING, omitting any leading zero: */
-#define PNG_LIBPNG_VER_BUILD   15
+#define PNG_LIBPNG_VER_BUILD   16
 
 /* Careful here.  At one time, Guy wanted to use 082, but that would be octal.
  * We must not include leading zeros.
@@ -1123,9 +1140,9 @@
 };
 
 /* This prevents a compiler error in png_get_copyright() in png.c if png.c
-and png.h are both at * version 1.0.7beta15
+and png.h are both at * version 1.0.7beta16
  */
-typedef png_structp version_1_0_7beta15;
+typedef png_structp version_1_0_7beta16;
 
 typedef png_struct FAR * FAR * png_structpp;
 
@@ -2144,7 +2161,7 @@
 extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr));
 
 #define PNG_HEADER_VERSION_STRING \
-   " libpng version 1.0.7beta15 - May 29, 2000 (header)\n"
+   " libpng version 1.0.7beta16 - June 4, 2000 (header)\n"
 
 #ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
 /* With these routines we avoid an integer divide, which will be slower on
diff --git a/pngasmrd.h b/pngasmrd.h
index e892795..50dcf20 100644
--- a/pngasmrd.h
+++ b/pngasmrd.h
@@ -1,6 +1,6 @@
 /* pngasmrd.h - assembler version of utilities to read a PNG file
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1999, 2000 Glenn Randers-Pehrson
  *
diff --git a/pngconf.h b/pngconf.h
index c9aa7f4..028936c 100644
--- a/pngconf.h
+++ b/pngconf.h
@@ -1,10 +1,10 @@
 /* pngconf.h - machine configurable file for libpng
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  */
 
 /* Any machine specific code is near the front of this file, so if you
@@ -153,17 +153,18 @@
 #  endif /* __linux__ */
 #endif /* PNG_SETJMP_SUPPORTED */
 
+#if defined(_AIX) && defined(__xlC__)
+/* This prevents "AIX/xlC" from generating an "index(s,c)" macro in strings.h
+ * that conflicts with libpng's png_color_16.index */
+#undef __STR__
+#endif
+
 #ifdef BSD
 #include <strings.h>
 #else
 #include <string.h>
 #endif
 
-#ifdef _AIX
-/* "index" macro in AIX strings.h conflicts with libpng's png_color_16.index */
-#undef index
-#endif
-
 /* Other defines for things like memory and the like can go here.  */
 #ifdef PNG_INTERNAL
 #include <stdlib.h>
@@ -529,6 +530,11 @@
 #define PNG_READ_BIG_ENDIAN_SUPPORTED
 */
 
+/* Buggy compilers (e.g., gcc 2.7.2.2) need this */
+/*
+#define PNG_NO_POINTER_INDEXING
+*/
+
 /* These functions are turned off by default, as they will be phased out. */
 /*
 #define  PNG_USELESS_TESTS_SUPPORTED
@@ -922,13 +928,13 @@
  * Define PNG_BUILD_DLL if the module being built is a Windows
  * LIBPNG DLL.
  *
- * Define PNG_DLL if you want to *link* to the Windows LIBPNG DLL.
+ * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL.
  * It is equivalent to Microsoft predefined macro _DLL which is
  * automatically defined when you compile using the share
  * version of the CRT (C Run-Time library)
  */
 
-#if !defined(PNG_DLL) && defined(PNG_BUILD_DLL)
+#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL))
 #  define PNG_DLL
 #endif
 
diff --git a/pngerror.c b/pngerror.c
index 37aefae..6e4cd32 100644
--- a/pngerror.c
+++ b/pngerror.c
@@ -1,11 +1,11 @@
 
 /* pngerror.c - stub functions for i/o and memory allocation
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
  * This file provides a location for all error handling.  Users who
  * need special error handling are expected to write replacement functions
diff --git a/pnggccrd.c b/pnggccrd.c
index 3a8fc6b..d1372cd 100644
--- a/pnggccrd.c
+++ b/pnggccrd.c
@@ -6,10 +6,10 @@
  *     and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm
  *     for Intel's performance analysis of the MMX vs. non-MMX code.
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1998, Intel Corporation
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * Copyright (c) 1998, Intel Corporation
  *
  * Based on MSVC code contributed by Nirav Chhatrapati, Intel Corp., 1998.
  * Interface to libpng contributed by Gilles Vollant, 1999.
diff --git a/pngget.c b/pngget.c
index fd28eea..1ff25f1 100644
--- a/pngget.c
+++ b/pngget.c
@@ -1,11 +1,11 @@
 
 /* pngget.c - retrieval of values from info struct
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  */
 
 #define PNG_INTERNAL
diff --git a/pngmem.c b/pngmem.c
index c7f708c..94b0cf9 100644
--- a/pngmem.c
+++ b/pngmem.c
@@ -1,11 +1,11 @@
 
 /* pngmem.c - stub functions for memory allocation
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
  * This file provides a location for all memory allocation.  Users who
  * need special memory handling are expected to supply replacement
diff --git a/pngpread.c b/pngpread.c
index 337d465..1934b1f 100644
--- a/pngpread.c
+++ b/pngpread.c
@@ -1,11 +1,11 @@
 
 /* pngpread.c - read a png file in push mode
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  */
 
 #define PNG_INTERNAL
diff --git a/pngread.c b/pngread.c
index 366ea44..ed94f68 100644
--- a/pngread.c
+++ b/pngread.c
@@ -1,11 +1,11 @@
 
 /* pngread.c - read a PNG file
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
  * This file contains routines that an application calls directly to
  * read a PNG file or stream.
@@ -697,7 +697,7 @@
  * not called png_set_interlace_handling(), the display_row buffer will
  * be ignored, so pass NULL to it.
  *
- * [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.7beta15
+ * [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.7beta16
  */
 
 void PNGAPI
@@ -746,7 +746,7 @@
  * only call this function once.  If you desire to have an image for
  * each pass of a interlaced image, use png_read_rows() instead.
  *
- * [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.7beta15
+ * [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.7beta16
  */
 void PNGAPI
 png_read_image(png_structp png_ptr, png_bytepp image)
diff --git a/pngrio.c b/pngrio.c
index 38bacf5..eadf360 100644
--- a/pngrio.c
+++ b/pngrio.c
@@ -1,11 +1,11 @@
 
 /* pngrio.c - functions for data input
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
  * This file provides a location for all input.  Users who need
  * special handling are expected to write a function that has the same
diff --git a/pngrtran.c b/pngrtran.c
index 394da7b..72f8548 100644
--- a/pngrtran.c
+++ b/pngrtran.c
@@ -1,11 +1,11 @@
 
 /* pngrtran.c - transforms the data in a row for PNG readers
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
  * This file contains functions optionally called by an application
  * in order to tell libpng how to handle data when reading a PNG.
diff --git a/pngrutil.c b/pngrutil.c
index a089cdb..6f290c3 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -1,11 +1,11 @@
 
 /* pngrutil.c - utilities to read a PNG file
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
  * This file contains routines that are only called from within
  * libpng itself during the course of reading an image.
@@ -152,6 +152,7 @@
 
    if (comp_type == PNG_TEXT_COMPRESSION_zTXt)
    {
+      int ret = Z_OK;
       png_ptr->zstream.next_in = (png_bytep)(chunkdata + prefix_size);
       png_ptr->zstream.avail_in = (uInt)(chunklength - prefix_size);
       png_ptr->zstream.next_out = png_ptr->zbuf;
@@ -162,7 +163,7 @@
 
       while (png_ptr->zstream.avail_in)
       {
-         int ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);
+         ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);
          if (ret != Z_OK && ret != Z_STREAM_END)
          {
             if (png_ptr->zstream.msg != NULL)
@@ -222,6 +223,9 @@
             }
          }
       }
+      if (ret != Z_STREAM_END)
+         png_warning(png_ptr,
+         "End of datastream not found in a compressed chunk (other than IDAT)");
 
       inflateReset(&png_ptr->zstream);
       png_ptr->zstream.avail_in = 0;
@@ -354,6 +358,9 @@
 {
    png_colorp palette;
    int num, i;
+#ifndef PNG_NO_POINTER_INDEXING
+   png_colorp pal_ptr;
+#endif
 
    png_debug(1, "in png_handle_PLTE\n");
 
@@ -378,7 +385,7 @@
    }
 #endif
 
-   if (length % 3)
+   if (length > 768 || length % 3)
    {
       if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
       {
@@ -396,6 +403,17 @@
 
    palette = (png_colorp)png_zalloc(png_ptr, (uInt)num, sizeof (png_color));
 
+#ifndef PNG_NO_POINTER_INDEXING
+   for (i = 0, pal_ptr = palette; i < num; i++, pal_ptr++)
+   {
+      png_byte buf[3];
+
+      png_crc_read(png_ptr, buf, 3);
+      pal_ptr->red = buf[0];
+      pal_ptr->green = buf[1];
+      pal_ptr->blue = buf[2];
+   }
+#else
    for (i = 0; i < num; i++)
    {
       png_byte buf[3];
@@ -406,6 +424,7 @@
       palette[i].green = buf[1];
       palette[i].blue = buf[2];
    }
+#endif
 
    /* If we actually NEED the PLTE chunk (ie for a paletted image), we do
       whatever the normal CRC configuration tells us.  However, if we
@@ -962,18 +981,19 @@
 
    for (profile = chunkdata; *profile; profile++)
       /* empty loop to find end of name */ ;
+
    ++profile;
 
-   /* there should be at least one NUL (the compression type byte)
+   /* there should be at least one zero (the compression type byte)
       following the separator, and we should be on it  */
-   if (profile >= chunkdata + slength)
+   if (*profile || profile >= chunkdata + slength)
    {
       png_free(png_ptr, chunkdata);
       png_warning(png_ptr, "malformed iCCP chunk");
       return;
    }
 
-   /* compression should always be zero */
+   /* compression_type should always be zero */
    compression_type = *profile++;
 
    prefix_length = profile - chunkdata;
@@ -994,6 +1014,9 @@
    png_bytep chunkdata;
    png_bytep entry_start;
    png_sPLT_t new_palette;
+#ifdef PNG_NO_POINTER_INDEXING
+   png_sPLT_entryp pp;
+#endif
    int data_length, entry_size, i;
    png_uint_32 skip = 0;
    png_size_t slength;
@@ -1057,6 +1080,7 @@
    new_palette.entries = (png_sPLT_entryp)png_malloc(
        png_ptr, new_palette.nentries * sizeof(png_sPLT_entry));
 
+#ifndef PNG_NO_POINTER_INDEXING
    for (i = 0; i < new_palette.nentries; i++)
    {
       png_sPLT_entryp pp = new_palette.entries + i;
@@ -1077,6 +1101,28 @@
       }
       pp->frequency = png_get_uint_16(entry_start); entry_start += 2;
    }
+#else
+   pp = new_palette.entries;
+   for (i = 0; i < new_palette.nentries; i++)
+   {
+
+      if (new_palette.depth == 8)
+      {
+          pp[i].red   = *entry_start++;
+          pp[i].green = *entry_start++;
+          pp[i].blue  = *entry_start++;
+          pp[i].alpha = *entry_start++;
+      }
+      else
+      {
+          pp[i].red   = png_get_uint_16(entry_start); entry_start += 2;
+          pp[i].green = png_get_uint_16(entry_start); entry_start += 2;
+          pp[i].blue  = png_get_uint_16(entry_start); entry_start += 2;
+          pp[i].alpha = png_get_uint_16(entry_start); entry_start += 2;
+      }
+      pp->frequency = png_get_uint_16(entry_start); entry_start += 2;
+   }
+#endif
 
    /* discard all chunk data except the name and stash that */
    new_palette.name = (png_charp)chunkdata;
diff --git a/pngset.c b/pngset.c
index ac8f3de..bdb61e7 100644
--- a/pngset.c
+++ b/pngset.c
@@ -1,11 +1,11 @@
 
 /* pngset.c - storage of image information into info struct
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
  * The functions here are used during reads to store data from the file
  * into the info struct, and during writes to store application data
diff --git a/pngtest.c b/pngtest.c
index f15e6ad..d4155af 100644
--- a/pngtest.c
+++ b/pngtest.c
@@ -1,11 +1,11 @@
 
 /* pngtest.c - a simple test program to test libpng
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
  * This program reads in a PNG image, writes it out again, and then
  * compares the two files.  If the files are identical, this shows that
@@ -1392,4 +1392,4 @@
 }
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef version_1_0_7beta15 your_png_h_is_not_version_1_0_7beta15;
+typedef version_1_0_7beta16 your_png_h_is_not_version_1_0_7beta16;
diff --git a/pngtrans.c b/pngtrans.c
index b69064b..c26baca 100644
--- a/pngtrans.c
+++ b/pngtrans.c
@@ -1,11 +1,11 @@
 
 /* pngtrans.c - transforms the data in a row (used by both readers and writers)
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  */
 
 #define PNG_INTERNAL
diff --git a/pngvcrd.c b/pngvcrd.c
index b4754bd..38aa528 100644
--- a/pngvcrd.c
+++ b/pngvcrd.c
@@ -2,10 +2,10 @@
  *
  * For Intel x86 CPU and Microsoft Visual C++ compiler
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1998, Intel Corporation
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * Copyright (c) 1998, Intel Corporation
  *
  * Contributed by Nirav Chhatrapati, Intel Corporation, 1998
  * Interface to libpng contributed by Gilles Vollant, 1999
diff --git a/pngwio.c b/pngwio.c
index de03744..fbc25b7 100644
--- a/pngwio.c
+++ b/pngwio.c
@@ -1,11 +1,11 @@
 
 /* pngwio.c - functions for data output
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
  * This file provides a location for all output.  Users who need
  * special handling are expected to write functions that have the same
diff --git a/pngwrite.c b/pngwrite.c
index b3ae080..48ea615 100644
--- a/pngwrite.c
+++ b/pngwrite.c
@@ -1,11 +1,11 @@
 
 /* pngwrite.c - general routines to write a PNG file
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  */
 
 /* get internal access to png.h */
diff --git a/pngwtran.c b/pngwtran.c
index 5409899..d0e74c9 100644
--- a/pngwtran.c
+++ b/pngwtran.c
@@ -1,11 +1,11 @@
 
 /* pngwtran.c - transforms the data in a row for PNG writers
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  */
 
 #define PNG_INTERNAL
diff --git a/pngwutil.c b/pngwutil.c
index 8a5c2ac..df578c7 100644
--- a/pngwutil.c
+++ b/pngwutil.c
@@ -1,11 +1,11 @@
 
 /* pngwutil.c - utilities to write a PNG file
  *
- * libpng 1.0.7beta15 - May 29, 2000
+ * libpng 1.0.7beta16 - June 4, 2000
  * For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
- * Copyright (c) 1996, 1997 Andreas Dilger
  * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  */
 
 #define PNG_INTERNAL
@@ -532,6 +532,7 @@
    png_debug1(3, "num_palette = %d\n", png_ptr->num_palette);
 
    png_write_chunk_start(png_ptr, (png_bytep)png_PLTE, num_pal * 3);
+#ifndef PNG_NO_POINTER_INDEXING
    for (i = 0, pal_ptr = palette; i < num_pal; i++, pal_ptr++)
    {
       buf[0] = pal_ptr->red;
@@ -539,6 +540,17 @@
       buf[2] = pal_ptr->blue;
       png_write_chunk_data(png_ptr, buf, (png_size_t)3);
    }
+#else
+   /* This is a little slower but some buggy compilers need to do this instead */
+   pal_ptr=palette;
+   for (i = 0; i < num_pal; i++)
+   {
+      buf[0] = pal_ptr[i].red;
+      buf[1] = pal_ptr[i].green;
+      buf[2] = pal_ptr[i].blue;
+      png_write_chunk_data(png_ptr, buf, (png_size_t)3);
+   }
+#endif
    png_write_chunk_end(png_ptr);
    png_ptr->mode |= PNG_HAVE_PLTE;
 }
@@ -680,6 +692,9 @@
    int entry_size = (spalette->depth == 8 ? 6 : 10);
    int palette_size = entry_size * spalette->nentries;
    png_sPLT_entryp ep;
+#ifdef PNG_NO_POINTER_INDEXING
+   int i;
+#endif
 
    png_debug(1, "in png_write_sPLT\n");
    if (spalette->name == NULL || (name_len = png_check_keyword(png_ptr,
@@ -696,6 +711,7 @@
    png_write_chunk_data(png_ptr, (png_bytep)&spalette->depth, 1);
 
    /* loop through each palette entry, writing appropriately */
+#ifndef PNG_NO_POINTER_INDEXING
    for (ep = spalette->entries; ep<spalette->entries+spalette->nentries; ep++)
    {
        if (spalette->depth == 8)
@@ -716,6 +732,29 @@
        }
        png_write_chunk_data(png_ptr, entrybuf, entry_size);
    }
+#else
+   ep=spalette->entries;
+   for (i=0; i>spalette->nentries; i++)
+   {
+       if (spalette->depth == 8)
+       {
+           entrybuf[0] = (png_byte)ep[i].red;
+           entrybuf[1] = (png_byte)ep[i].green;
+           entrybuf[2] = (png_byte)ep[i].blue;
+           entrybuf[3] = (png_byte)ep[i].alpha;
+           png_save_uint_16(entrybuf + 4, ep[i].frequency);
+       }
+       else
+       {
+           png_save_uint_16(entrybuf + 0, ep[i].red);
+           png_save_uint_16(entrybuf + 2, ep[i].green);
+           png_save_uint_16(entrybuf + 4, ep[i].blue);
+           png_save_uint_16(entrybuf + 6, ep[i].alpha);
+           png_save_uint_16(entrybuf + 8, ep[i].frequency);
+       }
+       png_write_chunk_data(png_ptr, entrybuf, entry_size);
+   }
+#endif
 
    png_write_chunk_end(png_ptr);
    png_free(png_ptr, new_name);
diff --git a/scripts/libpng.icc b/scripts/libpng.icc
index e23b6b0..f9c51af 100644
--- a/scripts/libpng.icc
+++ b/scripts/libpng.icc
@@ -1,6 +1,7 @@
 // Project file for libpng (static)
 // IBM VisualAge/C++ version 4.0 or later
 // Copyright (C) 2000 Cosmin Truta
+// For conditions of distribution and use, see copyright notice in png.h
 // Notes:
 //   All modules are compiled in C mode
 //   Tested with IBM VAC++ 4.0 under Win32
diff --git a/scripts/makefile-amiga-wolf.txt b/scripts/makefile-amiga-wolf.txt
index 3beb287..4587088 100644
--- a/scripts/makefile-amiga-wolf.txt
+++ b/scripts/makefile-amiga-wolf.txt
@@ -1,6 +1,7 @@
 # Commodore Amiga Makefile
 # makefile for libpng and SAS C V6.5x compiler
 # Copyright (C) 1995-2000 Wolf Faust
+# For conditions of distribution and use, see copyright notice in png.h
 #
 # Note: Use #define PNG_READ_BIG_ENDIAN_SUPPORTED in pngconf.h
 #
diff --git a/scripts/makefile.amiga b/scripts/makefile.amiga
index 4a45604..f92af3e 100644
--- a/scripts/makefile.amiga
+++ b/scripts/makefile.amiga
@@ -1,6 +1,7 @@
 # Commodore Amiga Makefile
 # makefile for libpng and SAS C V6.55 compiler
 # Copyright (C) 1995 Wolf Faust
+# For conditions of distribution and use, see copyright notice in png.h
 
 #compiler
 CC=sc
diff --git a/scripts/makefile.beos b/scripts/makefile.beos
index 1299e8d..5f168ba 100644
--- a/scripts/makefile.beos
+++ b/scripts/makefile.beos
@@ -1,7 +1,7 @@
 # makefile for libpng on BeOS x86 ELF with gcc
 # modified from makefile.linux by Sander Stoks
-# Copyright (C) 1996, 1997 Andreas Dilger
 # Copyright (C) 1999 Greg Roelofs
+# Copyright (C) 1996, 1997 Andreas Dilger
 # For conditions of distribution and use, see copyright notice in png.h
 
 CC=gcc
@@ -31,7 +31,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 2.  You should not
 # have to change it.
 PNGMAJ = 2
-PNGMIN = 1.0.7beta15
+PNGMIN = 1.0.7beta16
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # where make install puts libpng.a, libpng.so*, and png.h
diff --git a/scripts/makefile.dec b/scripts/makefile.dec
index d9199d1..f46c426 100644
--- a/scripts/makefile.dec
+++ b/scripts/makefile.dec
@@ -14,7 +14,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 2.  You should not
 # have to change it.
 PNGMAJ = 2
-PNGMIN = 1.0.7beta15
+PNGMIN = 1.0.7beta16
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 CC=cc
diff --git a/scripts/makefile.gcc b/scripts/makefile.gcc
index cd0b803..f7fc368 100644
--- a/scripts/makefile.gcc
+++ b/scripts/makefile.gcc
@@ -1,6 +1,6 @@
 # makefile for libpng using gcc (generic, static library)
-# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 # Copyright (C) 2000 Cosmin Truta
+# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
 # For conditions of distribution and use, see copyright notice in png.h
 
 # Location of the zlib library and include files
diff --git a/scripts/makefile.gcmmx b/scripts/makefile.gcmmx
index 9c5387a..e6a774b 100644
--- a/scripts/makefile.gcmmx
+++ b/scripts/makefile.gcmmx
@@ -1,6 +1,6 @@
 # makefile for libpng on Linux ELF with gcc using MMX assembler code
-# Copyright (C) 1996, 1997 Andreas Dilger
 # Copyright (C) 1998-2000 Greg Roelofs
+# Copyright (C) 1996, 1997 Andreas Dilger
 # For conditions of distribution and use, see copyright notice in png.h
 
 CC=gcc
@@ -34,7 +34,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 2.  You should not
 # have to change it.
 PNGMAJ = 2
-PNGMIN = 1.0.7beta15
+PNGMIN = 1.0.7beta16
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 INCPATH=$(prefix)/include
diff --git a/scripts/makefile.hpux b/scripts/makefile.hpux
index 1a98fdd..3956255 100644
--- a/scripts/makefile.hpux
+++ b/scripts/makefile.hpux
@@ -1,6 +1,6 @@
 # makefile for libpng, HPUX (10.20 and 11.00)
-# Copyright (C) 1995 Guy Eric Schalnat, Group 42
 # Copyright (C) 1999 Glenn Randers-Pehrson
+# Copyright (C) 1995 Guy Eric Schalnat, Group 42
 # contributed by Jim Rice, Hewlett Packard
 # For conditions of distribution and use, see copyright notice in png.h
 
diff --git a/scripts/makefile.ibmc b/scripts/makefile.ibmc
index 0de7d94..0f596c2 100644
--- a/scripts/makefile.ibmc
+++ b/scripts/makefile.ibmc
@@ -1,12 +1,12 @@
 # Makefile for libpng (static)
 # IBM C version 3.x for Win32 and OS/2
 # Copyright (C) 2000 Cosmin Truta
+# For conditions of distribution and use, see copyright notice in png.h
 # Notes:
 #   Derived from makefile.std
 #   All modules are compiled in C mode
 #   Tested with IBM C 3.6.5 under Win32, expected to work under OS/2 too
 #   Can be easily adapted for IBM VisualAge/C++ for AIX
-# For conditions of distribution and use, see copyright notice in png.h
 
 # Location of the zlib library and include files
 ZLIBINC = ../zlib
diff --git a/scripts/makefile.linux b/scripts/makefile.linux
index 970afe2..2297d19 100644
--- a/scripts/makefile.linux
+++ b/scripts/makefile.linux
@@ -1,6 +1,6 @@
 # makefile for libpng on Linux ELF with gcc
-# Copyright (C) 1996, 1997 Andreas Dilger
 # Copyright (C) 1998, 1999 Greg Roelofs
+# Copyright (C) 1996, 1997 Andreas Dilger
 # For conditions of distribution and use, see copyright notice in png.h
 
 CC=gcc
@@ -34,7 +34,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 2.  You should not
 # have to change it.
 PNGMAJ = 2
-PNGMIN = 1.0.7beta15
+PNGMIN = 1.0.7beta16
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 INCPATH=$(prefix)/include
diff --git a/scripts/makefile.sco b/scripts/makefile.sco
index a56ac0f..a5f754a 100644
--- a/scripts/makefile.sco
+++ b/scripts/makefile.sco
@@ -1,8 +1,8 @@
 # makefile for SCO OSr5  ELF and Unixware 7 with Native cc
 # Contributed by Mike Hopkirk (hops@sco.com) modified from Makefile.lnx
 #   force ELF build dynamic linking, SONAME setting in lib and RPATH in app
-# Copyright (C) 1996, 1997 Andreas Dilger
 # Copyright (C) 1998 Greg Roelofs
+# Copyright (C) 1996, 1997 Andreas Dilger
 # For conditions of distribution and use, see copyright notice in png.h
 
 CC=cc
@@ -25,7 +25,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 2.  You should not
 # have to change it.
 PNGMAJ = 2
-PNGMIN = 1.0.7beta15
+PNGMIN = 1.0.7beta16
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 INCPATH=$(prefix)/include
diff --git a/scripts/makefile.sggcc b/scripts/makefile.sggcc
index 7e44da7..e5619ba 100644
--- a/scripts/makefile.sggcc
+++ b/scripts/makefile.sggcc
@@ -19,8 +19,8 @@
 LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
 LDSHARED=gcc -shared
 
-VER=1.0.7beta15
-LIBS=libpng.so.1.0.7beta15
+VER=1.0.7beta16
+LIBS=libpng.so.1.0.7beta16
 SHAREDLIB=libpng.so
 libdir=$(prefix)/lib32
 
diff --git a/scripts/makefile.solaris b/scripts/makefile.solaris
index 0fba31c..fb2f7e4 100644
--- a/scripts/makefile.solaris
+++ b/scripts/makefile.solaris
@@ -1,7 +1,7 @@
 # makefile for libpng on Solaris 2.x with gcc
 # Contributed by William L. Sebok, based on makefile.linux
-# Copyright (C) 1996, 1997 Andreas Dilger
 # Copyright (C) 1998 Greg Roelofs
+# Copyright (C) 1996, 1997 Andreas Dilger
 # For conditions of distribution and use, see copyright notice in png.h
 
 CC=gcc
@@ -31,7 +31,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 2.  You should not
 # have to change it.
 PNGMAJ = 2
-PNGMIN = 1.0.7beta15
+PNGMIN = 1.0.7beta16
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 INCPATH=$(prefix)/include
diff --git a/scripts/pngdef.pas b/scripts/pngdef.pas
index 8409a5c..3de3bed 100644
--- a/scripts/pngdef.pas
+++ b/scripts/pngdef.pas
@@ -5,7 +5,7 @@
 interface
 
 const
-  PNG_LIBPNG_VER_STRING = '1.0.7beta15';
+  PNG_LIBPNG_VER_STRING = '1.0.7beta16';
   PNG_LIBPNG_VER        =  10007;
 
 type
diff --git a/scripts/smakefile.ppc b/scripts/smakefile.ppc
index fa3cad4..e5c0278 100644
--- a/scripts/smakefile.ppc
+++ b/scripts/smakefile.ppc
@@ -1,6 +1,7 @@
 # Amiga powerUP (TM) Makefile
 # makefile for libpng and SAS C V6.58/7.00 PPC compiler
 # Copyright (C) 1998 by Andreas R. Kleinert
+# For conditions of distribution and use, see copyright notice in png.h
 
 CC       = scppc
 CFLAGS   = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL IDIR /zlib \