From b8f7fb6d20758372cd91773377bb1b8aa862ad7f Mon Sep 17 00:00:00 2001 From: DarthSim Date: Wed, 9 Jun 2021 17:41:37 +0600 Subject: [PATCH] Delete Cairo context on rsvg_handle_render_cairo error --- libvips/foreign/svgload.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libvips/foreign/svgload.c b/libvips/foreign/svgload.c index 1afd435c..765fa409 100644 --- a/libvips/foreign/svgload.c +++ b/libvips/foreign/svgload.c @@ -340,6 +340,7 @@ vips_foreign_load_svg_generate( VipsRegion *or, * running inside a non-threaded tilecache. */ if( !rsvg_handle_render_cairo( svg->page, cr ) ) { + cairo_destroy( cr ); vips_operation_invalidate( VIPS_OPERATION( svg ) ); vips_error( class->nickname, "%s", _( "SVG rendering failed" ) );