]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix a segfault in the new svg code
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 31 Oct 2020 23:10:21 +0000 (00:10 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 31 Oct 2020 23:10:30 +0000 (00:10 +0100)
* src/image.c (svg_load_image): Don't pass in a NULL for the
logical rect, because that will sometimes segfault.

src/image.c

index 61c5aa760c79f178ccf8df7a954379d776bca9b0..c857b8e62a4ec7ff01bb60b2b7766657a33eb1fc 100644 (file)
@@ -9808,11 +9808,11 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
 
   /* Get the image dimensions.  */
 #if LIBRSVG_CHECK_VERSION (2, 46, 0)
-  RsvgRectangle zero_rect, viewbox;
+  RsvgRectangle zero_rect, viewbox, out_logical_rect;
 
   rsvg_handle_get_geometry_for_layer (rsvg_handle, NULL,
                                       &zero_rect, &viewbox,
-                                      NULL, NULL);
+                                      &out_logical_rect, NULL);
   viewbox_width = viewbox.x + viewbox.width;
   viewbox_height = viewbox.y + viewbox.height;
 #else