From abd9cacc098c759e0d4512c520db97444d2075aa Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 4 Feb 2018 09:50:08 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5351 --- MagickCore/quantum-private.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MagickCore/quantum-private.h b/MagickCore/quantum-private.h index cbf301372..ba10ed5b9 100644 --- a/MagickCore/quantum-private.h +++ b/MagickCore/quantum-private.h @@ -95,7 +95,8 @@ static inline MagickSizeType GetQuantumRange(const size_t depth) one; one=1; - return((MagickSizeType) ((one << (depth-1))+((one << (depth-1))-1))); + return((MagickSizeType) ((one << (MagickMax(depth,64)-1))+ + ((one << (MagickMax(depth,64)-1))-1))); } static inline float HalfToSinglePrecision(const unsigned short half) -- 2.40.0