]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/471
authorCristy <urban-warrior@imagemagick.org>
Sat, 6 May 2017 17:20:18 +0000 (13:20 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 6 May 2017 17:35:46 +0000 (13:35 -0400)
coders/xwd.c

index 702370337e228d914b05952d8ad6a794f1a5b013..59e770d35abb9d5faa4c52408d9f24466cffc661 100644 (file)
@@ -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)
         {