File ImageMagick-CVE-2023-1289.patch of Package ImageMagick.30356

Index: ImageMagick-7.0.7-34/MagickCore/draw.c
===================================================================
--- ImageMagick-7.0.7-34.orig/MagickCore/draw.c
+++ ImageMagick-7.0.7-34/MagickCore/draw.c
@@ -5185,8 +5185,22 @@ MagickExport MagickBooleanType DrawPrimi
           exception);
       else
         {
+          const MagickInfo
+            *magick_info;
+
           (void) CopyMagickString(clone_info->filename,primitive_info->text,
             MagickPathExtent);
+	  (void) SetImageInfo(clone_info,1,exception);
+          magick_info=GetMagickInfo(clone_info->magick,exception);
+          if ((magick_info != (const MagickInfo*) NULL) &&
+              (LocaleCompare(magick_info->module,"SVG") == 0))
+            {
+              (void) ThrowMagickException(exception,GetMagickModule(),
+                CorruptImageError,"ImageTypeNotSupported","`%s'",
+		clone_info->filename);
+	      clone_info=DestroyImageInfo(clone_info);
+	      break;
+	    }
           composite_image=ReadImage(clone_info,exception);
         }
       clone_info=DestroyImageInfo(clone_info);
openSUSE Build Service is sponsored by