[cairo] Crash when redirecting gstate

Carl Worth cworth at cworth.org
Thu Oct 19 15:51:34 PDT 2006


On Fri, 25 Aug 2006 15:52:31 +0200, "=?ISO-8859-1?Q?Mikl=F3s_Erd=E9lyi?=" wrote:
> I noticed that in certain cases Cairo crashed when drawing an SVG file
> with Inkscape (usually one using masks and multiple layers so there
> are calls to cairo_push_group/pop_group).
...
> This can be corrected with the attached patch. It's strange though it
> hasn't surfaced yet. Or may I be missing something?

I also thought it was strange that this bug hadn't surfaced yet.

I'm sorry I hadn't replied any sooner, but the reason I hadn't just
pushed out this one-liner fix is that the fact that it hadn't surfaced
pointed out a serious hole in our test suite coverage. I've fixed that
now with a simple clip-push-group test that does as follows:

    cairo_arc (cr,
               SIZE / 2, SIZE / 2,
               SIZE / 2 - PAD,
               0, 2 * M_PI);
    cairo_clip (cr);

    cairo_push_group (cr);
    cairo_set_source_rgb (cr, 0, 0, 1); /* blue */
    cairo_paint (cr);
    cairo_pop_group_to_source (cr);
    cairo_paint (cr);

It tickles the bug and I've also now pushed out a fix for the bug, (it
recently became more than a one-liner bug, and it's embarrassing I
didn't notice/fix the problem when the recent patch expanded it).

Here's the commit with the fix:

http://gitweb.freedesktop.org/?p=cairo;a=commit;h=b1944e1672ee6faa034dba4d8cf730886c35e848

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20061019/1e2a7fc1/attachment.pgp


More information about the cairo mailing list