Commit 87b347c40 for imagemagick.org
commit 87b347c405480ae3bbecea3baa250fae50d612aa
Author: Dirk Lemstra <dirk@lemstra.org>
Date: Mon Nov 9 19:32:43 2026 +0100
Make sure that the magick precision is a positive value.
diff --git a/MagickCore/magick.c b/MagickCore/magick.c
index a72fd8241..bd1084a6d 100644
--- a/MagickCore/magick.c
+++ b/MagickCore/magick.c
@@ -1772,6 +1772,7 @@ MagickPrivate void ResetMagickPrecision(void)
% A negative value forces the precision to reset to a default value according
% to the environment variable "MAGICK_PRECISION", the current 'policy'
% configuration setting, or the default value of '6', in that order.
+% Nonpositive configuration values use the default precision.
%
% The format of the SetMagickPrecision method is:
%
@@ -1808,6 +1809,8 @@ MagickExport int SetMagickPrecision(const int precision)
if (limit != (char *) NULL)
{
magick_precision=StringToInteger(limit);
+ if (magick_precision <= 0)
+ magick_precision=MagickPrecision;
limit=DestroyString(limit);
}
}