From 3ba507cdb26a009203fdc57d57d5908e5f37670e Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Fri, 16 Mar 2018 13:30:43 +0100 Subject: [PATCH] Refactored check for ListLengthResource --- coders/dds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coders/dds.c b/coders/dds.c index 44605ef58..6148c6a6a 100644 --- a/coders/dds.c +++ b/coders/dds.c @@ -1795,8 +1795,8 @@ static Image *ReadDDSImage(const ImageInfo *image_info,ExceptionInfo *exception) if ((num_images == 0) || (num_images > GetBlobSize(image))) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); - if (GetMagickResourceLimit(ListLengthResource) < (MagickSizeType) num_images) - ThrowReaderException(ImageError,"ListLengthExceedsLimit"); + if (AcquireMagickResource(ListLengthResource,num_images) == MagickFalse) + ThrowReaderException(ResourceLimitError,"ListLengthExceedsLimit"); option=GetImageOption(image_info,"dds:skip-mipmaps"); if (IsStringFalse(option) != MagickFalse) -- 2.40.0