emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master c6f21e2: Fix assertion on SVG load failure


From: Alan Third
Subject: master c6f21e2: Fix assertion on SVG load failure
Date: Sat, 12 Dec 2020 18:56:37 -0500 (EST)

branch: master
commit c6f21e2420202a19a590c66ecc09bf8bb277778d
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>

    Fix assertion on SVG load failure
    
    * src/image.c (svg_load_image): Move setting DPI to after rsvg_handle
    error checking.
---
 src/image.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/image.c b/src/image.c
index 6b85ab7..a3301ad 100644
--- a/src/image.c
+++ b/src/image.c
@@ -9872,8 +9872,6 @@ svg_load_image (struct frame *f, struct image *img, char 
*contents,
   rsvg_handle = rsvg_handle_new_from_stream_sync (input_stream, base_file,
                                                  RSVG_HANDLE_FLAGS_NONE,
                                                  NULL, &err);
-  rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx,
-                           FRAME_DISPLAY_INFO (f)->resy);
 
   if (base_file)
     g_object_unref (base_file);
@@ -9881,6 +9879,9 @@ svg_load_image (struct frame *f, struct image *img, char 
*contents,
 
   /* Check rsvg_handle too, to avoid librsvg 2.40.13 bug (Bug#36773#26).  */
   if (!rsvg_handle || err) goto rsvg_error;
+
+  rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx,
+                           FRAME_DISPLAY_INFO (f)->resy);
 #else
   /* Make a handle to a new rsvg object.  */
   rsvg_handle = rsvg_handle_new ();
@@ -10045,15 +10046,15 @@ svg_load_image (struct frame *f, struct image *img, 
char *contents,
                                                  RSVG_HANDLE_FLAGS_NONE,
                                                  NULL, &err);
 
-  rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx,
-                           FRAME_DISPLAY_INFO (f)->resy);
-
   if (base_file)
     g_object_unref (base_file);
   g_object_unref (input_stream);
 
   /* Check rsvg_handle too, to avoid librsvg 2.40.13 bug (Bug#36773#26).  */
   if (!rsvg_handle || err) goto rsvg_error;
+
+  rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx,
+                           FRAME_DISPLAY_INFO (f)->resy);
 #else
   /* Make a handle to a new rsvg object.  */
   rsvg_handle = rsvg_handle_new ();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]