From bb0bb4106656c1b099c443d307168edb7c45d49a Mon Sep 17 00:00:00 2001 From: dirk Date: Mon, 9 Nov 2015 20:22:15 +0100 Subject: [PATCH] Added support for reading DICOM images with implicit vr little-endian transfer syntax. --- coders/dcm.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/coders/dcm.c b/coders/dcm.c index 6aaa3c72e..595e31a28 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -3134,11 +3134,15 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) subtype, type; - type=0; + type=1; subtype=0; - count=sscanf(transfer_syntax+17,".%d.%d",&type,&subtype); - if (count < 1) - ThrowReaderException(CorruptImageError,"ImproperImageHeader"); + if (strlen(transfer_syntax) > 17) + { + count=sscanf(transfer_syntax+17,".%d.%d",&type,&subtype); + if (count < 1) + ThrowReaderException(CorruptImageError, + "ImproperImageHeader"); + } switch (type) { case 1: -- 2.40.0