From b40fec1c5e79b1fd9b06005b5c8e0c7b6d591cab Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 10 Feb 2018 16:04:40 -0500 Subject: [PATCH] ... --- coders/dcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.40.0