]> granicus.if.org Git - imagemagick/commitdiff
Eliminate undefined-shift
authorCristy <urban-warrior@imagemagick.org>
Mon, 22 Jan 2018 13:05:42 +0000 (08:05 -0500)
committerCristy <urban-warrior@imagemagick.org>
Mon, 22 Jan 2018 13:05:42 +0000 (08:05 -0500)
Credit OSS Fuzz

coders/dpx.c

index 6c73c3d4a2525a5246eddcf6d7563f44615c1ea9..6bb57222af06cbb85a899fcdd66a9311f93b7006 100644 (file)
@@ -1158,7 +1158,7 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
     SetPrimaryChromaticity((DPXColorimetric)
       dpx.image.image_element[n].colorimetric,&image->chromaticity);
     image->depth=dpx.image.image_element[n].bit_size;
-    if (image->depth > 32)
+    if ((image->depth == 0) || (image->depth > 32))
       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
     samples_per_pixel=1;
     quantum_type=GrayQuantum;