]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5351
authorCristy <urban-warrior@imagemagick.org>
Sun, 4 Feb 2018 14:50:08 +0000 (09:50 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sun, 4 Feb 2018 14:50:08 +0000 (09:50 -0500)
MagickCore/quantum-private.h

index cbf301372bb570c7913c9619886bab33666686f1..ba10ed5b9e475abbde39c1ca53883698ebd66fb4 100644 (file)
@@ -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)