[libpng16] In pngtest, treat benign errors as errors if "-strict" is present.
diff --git a/ANNOUNCE b/ANNOUNCE
index abc870d..1c9ee73 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,5 @@
 
-Libpng 1.6.0beta18 - March 10, 2012
+Libpng 1.6.0beta18 - March 11, 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.
@@ -298,8 +298,9 @@
     chunks could end up with a too-small windowBits value in the deflate
     header.
 
-Version 1.6.0beta18 [March 10, 2012]
+Version 1.6.0beta18 [March 11, 2012]
   Issue a png_benign_error() instead of png_warning() about bad palette index.
+  In pngtest, treat benign errors as errors if "-strict" is present.
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
diff --git a/CHANGES b/CHANGES
index 2fe5123..29be270 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4049,8 +4049,9 @@
     chunks could end up with a too-small windowBits value in the deflate
     header.
 
-Version 1.6.0beta18 [March 10, 2012]
+Version 1.6.0beta18 [March 11, 2012]
   Issue a png_benign_error() instead of png_warning() about bad palette index.
+  In pngtest, treat benign errors as errors if "-strict" is present.
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
diff --git a/pngtest.c b/pngtest.c
index 78c275b..5b1da56 100644
--- a/pngtest.c
+++ b/pngtest.c
@@ -745,6 +745,17 @@
 #endif
 #endif
 
+   if (strict)
+   {
+      /* Treat png_benign_error() as errors on read */
+      png_set_benign_errors(read_ptr, 0);
+   
+      /* Treat them as errors on write */
+      png_set_benign_errors(write_ptr, 0);
+
+      /* if strict is not set, then both are treated as warnings. */
+   }
+
    pngtest_debug("Initializing input and output streams");
 #ifdef PNG_STDIO_SUPPORTED
    png_init_io(read_ptr, fpin);