From 78652ba170cd0b4857d62bff0cb358703370b9d9 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Fri, 16 Mar 2018 13:31:02 +0100 Subject: [PATCH] Added check for ListLengthResource to the pcd coder. --- coders/pcd.c | 3 +++ 1 file changed, 3 insertions(+) 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. */ -- 2.40.0