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;