Ensure that a copied pattern gets its own user_data array

This fixes the bug reported here:

	Segfault with cairo_pattern_set_user_data
	https://bugs.freedesktop.org/show_bug.cgi?id=11855
This commit is contained in:
Carl Worth 2007-08-06 11:06:47 -07:00
parent 027915717d
commit 13cae8b5e6

View file

@ -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);
return CAIRO_STATUS_SUCCESS;
}