]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/1615
authorCristy <urban-warrior@imagemagick.org>
Sat, 22 Jun 2019 12:24:14 +0000 (08:24 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 22 Jun 2019 12:24:14 +0000 (08:24 -0400)
MagickCore/statistic.c

index 50d56fcf77abdc0eb7a137275f6d1a2a22e80eaa..b5ed38c6174168268d040e278f6ec5d5a22e72f7 100644 (file)
@@ -163,18 +163,17 @@ static PixelChannels **AcquirePixelThreadSet(const Image *images)
 
   size_t
     columns,
-    number_threads;
+    rows;
 
-  number_threads=(size_t) GetMagickResourceLimit(ThreadResource);
-  pixels=(PixelChannels **) AcquireQuantumMemory(number_threads,
-    sizeof(*pixels));
+  rows=MagickMax(GetImageListLength(images),
+    (size_t) GetMagickResourceLimit(ThreadResource));
+  pixels=(PixelChannels **) AcquireQuantumMemory(rows,sizeof(*pixels));
   if (pixels == (PixelChannels **) NULL)
     return((PixelChannels **) NULL);
-  (void) memset(pixels,0,number_threads*sizeof(*pixels));
-  columns=images->columns;
+  columns=MaxPixelChannels;
   for (next=images; next != (Image *) NULL; next=next->next)
     columns=MagickMax(next->columns,columns);
-  for (i=0; i < (ssize_t) number_threads; i++)
+  for (i=0; i < (ssize_t) rows; i++)
   {
     register ssize_t
       j;