From 35cb833a4f69d8f4875a02b3047d0dc9cc0776a0 Mon Sep 17 00:00:00 2001 From: dirk Date: Mon, 22 Dec 2014 23:49:40 +0000 Subject: [PATCH] Improved performance of ReadProfile. --- coders/tiff.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) 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); -- 2.40.0