]> granicus.if.org Git - imagemagick/commitdiff
Improved performance of ReadProfile.
authordirk <dirk@git.imagemagick.org>
Mon, 22 Dec 2014 23:49:40 +0000 (23:49 +0000)
committerdirk <dirk@git.imagemagick.org>
Mon, 22 Dec 2014 23:49:40 +0000 (23:49 +0000)
coders/tiff.c

index b675e3ae7ddd10ada63de5b3fde9adec5562c52d..792d0a8b9a522002fcd3cca4fcbfd839a1d2dbb3 100644 (file)
@@ -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);