/* gcc `pkg-config --cflags --libs cairo-svg` -o testcase-7533 testcase-7533.c */ #include int main (void) { cairo_surface_t *surface = cairo_svg_surface_create ("bad.svg", 120, 120); cairo_t *cr = cairo_create (surface); cairo_set_source_rgb (cr, 0, 0, 0); cairo_rectangle (cr, 20, 20, 50, 50); cairo_set_line_width (cr, 10); cairo_stroke_preserve (cr); /* comment out this stroke to see the png and svg appear the same */ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba (cr, 0, 0, 0, 0); cairo_set_line_width (cr, 4); cairo_stroke (cr); cairo_surface_write_to_png(surface, "bad.png"); cairo_show_page (cr); cairo_destroy (cr); cairo_surface_destroy (surface); return 0; }