From: Dirk Lemstra Date: Fri, 16 Mar 2018 12:31:02 +0000 (+0100) Subject: Added check for ListLengthResource to the pcd coder. X-Git-Tag: 7.0.7-27~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78652ba170cd0b4857d62bff0cb358703370b9d9;p=imagemagick Added check for ListLengthResource to the pcd coder. --- diff --git a/coders/pcd.c b/coders/pcd.c index da8534859..f361ac1f2 100644 --- a/coders/pcd.c +++ b/coders/pcd.c @@ -64,6 +64,7 @@ #include "MagickCore/montage.h" #include "MagickCore/pixel-accessor.h" #include "MagickCore/resize.h" +#include "MagickCore/resource_.h" #include "MagickCore/quantum-private.h" #include "MagickCore/static.h" #include "MagickCore/string_.h" @@ -553,6 +554,8 @@ static Image *ReadPCDImage(const ImageInfo *image_info,ExceptionInfo *exception) header=(unsigned char *) RelinquishMagickMemory(header); if (number_images > 65535) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); + if (AcquireMagickResource(ListLengthResource,number_images) == MagickFalse) + ThrowReaderException(ResourceLimitError,"ListLengthExceedsLimit"); /* Determine resolution by scene specification. */