83bc7c
--- libwmf-0.2.8.4/src/extra/gd/gd_png.c	1 Apr 2007 20:41:01 -0000	1.21.2.1
83bc7c
+++ libwmf-0.2.8.4/src/extra/gd/gd_png.c	16 May 2007 19:06:11 -0000
83bc7c
@@ -78,8 +78,11 @@
83bc7c
 gdPngReadData (png_structp png_ptr,
83bc7c
 	       png_bytep data, png_size_t length)
83bc7c
 {
83bc7c
-  gdGetBuf (data, length, (gdIOCtx *)
83bc7c
-	    png_get_io_ptr (png_ptr));
83bc7c
+  int check;
83bc7c
+  check = gdGetBuf (data, length, (gdIOCtx *) png_get_io_ptr (png_ptr));
83bc7c
+  if (check != length) {
83bc7c
+    png_error(png_ptr, "Read Error: truncated data");
83bc7c
+  }
83bc7c
 }
83bc7c
 
83bc7c
 static void