[devel] Correct pngvalid gamma test to check each color sample, not just red.
diff --git a/pngvalid.c b/pngvalid.c
index cbba734..991ec5c 100644
--- a/pngvalid.c
+++ b/pngvalid.c
@@ -249,10 +249,13 @@
    if ((colour_type & 1) == 0) /* !palette */
    {
       if (colour_type & 2)
-         index *= 3, index += sample; /* Colour channels; select one */
+         index *= 3;
 
       if (colour_type & 4)
          index += x; /* Alpha channel */
+
+      if (colour_type & (2+4))
+         index += sample * bit_depth; /* Multiple channels: select one */
    }
 
    /* Return the sample from the row as an integer. */