From: Cristy Date: Sat, 30 Sep 2017 14:51:10 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/821 X-Git-Tag: 7.0.7-5~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d6e7a8151d7166246be4766900309d1ca6e6154;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/821 --- diff --git a/MagickCore/xwindow.c b/MagickCore/xwindow.c index 92b88c4ce..dc75ec89e 100644 --- a/MagickCore/xwindow.c +++ b/MagickCore/xwindow.c @@ -2160,20 +2160,12 @@ static void XDitherImage(Image *image,XImage *ximage,ExceptionInfo *exception) for (i=0; i < 2; i++) for (j=0; j < 16; j++) { - red_map[i][j]=(unsigned char *) AcquireQuantumMemory(256UL, + red_map[i][j]=(unsigned char *) AcquireCriticalMemory(256UL* sizeof(*red_map)); - green_map[i][j]=(unsigned char *) AcquireQuantumMemory(256UL, + green_map[i][j]=(unsigned char *) AcquireCriticalMemory(256UL* sizeof(*green_map)); - blue_map[i][j]=(unsigned char *) AcquireQuantumMemory(256UL, + blue_map[i][j]=(unsigned char *) AcquireCriticalMemory(256UL* sizeof(*blue_map)); - if ((red_map[i][j] == (unsigned char *) NULL) || - (green_map[i][j] == (unsigned char *) NULL) || - (blue_map[i][j] == (unsigned char *) NULL)) - { - ThrowXWindowException(ResourceLimitError,"MemoryAllocationFailed", - image->filename); - return; - } } /* Initialize dither tables.