]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <mikayla-grace@urban-warrior.org>
Thu, 18 Apr 2019 11:11:40 +0000 (07:11 -0400)
committerCristy <mikayla-grace@urban-warrior.org>
Thu, 18 Apr 2019 11:11:40 +0000 (07:11 -0400)
coders/xwd.c

index b6f26ec7b84f524501c56d3454bf8e696a90e517..236fbdb5ab574204f0248bec596fbbe26f9e069b 100644 (file)
@@ -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);