if (base_file)
g_object_unref (base_file);
g_object_unref (input_stream);
- if (err) goto rsvg_error;
+
+ /* Check rsvg_handle too, to avoid librsvg 2.40.13 bug (Bug#36773#26). */
+ if (!rsvg_handle || err) goto rsvg_error;
#else
/* Make a handle to a new rsvg object. */
rsvg_handle = rsvg_handle_new ();
+ eassume (rsvg_handle);
/* Set base_uri for properly handling referenced images (via 'href').
See rsvg bug 596114 - "image refs are relative to curdir, not .svg file"
return 1;
rsvg_error:
- g_object_unref (rsvg_handle);
+ if (rsvg_handle)
+ g_object_unref (rsvg_handle);
/* FIXME: Use error->message so the user knows what is the actual
problem with the image. */
image_error ("Error parsing SVG image `%s'", img->spec);