From e88532bd4418e95b70cbc415fe911d22ab27a5fd Mon Sep 17 00:00:00 2001 From: Cristy Date: Thu, 3 Oct 2019 18:53:56 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1712 --- MagickCore/quantum-private.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MagickCore/quantum-private.h b/MagickCore/quantum-private.h index dbea5ce98..76f0a9dc0 100644 --- a/MagickCore/quantum-private.h +++ b/MagickCore/quantum-private.h @@ -324,6 +324,8 @@ static inline Quantum ScaleAnyToQuantum(const QuantumAny quantum, static inline QuantumAny ScaleQuantumToAny(const Quantum quantum, const QuantumAny range) { + if (quantum < 0) + return((QuantumAny) 0); return((QuantumAny) (((double) range*quantum)/QuantumRange+0.5)); } -- 2.40.0