From: Cristy Date: Sun, 10 Jun 2018 23:18:29 +0000 (-0400) Subject: Close pixel cache before time limit exceeded X-Git-Tag: 7.0.7-39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cc962acde80b4589f8c2105440c2209d9f000ba0;p=imagemagick Close pixel cache before time limit exceeded --- diff --git a/MagickCore/cache.c b/MagickCore/cache.c index 50d877e98..a3d580749 100644 --- a/MagickCore/cache.c +++ b/MagickCore/cache.c @@ -1700,6 +1700,9 @@ static Cache GetImagePixelCache(Image *image,const MagickBooleanType clone, #if defined(ECANCELED) errno=ECANCELED; #endif + cache_info=(CacheInfo *) image->cache; + if (cache_info->file != -1) + (void) ClosePixelCacheOnDisk(cache_info); ThrowFatalException(ResourceLimitFatalError,"TimeLimitExceeded"); } LockSemaphoreInfo(image->semaphore); @@ -1760,7 +1763,7 @@ static Cache GetImagePixelCache(Image *image,const MagickBooleanType clone, { status=OpenPixelCache(image,IOMode,exception); cache_info=(CacheInfo *) image->cache; - if (cache_info->type == DiskCache) + if (cache_info->file != -1) (void) ClosePixelCacheOnDisk(cache_info); } }