]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/1506
authorCristy <mikayla-grace@urban-warrior.org>
Sat, 30 Mar 2019 12:10:03 +0000 (08:10 -0400)
committerCristy <mikayla-grace@urban-warrior.org>
Sat, 30 Mar 2019 12:10:03 +0000 (08:10 -0400)
ChangeLog
MagickCore/draw.c

index b8d165049e9cd6affd13081b1b61bd50ebec94b6..4f14355183b50666c7ca36e42ac4847bd81bfc11 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-03-27  7.0.8-36 Cristy  <quetzlzacatenango@image...>
+  * Fixed a number of issues (reference
+    https://github.com/ImageMagick/ImageMagick/issues).
+
 2019-03-24  7.0.8-35 Cristy  <quetzlzacatenango@image...>
   * Release ImageMagick version 7.0.8-35, GIT revision 15440:4a0a88e41:20190324
 
index 8a5d5b8581329a42afead016c6b332d7e3ef878b..e8cf327a1afa6eada5e02fa9cfcf20fed535d57f 100644 (file)
@@ -2723,8 +2723,18 @@ static MagickBooleanType RenderMVGContent(Image *image,
                 graphic_context[n]->clipping_mask=DrawClippingMask(image,
                   graphic_context[n],token,clip_path,exception);
                 if (draw_info->compliance != SVGCompliance)
-                  status&=DrawClipPath(image,graphic_context[n],
-                    graphic_context[n]->clip_mask,exception);
+                  {
+                    const char
+                      *clip_path;
+
+                    clip_path=(const char *) GetValueFromSplayTree(macros,
+                      graphic_context[n]->clip_mask);
+                    if (clip_path != (const char *) NULL)
+                      (void) SetImageArtifact(image,
+                        graphic_context[n]->clip_mask,clip_path);
+                    status&=DrawClipPath(image,graphic_context[n],
+                      graphic_context[n]->clip_mask,exception);
+                  }
               }
             break;
           }
@@ -3238,17 +3248,23 @@ static MagickBooleanType RenderMVGContent(Image *image,
               }
             if (LocaleCompare("clip-path",token) == 0)
               {
-                char
-                  name[MaxTextExtent];
-
-                const char
-                  *clip_path;
-
                 GetNextToken(q,&q,extent,token);
-                (void) FormatLocaleString(name,MaxTextExtent,"%s",token);
-                clip_path=(const char *) GetValueFromSplayTree(macros,name);
-                if (clip_path != (const char *) NULL)
-                  (void) SetImageArtifact(image,name,clip_path);
+                for (p=q; *q != '\0'; )
+                {
+                       GetNextToken(q,&q,extent,token);
+                       if (LocaleCompare(token,"pop") != 0)
+                               continue;
+                       GetNextToken(q,(const char **) NULL,extent,token);
+                       if (LocaleCompare(token,"clip-path") != 0)
+                               continue;
+                       break;
+                }
+                if ((q == (char *) NULL) || (p == (char *) NULL) || ((q-4) < p))
+                  {
+                    status=MagickFalse;
+                    break;
+                  }
+                GetNextToken(q,&q,extent,token);
                 break;
               }
             if (LocaleCompare("defs",token) == 0)
@@ -4342,8 +4358,18 @@ static MagickBooleanType RenderMVGContent(Image *image,
             (graphic_context[n]->clip_mask != (char *) NULL) &&
             (LocaleCompare(graphic_context[n]->clip_mask,
              graphic_context[n-1]->clip_mask) != 0))
-          status&=DrawClipPath(image,graphic_context[n],
-            graphic_context[n]->clip_mask,exception);
+          {
+            const char
+              *clip_path;
+
+            clip_path=(const char *) GetValueFromSplayTree(macros,
+              graphic_context[n]->clip_mask);
+            if (clip_path != (const char *) NULL)
+              (void) SetImageArtifact(image,graphic_context[n]->clip_mask,
+                clip_path);
+            status&=DrawClipPath(image,graphic_context[n],
+              graphic_context[n]->clip_mask,exception);
+          }
         status&=DrawPrimitive(image,graphic_context[n],primitive_info,
           exception);
       }
@@ -4996,10 +5022,10 @@ RestoreMSCWarning
 
 static inline double ConstrainCoordinate(double x)
 {
-  if (x < -SSIZE_MAX)
-    return(-SSIZE_MAX);
-  if (x > SSIZE_MAX)
-    return(SSIZE_MAX);
+  if (x < (double) -SSIZE_MAX)
+    return((double) -SSIZE_MAX);
+  if (x > (double) SSIZE_MAX)
+    return((double) SSIZE_MAX);
   return(x);
 }