From: Cristy Date: Sat, 6 May 2017 17:20:18 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/471 X-Git-Tag: 7.0.5-6~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31b842a218225cd7feddf65cbccf9d783c6cb526;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/471 --- diff --git a/coders/xwd.c b/coders/xwd.c index 702370337..59e770d35 100644 --- a/coders/xwd.c +++ b/coders/xwd.c @@ -322,6 +322,8 @@ static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception) color; length=(size_t) header.ncolors; + if (length > ((~0UL)/sizeof(*colors))) + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); colors=(XColor *) AcquireQuantumMemory(length,sizeof(*colors)); if (colors == (XColor *) NULL) {