From: dirk Date: Sat, 25 Oct 2014 12:30:45 +0000 (+0000) Subject: Fix last value in dicom_info and added missing != NULL check. X-Git-Tag: 7.0.1-0~1856 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75aa9806131328e6bf437e9bf8f1ae4b0cecbc36;p=imagemagick Fix last value in dicom_info and added missing != NULL check. --- diff --git a/coders/dcm.c b/coders/dcm.c index 35d2ac64f..af469b0b4 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -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 } }; /* @@ -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) {