From: Cristy Date: Tue, 17 May 2016 19:07:13 +0000 (-0400) Subject: https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=29710 X-Git-Tag: 7.0.1-5~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13db820f5e24cd993ee554e99377fea02a904e18;p=imagemagick https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=29710 --- diff --git a/coders/rle.c b/coders/rle.c index f03e2cd2e..59e241194 100644 --- a/coders/rle.c +++ b/coders/rle.c @@ -316,10 +316,11 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) number_planes_filled)) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); pixel_info=AcquireVirtualMemory(image->columns,image->rows* - number_planes_filled*sizeof(*pixels)); + MagickMax(number_planes_filled,4)*sizeof(*pixels)); if (pixel_info == (MemoryInfo *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); - pixel_info_length=image->columns*image->rows*number_planes_filled; + pixel_info_length=image->columns*image->rows* + MagickMax(number_planes_filled,4); pixels=(unsigned char *) GetVirtualMemoryBlob(pixel_info); if ((flags & 0x01) && !(flags & 0x02)) {