From 60a7b63db734d2da0318df3d5a7a7388c1f602a7 Mon Sep 17 00:00:00 2001 From: Cristy Date: Mon, 6 Mar 2017 07:23:36 -0500 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/393 --- MagickCore/resource.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/MagickCore/resource.c b/MagickCore/resource.c index 700c57c10..40c5593fb 100644 --- a/MagickCore/resource.c +++ b/MagickCore/resource.c @@ -1314,8 +1314,9 @@ MagickExport MagickBooleanType SetMagickResourceLimit(const ResourceType type, 100.0)); if (resource_info.thread_limit > GetOpenMPMaximumThreads()) resource_info.thread_limit=GetOpenMPMaximumThreads(); - else if (resource_info.thread_limit == 0) - resource_info.thread_limit=1; + else + if (resource_info.thread_limit == 0) + resource_info.thread_limit=1; break; } case ThrottleResource: @@ -1323,10 +1324,8 @@ MagickExport MagickBooleanType SetMagickResourceLimit(const ResourceType type, resource_info.throttle_limit=limit; value=GetPolicyValue("throttle"); if (value != (char *) NULL) - resource_info.throttle_limit=MagickMin(limit,StringToSizeType(value, + resource_info.throttle_limit=MagickMax(limit,StringToSizeType(value, 100.0)); - if (resource_info.throttle_limit > GetOpenMPMaximumThreads()) - resource_info.throttle_limit=GetOpenMPMaximumThreads(); break; } case TimeResource: -- 2.40.0