From: Cristy Date: Thu, 18 Apr 2019 11:11:40 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.8-41~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dabba008c570fd2fc25d6f990e65d0db28c663c7;p=imagemagick ... --- diff --git a/coders/xwd.c b/coders/xwd.c index b6f26ec7b..236fbdb5a 100644 --- a/coders/xwd.c +++ b/coders/xwd.c @@ -387,10 +387,8 @@ static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception) XWDColor color; - length=(size_t) header.ncolors; - if (length > ((~0UL)/sizeof(*colors))) - ThrowReaderException(CorruptImageError,"ImproperImageHeader"); - colors=(XColor *) AcquireQuantumMemory(length,sizeof(*colors)); + colors=(XColor *) AcquireQuantumMemory((size_t) header.ncolors, + sizeof(*colors)); if (colors == (XColor *) NULL) { ximage=(XImage *) RelinquishMagickMemory(ximage);