From: Cristy Date: Mon, 22 Jan 2018 13:05:42 +0000 (-0500) Subject: Eliminate undefined-shift X-Git-Tag: 7.0.7-22~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe43306c43cd28fcab948f67c7bb89af3a011cbe;p=imagemagick Eliminate undefined-shift Credit OSS Fuzz --- diff --git a/coders/dpx.c b/coders/dpx.c index 6c73c3d4a..6bb57222a 100644 --- a/coders/dpx.c +++ b/coders/dpx.c @@ -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;