diff -r -U 3 libpng-1.0.8/pngrutil.c libpng-1.0.8patch3b/pngrutil.c
--- libpng-1.0.8/pngrutil.c	Mon Jul 24 06:34:11 2000
+++ libpng-1.0.8patch3b/pngrutil.c	Fri Jul 23 21:31:14 2004
@@ -1203,7 +1203,8 @@
          /* Should be an error, but we can cope with it */
          png_warning(png_ptr, "Missing PLTE before tRNS");
       }
-      else if (length > (png_uint_32)png_ptr->num_palette)
+      if (length > (png_uint_32)png_ptr->num_palette ||
+          length > 256)
       {
          png_warning(png_ptr, "Incorrect tRNS chunk length");
          png_crc_finish(png_ptr, length);