summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCristy <mikayla-grace@urban-warrior.org>2020-12-29 19:29:47 -0500
committerCristy <mikayla-grace@urban-warrior.org>2020-12-29 19:29:47 -0500
commit4673fa6a33408fae0e5c915ad1c8dd39f0133ebb (patch)
treef21a599502d642e631afc0b162d0f150a993d610
parent42f3458a68bf60764cef4a5e8a50161fd9f61484 (diff)
downloadImageMagick-4673fa6a33408fae0e5c915ad1c8dd39f0133ebb.tar.gz
...
-rw-r--r--MagickCore/cache.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/MagickCore/cache.c b/MagickCore/cache.c
index 176db3026..99e2568e0 100644
--- a/MagickCore/cache.c
+++ b/MagickCore/cache.c
@@ -224,8 +224,10 @@ MagickPrivate Cache AcquirePixelCache(const size_t number_threads)
cache_info->synchronize=IsStringTrue(value);
value=DestroyString(value);
}
- cache_info->width_limit=GetMagickResourceLimit(WidthResource);
- cache_info->height_limit=GetMagickResourceLimit(HeightResource);
+ cache_info->width_limit=MagickMin(GetMagickResourceLimit(WidthResource),
+ (MagickSizeType) SSIZE_MAX);
+ cache_info->height_limit=MagickMin(GetMagickResourceLimit(HeightResource),
+ (MagickSizeType) SSIZE_MAX);
cache_info->semaphore=AcquireSemaphoreInfo();
cache_info->reference_count=1;
cache_info->file_semaphore=AcquireSemaphoreInfo();
@@ -5051,8 +5053,7 @@ static Quantum *SetPixelCacheNexusPixels(
"NoPixelsDefinedInCache","`%s'",cache_info->filename);
return((Quantum *) NULL);
}
- if ((width > (size_t) SSIZE_MAX) || (height > (size_t) SSIZE_MAX) ||
- ((MagickSizeType) width > cache_info->width_limit) ||
+ if (((MagickSizeType) width > cache_info->width_limit) ||
((MagickSizeType) height > cache_info->height_limit) ||
(ValidatePixelRange(x,(ssize_t) width) == MagickFalse) ||
(ValidatePixelRange(y,(ssize_t) height) == MagickFalse))