File ImageMagick-6.2.8-CVE-2008-1097.patch of Package ImageMagick

--- ImageMagick-6.2.8.orig/coders/pcx.c	2006-01-26 05:31:38.000000000 +1000
+++ ImageMagick-6.2.8/coders/pcx.c	2008-02-07 14:53:01.000000000 +1000
@@ -314,6 +314,9 @@ static Image *ReadPCXImage(const ImageIn
     image->columns=(pcx_info.right-pcx_info.left)+1;
     image->rows=(pcx_info.bottom-pcx_info.top)+1;
     image->depth=pcx_info.bits_per_pixel <= 8 ? 8 : QuantumDepth;
+    if ((image->columns == 0) || (image->rows == 0) ||
+	(pcx_info.bits_per_pixel == 0))
+      ThrowReaderException(CorruptImageError,"ImproperImageHeader");
     image->units=PixelsPerInchResolution;
     image->x_resolution=pcx_info.horizontal_resolution;
     image->y_resolution=pcx_info.vertical_resolution;