Delete Cairo context on rsvg_handle_render_cairo error

This commit is contained in:
DarthSim 2021-06-09 17:41:37 +06:00
parent 8d5af9fe8a
commit b8f7fb6d20

View File

@ -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" ) );