]> granicus.if.org Git - imagemagick/commitdiff
Close pixel cache before time limit exceeded 7.0.7-39
authorCristy <urban-warrior@imagemagick.org>
Sun, 10 Jun 2018 23:18:29 +0000 (19:18 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 10 Jun 2018 23:18:29 +0000 (19:18 -0400)
MagickCore/cache.c

index 50d877e98ec0edddb75435bb8a708c1e1fcac762..a3d580749df4719730875d8cbc1905e376304f71 100644 (file)
@@ -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);
         }
     }