]> granicus.if.org Git - imagemagick/commitdiff
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=30591
authorCristy <urban-warrior@imagemagick.org>
Tue, 4 Oct 2016 16:18:47 +0000 (12:18 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 4 Oct 2016 16:18:47 +0000 (12:18 -0400)
coders/svg.c

index 4da94931f56c57c8eab900b8534c638f378505f2..03e94894b72119a04261c5c209989827681eb741 100644 (file)
@@ -2988,8 +2988,10 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
             if ((image->columns != 0) || (image->rows != 0))
               {
                 rsvg_handle_get_dimensions(svg_handle,&dimension_info);
-                image->resolution.x=90.0*image->columns/dimension_info.width;
-                image->resolution.y=90.0*image->rows/dimension_info.height;
+                if (dimension_info.width != 0)
+                  image->resolution.x=90.0*image->columns/dimension_info.width;
+                if (dimension_info.height != 0)
+                  image->resolution.y=90.0*image->rows/dimension_info.height;
                 if (image->resolution.x == 0)
                   image->resolution.x=image->resolution.y;
                 else if (image->resolution.y == 0)