From: dirk Date: Mon, 22 Dec 2014 23:49:40 +0000 (+0000) Subject: Improved performance of ReadProfile. X-Git-Tag: 7.0.1-0~1568 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35cb833a4f69d8f4875a02b3047d0dc9cc0776a0;p=imagemagick Improved performance of ReadProfile. --- diff --git a/coders/tiff.c b/coders/tiff.c index b675e3ae7..792d0a8b9 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -519,28 +519,17 @@ static MagickBooleanType ReadProfile(Image *image,const char *name, MagickBooleanType status; - register ssize_t - i; - StringInfo *profile; if (length < 4) return(MagickFalse); - i=0; if ((LocaleCompare(name,"icc") != 0) && (LocaleCompare(name,"xmp") != 0)) { - for (i=0; i < (length-4); i+=2) - if (LocaleNCompare((char *) (datum+i),"8BIM",4) == 0) - break; - if (i == length) - length-=i; - else - i=0; - if (length < 4) + if (strstr((char *)datum,"8BIM") == (CHAR *) NULL) return(MagickFalse); } - profile=BlobToStringInfo(datum+i,(size_t) length); + profile=BlobToStringInfo(datum,(size_t) length); if (profile == (StringInfo *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename);