commit 13f0fa72c214de40c16d1b810f881619af99b4b8
Author: Nils Philippsen <nils@redhat.com>
Date:   Tue Dec 1 15:31:52 2009 +0100

    PCX: sanitize input data
    
    Harden PCX plugin against bad width, height.

diff --git a/plug-ins/common/file-pcx.c b/plug-ins/common/file-pcx.c
index 72d4b3e..e028bd2 100644
--- a/plug-ins/common/file-pcx.c
+++ b/plug-ins/common/file-pcx.c
@@ -405,6 +405,13 @@ load_image (const gchar  *filename,
       return -1;
     }
 
+  /* Shield against potential buffer overflows in load_*() functions. */
+  if (G_MAXSIZE / width / height < 3)
+    {
+      g_message (_("Image dimensions too large: width %d x height %d"), width, height);
+      return -1;
+    }
+
   if (pcx_header.planes == 3 && pcx_header.bpp == 8)
     {
       image= gimp_image_new (width, height, GIMP_RGB);
