Fix crash in the librsvg loader

This commit is contained in:
Přemysl Eric Janouch 2023-07-09 04:39:09 +02:00
parent ab75d2b61d
commit 9b99de99bb
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 3 additions and 2 deletions

View File

@ -2417,10 +2417,11 @@ load_librsvg_render_internal(FivIoRenderClosureLibrsvg *self, double scale,
cairo_surface_t *surface = fiv_io_image_to_surface_noref(image);
cairo_t *cr = cairo_create(surface);
cairo_surface_destroy(surface);
(void) rsvg_handle_render_document(self->handle, cr, &viewport, error);
gboolean success =
rsvg_handle_render_document(self->handle, cr, &viewport, error);
cairo_status_t status = cairo_status(cr);
cairo_destroy(cr);
if (error) {
if (!success) {
fiv_io_image_unref(image);
return NULL;
}