[libpng16] Use /MDd for vstudio debug builds.

Also added pngunkown to the vstudio builds, fixed build errors and corrected
a minor exit code error in pngvalid if the 'touch' file name is invalid.
diff --git a/ANNOUNCE b/ANNOUNCE
index d867bb4..c8bb44d 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,5 @@
 
-Libpng 1.6.0beta30 - September 29, 2012
+Libpng 1.6.0beta30 - September 30, 2012
 
 This is not intended to be a public release.  It will be replaced
 within a few weeks by a public version or by another test version.
@@ -504,7 +504,7 @@
     part plus guessing a gAMA value requires code to pass selected RGB values
     through the profile.
 
-Version 1.6.0beta30 [September 29, 2012]
+Version 1.6.0beta30 [September 30, 2012]
   Changed ICC profile matrix/vector types to not depend on array type rules.
     By the ANSI-C standard the new types should be identical to the previous
     versions, and all known versions of gcc tested with the previous versions
@@ -518,7 +518,10 @@
   Marked the broken (bad white point) original HP sRGB profiles correctly and
     correct comments.
   Added -DZ_SOLO to contrib/pngminim/*/makefile to work with zlib-1.2.7
-  Add updated WARNING file from libpng 1.5/vstudio
+  Use /MDd for vstudio debug builds. Also added pngunkown to the vstudio
+    builds, fixed build errors and corrected a minor exit code error in
+    pngvalid if the 'touch' file name is invalid.
+  Add updated WARNING file to projects/vstudio from libpng 1.5/vstudio
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
diff --git a/CHANGES b/CHANGES
index ec22379..33d87a2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4256,7 +4256,7 @@
     part plus guessing a gAMA value requires code to pass selected RGB values
     through the profile.
 
-Version 1.6.0beta30 [September 29, 2012]
+Version 1.6.0beta30 [September 30, 2012]
   Changed ICC profile matrix/vector types to not depend on array type rules.
     By the ANSI-C standard the new types should be identical to the previous
     versions, and all known versions of gcc tested with the previous versions
@@ -4270,7 +4270,10 @@
   Marked the broken (bad white point) original HP sRGB profiles correctly and
     correct comments.
   Added -DZ_SOLO to contrib/pngminim/*/makefile to work with zlib-1.2.7
