From 16916c8979c32765c542e216b31cee2671b7afe7 Mon Sep 17 00:00:00 2001 From: Cristy Date: Mon, 27 Aug 2018 19:29:51 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1269 --- coders/dcm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coders/dcm.c b/coders/dcm.c index d44cf80d0..49a058a2d 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -3853,6 +3853,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) tag=((unsigned int) ReadBlobLSBShort(image) << 16) | ReadBlobLSBShort(image); length=(size_t) ReadBlobLSBLong(image); + if (length > (size_t) GetBlobSize(image)) + ThrowDCMException(CorruptImageError,"InsufficientImageDataInFile"); if (tag == 0xFFFEE0DD) break; /* sequence delimiter tag */ if (tag != 0xFFFEE000) -- 2.40.0