]> granicus.if.org Git - imagemagick/commitdiff
Added support for reading DICOM images with implicit vr little-endian transfer syntax.
authordirk <dirk@git.imagemagick.org>
Mon, 9 Nov 2015 19:22:15 +0000 (20:22 +0100)
committerdirk <dirk@git.imagemagick.org>
Mon, 9 Nov 2015 19:22:15 +0000 (20:22 +0100)
coders/dcm.c

index 6aaa3c72ea893ecdef3a6cb4948169fdc3e5bbae..595e31a285d3ea66f0385920f1dcfd2b93a86e2b 100644 (file)
@@ -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: