[cairo-bugs] [Bug 11855] Segfault with cairo_pattern_set_user_data

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Aug 6 11:11:10 PDT 2007


cworth at cworth.org changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

------- Comment #4 from cworth at cworth.org  2007-08-06 11:10 PST -------
(In reply to comment #3)
> If we are copying the pattern we probably should not copy the user-data array,
> right?

Indeed not. Here's a patch (that I just pushed). And no, I will not be bothered
to make any bugzilla attachments. :-)


commit 13cae8b5e6d3fc93c4eb1853b91ba356b572b551
Author: Carl Worth <cworth at cworth.org>
Date:   Mon Aug 6 11:06:47 2007 -0700

    Ensure that a copied pattern gets its own user_data array

    This fixes the bug reported here:

        Segfault with cairo_pattern_set_user_data

diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 24efa34..2fd1c87 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -185,7 +185,9 @@ _cairo_pattern_init_copy (cairo_pattern_t   *pattern,
     } break;

+    /* The reference count and user_data array are unique to the copy. */
     pattern->ref_count = 1;
+    _cairo_user_data_array_init (&pattern->user_data);


Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the cairo-bugs mailing list