[master] Restore new pngtest.c
diff --git a/ANNOUNCE b/ANNOUNCE
index 68d2c7d..3de0a2a 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -137,10 +137,10 @@
     functions while building libpng.  They need to be tested, especially
     those using compilers other than gcc.
   Updated projects/visualc6 and visualc71 with "/d PNG_CONFIGURE_LIBPNG".
-  Removed three direct references to read_info_ptr members in pngtest.c
-    that were detected by the new PNG_DEPSTRUCT macro.
 
 version 1.2.41beta16 [November 9, 2009]
+  Removed three direct references to read_info_ptr members in pngtest.c
+    that were detected by the new PNG_DEPSTRUCT macro.
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 
diff --git a/CHANGES b/CHANGES
index 49a6653..6e942a3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2568,19 +2568,10 @@
     functions while building libpng.  They need to be tested, especially
     those using compilers other than gcc.
   Updated projects/visualc6 and visualc71 with "/d PNG_CONFIGURE_LIBPNG".
-  Removed three direct references to read_info_ptr members in pngtest.c
-    that were detected by the new PNG_DEPSTRUCT macro.
 
 version 1.2.41beta16 [November 9, 2009]
-
-Send comments/corrections/commendations to png-mng-implement at lists.sf.net
-(subscription required; visit
-https://lists.sourceforge.net/lists/listinfo/png-mng-implement
-to subscribe)
-or to glennrp at users.sourceforge.net
-
-Glenn R-P
-*/
+  Removed three direct references to read_info_ptr members in pngtest.c
+    that were detected by the new PNG_DEPSTRUCT macro.
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
diff --git a/pngtest.c b/pngtest.c
index cd75f87..87c9cc3 100644
--- a/pngtest.c
+++ b/pngtest.c
@@ -1112,11 +1112,11 @@
       if (png_get_tRNS(read_ptr, read_info_ptr, &trans, &num_trans,
          &trans_values))
       {
-         int sample_max = (1 << read_info_ptr->bit_depth);
+         int sample_max = (1 << bit_depth);
          /* libpng doesn't reject a tRNS chunk with out-of-range samples */
-         if (!((read_info_ptr->color_type == PNG_COLOR_TYPE_GRAY &&
+         if (!((color_type == PNG_COLOR_TYPE_GRAY &&
              (int)trans_values->gray > sample_max) ||
-             (read_info_ptr->color_type == PNG_COLOR_TYPE_RGB &&
+             (color_type == PNG_COLOR_TYPE_RGB &&
              ((int)trans_values->red > sample_max ||
              (int)trans_values->green > sample_max ||
              (int)trans_values->blue > sample_max))))