-  Add updated WARNING file from libpng 1.5/vstudio
+  Use /MDd for vstudio debug builds. Also added pngunkown to the vstudio
+    builds, fixed build errors and corrected a minor exit code error in
+    pngvalid if the 'touch' file name is invalid.
+  Add updated WARNING file to projects/vstudio from libpng 1.5/vstudio
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
diff --git a/projects/vstudio/libpng/libpng.vcxproj b/projects/vstudio/libpng/libpng.vcxproj
index 9054cae..e66b9c6 100644
--- a/projects/vstudio/libpng/libpng.vcxproj
+++ b/projects/vstudio/libpng/libpng.vcxproj
@@ -101,6 +101,7 @@
       <AdditionalIncludeDirectories>$(ZLibSrcDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <TreatWarningAsError>true</TreatWarningAsError>
       <Optimization>Disabled</Optimization>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
diff --git a/projects/vstudio/pngstest/pngstest.vcxproj b/projects/vstudio/pngstest/pngstest.vcxproj
index cc5517b..efd74e2 100644
--- a/projects/vstudio/pngstest/pngstest.vcxproj
+++ b/projects/vstudio/pngstest/pngstest.vcxproj
@@ -91,6 +91,7 @@
       <FunctionLevelLinking>false</FunctionLevelLinking>
       <BrowseInformation>true</BrowseInformation>
       <FloatingPointExceptions>false</FloatingPointExceptions>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
diff --git a/projects/vstudio/pngtest/pngtest.vcxproj b/projects/vstudio/pngtest/pngtest.vcxproj
index 51b9574..3680b8c 100644
--- a/projects/vstudio/pngtest/pngtest.vcxproj
+++ b/projects/vstudio/pngtest/pngtest.vcxproj
@@ -91,6 +91,7 @@
       <FunctionLevelLinking>false</FunctionLevelLinking>
       <BrowseInformation>true</BrowseInformation>
       <FloatingPointExceptions>false</FloatingPointExceptions>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
diff --git a/projects/vstudio/pngvalid/pngvalid.vcxproj b/projects/vstudio/pngvalid/pngvalid.vcxproj
index 2fbb714..31ab0e0 100644
--- a/projects/vstudio/pngvalid/pngvalid.vcxproj
+++ b/projects/vstudio/pngvalid/pngvalid.vcxproj
@@ -21,7 +21,7 @@
   <PropertyGroup Label="Globals">
     <ProjectGuid>{9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}</ProjectGuid>
     <Keyword>Win32Proj</Keyword>
-    <RootNamespace>pngvalid</RootNamespace>
+    <RootNamespace>pngunknown</RootNamespace>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <Import Project="$(SolutionDir)\zlib.props" />
@@ -91,6 +91,7 @@
       <FunctionLevelLinking>false</FunctionLevelLinking>
       <BrowseInformation>true</BrowseInformation>
       <FloatingPointExceptions>false</FloatingPointExceptions>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
@@ -100,9 +101,9 @@
     </Link>
     <CustomBuildStep>
       <Message>Executing PNG validation program</Message>
-      <Command>"$(OutDir)pngvalid.exe" --touch "$(IntDir)pngvalid.out"</Command>
-      <Outputs>$(IntDir)pngvalid.out</Outputs>
-      <Inputs>$(OutDir)pngvalid.exe</Inputs>
+      <Command>"$(OutDir)pngunknown.exe" --strict --default --touch "$(IntDir)pngunknown.out" ../../../pngtest.png</Command>
+      <Outputs>$(IntDir)pngunknown.out</Outputs>
+      <Inputs>$(OutDir)pngunknown.exe</Inputs>
     </CustomBuildStep>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'">
@@ -124,6 +125,7 @@
       <FunctionLevelLinking>false</FunctionLevelLinking>
       <BrowseInformation>true</BrowseInformation>
       <FloatingPointExceptions>false</FloatingPointExceptions>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
@@ -133,9 +135,9 @@
     </Link>
     <CustomBuildStep>
       <Message>Executing PNG validation program</Message>
-      <Command>"$(OutDir)pngvalid.exe" --touch "$(IntDir)pngvalid.out"</Command>
-      <Outputs>$(IntDir)pngvalid.out</Outputs>
-      <Inputs>$(OutDir)pngvalid.exe</Inputs>
+      <Command>"$(OutDir)pngunknown.exe" --strict --default --touch "$(IntDir)pngunknown.out" ../../../pngtest.png</Command>
+      <Outputs>$(IntDir)pngunknown.out</Outputs>
+      <Inputs>$(OutDir)pngunknown.exe</Inputs>
     </CustomBuildStep>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -168,9 +170,9 @@
     </Link>
     <CustomBuildStep>
       <Message>Executing PNG validation program</Message>
-      <Command>"$(OutDir)pngvalid.exe" --touch "$(IntDir)pngvalid.out"</Command>
-      <Outputs>$(IntDir)pngvalid.out</Outputs>
-      <Inputs>$(OutDir)pngvalid.exe</Inputs>
+      <Command>"$(OutDir)pngunknown.exe" --strict --default --touch "$(IntDir)pngunknown.out" ../../../pngtest.png</Command>
+      <Outputs>$(IntDir)pngunknown.out</Outputs>
+      <Inputs>$(OutDir)pngunknown.exe</Inputs>
     </CustomBuildStep>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Library|Win32'">
@@ -204,13 +206,13 @@
     </Link>
     <CustomBuildStep>
       <Message>Executing PNG validation program</Message>
-      <Command>"$(OutDir)pngvalid.exe" --touch "$(IntDir)pngvalid.out"</Command>
-      <Outputs>$(IntDir)pngvalid.out</Outputs>
-      <Inputs>$(OutDir)pngvalid.exe</Inputs>
+      <Command>"$(OutDir)pngunknown.exe" --strict --default --touch "$(IntDir)pngunknown.out" ../../../pngtest.png</Command>
+      <Outputs>$(IntDir)pngunknown.out</Outputs>
+      <Inputs>$(OutDir)pngunknown.exe</Inputs>
     </CustomBuildStep>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\..\contrib\libtests\pngvalid.c" />
+    <ClCompile Include="..\..\..\contrib\libtests\pngunknown.c" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
diff --git a/projects/vstudio/readme.txt b/projects/vstudio/readme.txt
index 2823548..134eb5b 100644
--- a/projects/vstudio/readme.txt
+++ b/projects/vstudio/readme.txt
@@ -1,7 +1,7 @@
 
 VisualStudio instructions
 
-libpng version 1.6.0beta30 - September 29, 2012
+libpng version 1.6.0beta30 - September 30, 2012
 
 Copyright (c) 1998-2010 Glenn Randers-Pehrson
 
@@ -33,8 +33,8 @@
 Linking your application
 ========================
 Normally you should link against the 'release' configuration.  This builds a
-DLL for libpng 1.5 with the default runtime options used by Visual Studio
-2010.  In particular the runtime library is the "MultiThreaded DLL" version.
+DLL for libpng with the default runtime options used by Visual Studio 2010.
+In particular the runtime library is the "MultiThreaded DLL" version.
 If you use Visual Studio defaults to build your application you will have no
 problems.
 
@@ -58,7 +58,8 @@
 This solution includes limited support for debug versions of libpng.  You
 do not need these unless your own solution itself uses debug builds (it is
 far more effective to debug on the release builds, there is no point building
-a special debug build.)
+a special debug build unless you have heap corruption problems that you can't
+track down.)
 
 The debug build of libpng is minimally supported.  Support for debug builds of
 zlib is also minimal.  You really don't want to do this.
