]> granicus.if.org Git - imagemagick/commitdiff
Fix last value in dicom_info and added missing != NULL check.
authordirk <dirk@git.imagemagick.org>
Sat, 25 Oct 2014 12:30:45 +0000 (12:30 +0000)
committerdirk <dirk@git.imagemagick.org>
Sat, 25 Oct 2014 12:30:45 +0000 (12:30 +0000)
coders/dcm.c

index 35d2ac64f6051c978c0cc8dc1f3cfc2bc3d4f821..af469b0b460ba841ca606f9ebfb828652e404fed 100644 (file)
@@ -2612,7 +2612,7 @@ static const DicomInfo
     { 0xfffe, 0xe000, "!!", "Item" },
     { 0xfffe, 0xe00d, "!!", "Item Delimitation Item" },
     { 0xfffe, 0xe0dd, "!!", "Sequence Delimitation Item" },
-    { 0xffff, 0xffff, "xs", "" }
+    { 0xffff, 0xffff, "xs", (char *) NULL }
   };
 \f
 /*
@@ -3426,17 +3426,20 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
           if ((group == (ssize_t) dicom_info[i].group) &&
               (element == (ssize_t) dicom_info[i].element))
             break;
-        attribute=AcquireString("dcm:");
-        (void) ConcatenateString(&attribute,dicom_info[i].description);
-        for (i=0; i < (ssize_t) MagickMax(length,4); i++)
-          if (isprint((int) data[i]) == MagickFalse)
-            break;
-        if ((i == (ssize_t) length) || (length > 4))
+        if (dicom_info[i].description != (char *) NULL)
           {
-            (void) SubstituteString(&attribute," ","");
-            (void) SetImageProperty(image,attribute,(char *) data,exception);
+            attribute=AcquireString("dcm:");
+            (void) ConcatenateString(&attribute,dicom_info[i].description);
+            for (i=0; i < (ssize_t) MagickMax(length,4); i++)
+              if (isprint((int) data[i]) == MagickFalse)
+                break;
+            if ((i == (ssize_t) length) || (length > 4))
+              {
+                (void) SubstituteString(&attribute," ","");
+                (void) SetImageProperty(image,attribute,(char *) data,exception);
+              }
+            attribute=DestroyString(attribute);
           }
-        attribute=DestroyString(attribute);
       }
     if (image_info->verbose != MagickFalse)
       {