From: Dirk Lemstra Date: Fri, 16 Mar 2018 12:30:43 +0000 (+0100) Subject: Refactored check for ListLengthResource X-Git-Tag: 7.0.7-27~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ba507cdb26a009203fdc57d57d5908e5f37670e;p=imagemagick Refactored check for ListLengthResource --- 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)