diff --git a/projects/vstudio/vstudio.sln b/projects/vstudio/vstudio.sln
index 215ed0e..af0b1ba 100644
--- a/projects/vstudio/vstudio.sln
+++ b/projects/vstudio/vstudio.sln
@@ -1,5 +1,9 @@
 Microsoft Visual Studio Solution File, Format Version 11.00
 # Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcxproj", "{60F89955-91C6-3A36-8000-13C592FEC2DF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pnglibconf", "pnglibconf\pnglibconf.vcxproj", "{EB33566E-DA7F-4D28-9077-88C0B7C77E35}"
+EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "libpng\libpng.vcxproj", "{D6973076-9317-4EF2-A0B8-B7A18AC0713E}"
 	ProjectSection(ProjectDependencies) = postProject
 		{60F89955-91C6-3A36-8000-13C592FEC2DF} = {60F89955-91C6-3A36-8000-13C592FEC2DF}
@@ -13,8 +17,6 @@
 		{D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {D6973076-9317-4EF2-A0B8-B7A18AC0713E}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcxproj", "{60F89955-91C6-3A36-8000-13C592FEC2DF}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pngvalid", "pngvalid\pngvalid.vcxproj", "{9B36B6FE-7FC0-434F-A71F-BBEF8099F1D8}"
 	ProjectSection(ProjectDependencies) = postProject
 		{60F89955-91C6-3A36-8000-13C592FEC2DF} = {60F89955-91C6-3A36-8000-13C592FEC2DF}
@@ -22,8 +24,6 @@
 		{D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {D6973076-9317-4EF2-A0B8-B7A18AC0713E}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pnglibconf", "pnglibconf\pnglibconf.vcxproj", "{EB33566E-DA7F-4D28-9077-88C0B7C77E35}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pngstest", "pngstest\pngstest.vcxproj", "{277AC57F-313B-4D06-B119-A3CDB672D2FF}"
 	ProjectSection(ProjectDependencies) = postProject
 		{60F89955-91C6-3A36-8000-13C592FEC2DF} = {60F89955-91C6-3A36-8000-13C592FEC2DF}
@@ -31,6 +31,13 @@
 		{D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {D6973076-9317-4EF2-A0B8-B7A18AC0713E}
 	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pngunknown", "pngunknown\pngunknown.vcxproj", "{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}"
+	ProjectSection(ProjectDependencies) = postProject
+		{60F89955-91C6-3A36-8000-13C592FEC2DF} = {60F89955-91C6-3A36-8000-13C592FEC2DF}
+		{EB33566E-DA7F-4D28-9077-88C0B7C77E35} = {EB33566E-DA7F-4D28-9077-88C0B7C77E35}
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {D6973076-9317-4EF2-A0B8-B7A18AC0713E}
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug Library|Win32 = Debug Library|Win32
@@ -87,6 +94,14 @@
 		{277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release Library|Win32.Build.0 = Release Library|Win32
 		{277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release|Win32.ActiveCfg = Release|Win32
 		{277AC57F-313B-4D06-B119-A3CDB672D2FF}.Release|Win32.Build.0 = Release|Win32
+		{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Debug Library|Win32.ActiveCfg = Debug Library|Win32
+		{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Debug Library|Win32.Build.0 = Debug Library|Win32
+		{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Debug|Win32.Build.0 = Debug|Win32
+		{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Release Library|Win32.ActiveCfg = Release Library|Win32
+		{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Release Library|Win32.Build.0 = Release Library|Win32
+		{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Release|Win32.ActiveCfg = Release|Win32
+		{C5D3156C-8C8C-4936-B35F-2B829BA36FEC}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
diff --git a/projects/vstudio/zlib.props b/projects/vstudio/zlib.props
index 49e5a5f..def366b 100644
--- a/projects/vstudio/zlib.props
+++ b/projects/vstudio/zlib.props
@@ -2,7 +2,7 @@
 <!--
  * zlib.props - location of zlib source
  *
- * libpng version 1.6.0beta30 - September 29, 2012
+ * libpng version 1.6.0beta30 - September 30, 2012
  *
  * Copyright (c) 1998-2011 Glenn Randers-Pehrson
  *
diff --git a/projects/vstudio/zlib/zlib.vcxproj b/projects/vstudio/zlib/zlib.vcxproj
index c2fb002..d56721d 100644
--- a/projects/vstudio/zlib/zlib.vcxproj
+++ b/projects/vstudio/zlib/zlib.vcxproj
@@ -106,6 +106,7 @@
       <Optimization>Disabled</Optimization>
       <BrowseInformation>true</BrowseInformation>
       <FunctionLevelLinking>true</FunctionLevelLinking>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
     </ClCompile>
     <Link>
       <TargetMachine>MachineX86</TargetMachine>