[cairo] [PATCH] fix a crash caused by finished SVG surface

Bryce W. Harrington b.harrington at samsung.com
Wed Nov 6 21:22:59 CET 2013


On Tue, Oct 29, 2013 at 09:59:05PM +0000, Bryce W. Harrington wrote:
> Looks good to me.  I can commit if no one else has any objections.
> 
> Reviewed-by: Bryce Harrington <b.harrington at samsung.com>
> On Mon, Oct 28, 2013 at 10:42:47PM +0900, Kouhei Sutou wrote:
> > Hi,
> > 
> > I attach a patch that fix a crash that is caused by finished
> > SVG surface. "cairo_create (finished_svg_surface)" is invalid
> > usage but it will be better that reporting an error instead
> > of crash.

Committed, thanks
 

> > Here is a program that reproduces this case:
> > 
> > #include <cairo.h>
> > #include <cairo-svg.h>
> > 
> > int
> > main(int argc, char **argv)
> > {
> >   cairo_t *cr;
> >   cairo_surface_t *finished_surface;
> > 
> >   finished_surface = cairo_svg_surface_create ("/tmp/xxx.svg", 1.0, 1.0);
> >   cairo_surface_finish (finished_surface);
> > 
> >   cr = cairo_create (finished_surface);
> >   cairo_destroy (cr);
> > 
> >   cairo_surface_destroy (finished_surface);
> > 
> >   return 0;
> > }
> > 
> > We can use other paginated surface such as PDF surface for
> > finished surface.
> > 
> > 
> > This case is reported at rcairo's issue:
> > https://github.com/rcairo/rcairo/issues/15
> > 
> > 
> > Thanks,
> > --
> > kou
> 
> 
> > -- 
> > cairo mailing list
> > cairo at cairographics.org
> > http://lists.cairographics.org/mailman/listinfo/cairo
> -- 
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list