From 7163b3eedc87d5fee898b3459db2e05ed9eb6764 Mon Sep 17 00:00:00 2001 From: cristy Date: Sat, 24 May 2014 22:18:20 +0000 Subject: [PATCH] --- coders/pcx.c | 2 ++ coders/pict.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/coders/pcx.c b/coders/pcx.c index b27cf961a..cf262dd86 100644 --- a/coders/pcx.c +++ b/coders/pcx.c @@ -364,6 +364,8 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) count=ReadBlob(image,3*image->colors,pcx_colormap); pcx_info.reserved=(unsigned char) ReadBlobByte(image); pcx_info.planes=(unsigned char) ReadBlobByte(image); + if ((pcx_info.bits_per_pixel*pcx_info.planes) >= 64) + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); one=1; if ((pcx_info.bits_per_pixel != 8) || (pcx_info.planes == 1)) if ((pcx_info.version == 3) || (pcx_info.version == 5) || diff --git a/coders/pict.c b/coders/pict.c index 01240cdc8..26b879397 100644 --- a/coders/pict.c +++ b/coders/pict.c @@ -1335,6 +1335,8 @@ static Image *ReadPICTImage(const ImageInfo *image_info, /* Skip to next op code. */ + if (code < 0) + break; if (codes[code].length == -1) (void) ReadBlobMSBShort(image); else -- 2.40.0