From: Cristy Date: Sun, 4 Feb 2018 14:50:08 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5351 X-Git-Tag: 7.0.7-23~147 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=abd9cacc098c759e0d4512c520db97444d2075aa;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5351 --- 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)