From: Cristy Date: Sat, 10 Feb 2018 21:04:40 +0000 (-0500) Subject: ... X-Git-Tag: 7.0.7-23~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b40fec1c5e79b1fd9b06005b5c8e0c7b6d591cab;p=imagemagick ... --- diff --git a/coders/dcm.c b/coders/dcm.c index 3612c4585..6df86da95 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -3470,7 +3470,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (datum > 8) info.bytes_per_pixel=2; info.depth=info.bits_allocated; - if (info.depth > 32) + if ((info.depth == 0) || (info.depth > 32)) ThrowDCMException(CorruptImageError,"ImproperImageHeader"); info.max_value=(1UL << info.bits_allocated)-1; image->depth=info.depth; @@ -3486,7 +3486,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (info.significant_bits > 8) info.bytes_per_pixel=2; info.depth=info.significant_bits; - if (info.depth > 32) + if ((info.depth == 0) || (info.depth > 32)) ThrowDCMException(CorruptImageError,"ImproperImageHeader"); info.max_value=(1UL << info.significant_bits)-1; info.mask=(size_t) GetQuantumRange(info.significant_bits);