Commit c0a724bbb for imagemagick.org
commit c0a724bbbd2c131ca6e2b79e67cd245e5150a19a
Author: Cristy <urban-warrior@imagemagick.org>
Date: Wed Jun 17 20:09:00 2026 -0400
https://github.com/ImageMagick/ImageMagick/issues/8803
diff --git a/coders/svg.c b/coders/svg.c
index c7f39f52d..d63bff446 100644
--- a/coders/svg.c
+++ b/coders/svg.c
@@ -2698,7 +2698,7 @@ static void SVGEndElement(void *context,const xmlChar *name)
thread_filename[MagickPathExtent];
Image
- *image;
+ *image = (Image *) NULL;
ImageInfo
*image_info = AcquireImageInfo();
@@ -2721,7 +2721,21 @@ static void SVGEndElement(void *context,const xmlChar *name)
(void *) 1);
(void) CopyMagickString(image_info->filename,svg_info->url,
MagickPathExtent);
- image=ReadImage(image_info,svg_info->exception);
+ if (LocaleNCompare(image_info->filename,"data:",5) == 0)
+ image=ReadInlineImage(image_info,svg_info->url,svg_info->exception);
+ else
+ {
+ char
+ magic[MagickPathExtent] = { '\0' };
+
+ GetPathComponent(image_info->filename,MagickPath,magic);
+ if (*magic == '\0')
+ image=ReadImage(image_info,svg_info->exception);
+ else
+ (void) ThrowMagickException(svg_info->exception,
+ GetMagickModule(),FileOpenError,"UnableToOpenFile","`%s'",
+ image_info->filename);
+ }
image_info=DestroyImageInfo(image_info);
if (image != (Image *) NULL)
image=DestroyImage(image);