From f978982e4b7aa8dbd38730c683f0e79a4a61d836 Mon Sep 17 00:00:00 2001 From: cristy Date: Sun, 29 Mar 2015 01:28:52 +0000 Subject: [PATCH] --- coders/dcm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coders/dcm.c b/coders/dcm.c index e0094f9a8..1f11d1596 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -3130,12 +3130,15 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (strncmp(transfer_syntax,"1.2.840.10008.1.2",17) == 0) { int + count, subtype, type; type=0; subtype=0; - (void) sscanf(transfer_syntax+17,".%d.%d",&type,&subtype); + count=sscanf(transfer_syntax+17,".%d.%d",&type,&subtype); + if (count < 1) + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); switch (type) { case 1: -- 2.40.0