From 8d6e7a8151d7166246be4766900309d1ca6e6154 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 30 Sep 2017 10:51:10 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/821 --- MagickCore/xwindow.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) 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. -- 2.40.0