Skip to content

Commit

Permalink
Fix a segfault in the new svg code
Browse files Browse the repository at this point in the history
* src/image.c (svg_load_image): Don't pass in a NULL for the
logical rect, because that will sometimes segfault.
  • Loading branch information
larsmagne committed Oct 31, 2020
1 parent 5d9e456 commit 9405cd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/image.c
Expand Up @@ -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
Expand Down

0 comments on commit 9405cd8

Please sign in to comment.