From dabba008c570fd2fc25d6f990e65d0db28c663c7 Mon Sep 17 00:00:00 2001 From: Cristy Date: Thu, 18 Apr 2019 07:11:40 -0400 Subject: [PATCH] ... --- coders/xwd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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); -- 2.50.1