]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5967
authorCristy <urban-warrior@imagemagick.org>
Sun, 4 Feb 2018 14:32:50 +0000 (09:32 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sun, 4 Feb 2018 14:32:50 +0000 (09:32 -0500)
MagickCore/property.c
coders/ps.c

index 8fd2e58fcc7624ca84fba7171e3b60d41ead7ec9..685eabe87c2bf1269d9d893fe0834d4ff08055ca 100644 (file)
@@ -1747,6 +1747,13 @@ static MagickBooleanType GetXMPProperty(const Image *image,const char *property)
   xmp_profile=StringInfoToString(profile);
   if (xmp_profile == (char *) NULL)
     return(MagickFalse);
+  if ((strstr(xmp_profile,"<rdf:RDF") == (char *) NULL) ||
+      (strstr(xmp_profile,"<rdf:Description") == (char *) NULL) ||
+      (strstr(xmp_profile,"<x:") == (char *) NULL))
+    {
+      xmp_profile=DestroyString(xmp_profile);
+      return(MagickFalse);
+    }
   for (p=xmp_profile; *p != '\0'; p++)
     if ((*p == '<') && (*(p+1) == 'x'))
       break;
index 82e098c3fcf733f6964e2e54d197e443a101e7ba..6d3ff00d7ce544b59073cb8cda9410e43f891b21 100644 (file)
@@ -694,7 +694,8 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
             break;
         }
         SetStringInfoLength(profile,i);
-        (void) SetImageProfile(image,"xmp",profile,exception);
+        if (EOFBlob(image) == MagickFalse)
+          (void) SetImageProfile(image,"xmp",profile,exception);
         profile=DestroyStringInfo(profile);
         continue;
       }