From 5c0ccfb94abb5ec30c7c6e255833557580230f7b Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sun, 8 Jul 2018 22:13:59 +0200 Subject: [PATCH] Only set image extent when not pinging. --- coders/svg.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/coders/svg.c b/coders/svg.c index 482989b86..fa52f93ee 100644 --- a/coders/svg.c +++ b/coders/svg.c @@ -228,7 +228,8 @@ static MagickBooleanType IsSVG(const unsigned char *magick,const size_t length) return(MagickTrue); return(MagickFalse); } - + + #if defined(MAGICKCORE_XML_DELEGATE) /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -3287,22 +3288,24 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) image->rows=gdk_pixbuf_get_height(pixel_buffer); #endif image->alpha_trait=BlendPixelTrait; - status=SetImageExtent(image,image->columns,image->rows,exception); - if (status == MagickFalse) - { -#if !defined(MAGICKCORE_CAIRO_DELEGATE) - g_object_unref(G_OBJECT(pixel_buffer)); -#endif - g_object_unref(svg_handle); - ThrowReaderException(MissingDelegateError, - "NoDecodeDelegateForThisImageFormat"); - } if (image_info->ping == MagickFalse) { #if defined(MAGICKCORE_CAIRO_DELEGATE) size_t stride; +#endif + status=SetImageExtent(image,image->columns,image->rows,exception); + if (status == MagickFalse) + { +#if !defined(MAGICKCORE_CAIRO_DELEGATE) + g_object_unref(G_OBJECT(pixel_buffer)); +#endif + g_object_unref(svg_handle); + ThrowReaderException(MissingDelegateError, + "NoDecodeDelegateForThisImageFormat"); + } +#if defined(MAGICKCORE_CAIRO_DELEGATE) stride=4*image->columns; #if defined(MAGICKCORE_PANGOCAIRO_DELEGATE) stride=(size_t) cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, -- 2.40.0