]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <mikayla-grace@urban-warrior.org>
Mon, 11 Mar 2019 11:28:14 +0000 (07:28 -0400)
committerCristy <mikayla-grace@urban-warrior.org>
Mon, 11 Mar 2019 11:28:14 +0000 (07:28 -0400)
MagickCore/resource.c
MagickCore/resource_.h

index 3c3635862a63943830aef2cb022c1eaca22e49e2..2bf9e39e4b57df09892f80f9cdc9a5c0ef07118a 100644 (file)
@@ -203,6 +203,7 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type,
   if (request < 0)
     return(MagickFalse);
   limit=0;
+  current=0;
   bi=MagickFalse;
   status=MagickFalse;
   if (resource_semaphore[type] == (SemaphoreInfo *) NULL)
@@ -831,6 +832,7 @@ MagickExport MagickBooleanType ListMagickResourceInfo(FILE *file,
     area_limit[MagickFormatExtent],
     disk_limit[MagickFormatExtent],
     height_limit[MagickFormatExtent],
+    list_length_limit[MagickFormatExtent],
     map_limit[MagickFormatExtent],
     memory_limit[MagickFormatExtent],
     time_limit[MagickFormatExtent],
@@ -853,6 +855,10 @@ MagickExport MagickBooleanType ListMagickResourceInfo(FILE *file,
     MagickFormatExtent,memory_limit);
   (void) FormatMagickSize(resource_info.map_limit,MagickTrue,"B",
     MagickFormatExtent,map_limit);
+  (void) CopyMagickString(list_length_limit,"unlimited",MagickFormatExtent);
+  if (resource_info.list_length_limit != MagickResourceInfinity)
+    (void) FormatMagickSize(resource_info.list_length_limit,MagickTrue,"B",
+      MagickFormatExtent,list_length_limit);
   (void) CopyMagickString(disk_limit,"unlimited",MagickFormatExtent);
   if (resource_info.disk_limit != MagickResourceInfinity)
     (void) FormatMagickSize(resource_info.disk_limit,MagickTrue,"B",
@@ -864,9 +870,8 @@ MagickExport MagickBooleanType ListMagickResourceInfo(FILE *file,
   (void) FormatLocaleFile(file,"Resource limits:\n");
   (void) FormatLocaleFile(file,"  Width: %s\n",width_limit);
   (void) FormatLocaleFile(file,"  Height: %s\n",height_limit);
-  (void) FormatLocaleFile(file,"  List length: %.20g\n",(double)
-    ((MagickOffsetType) resource_info.list_length_limit));
   (void) FormatLocaleFile(file,"  Area: %s\n",area_limit);
+  (void) FormatLocaleFile(file,"  List length: %s\n",list_length_limit);
   (void) FormatLocaleFile(file,"  Memory: %s\n",memory_limit);
   (void) FormatLocaleFile(file,"  Map: %s\n",map_limit);
   (void) FormatLocaleFile(file,"  Disk: %s\n",disk_limit);
@@ -931,6 +936,7 @@ MagickExport void RelinquishMagickResource(const ResourceType type,
   }
   bi=MagickFalse;
   limit=0;
+  current=0;
   if (resource_semaphore[type] == (SemaphoreInfo *) NULL)
     ActivateSemaphoreInfo(&resource_semaphore[type]);
   LockSemaphoreInfo(resource_semaphore[type]);
index 593c8bd3e028555c6365ce103fb73b5f1b65a22d..4af36d5ec01204b3038a7bed6295745d7508dfb2 100644 (file)
@@ -38,7 +38,7 @@ typedef enum
   ListLengthResource
 } ResourceType;
 
-#define MagickResourceInfinity  MagickULLConstant(~0)
+#define MagickResourceInfinity  (MagickULLConstant(~0) >> 1)
 
 extern MagickExport int
   AcquireUniqueFileResource(char *);