#include #include #define ELEM(x) sizeof(x)/sizeof(x)[0] typedef float pt_t[2]; pt_t const ring_a1[] = { {271594.47f, -985430.3f}, {194995.44f, -881359.5f}, {194996.66f, -881360.2f}, {195125.2f, -881447.44f}, {195132.5f, -881455.2f}, {195136.06f, -881459.2f}, {-881497.2f, 0.f}, {194963.28f, -881565.5f}, {194961.75f, -881562.5f}, {-984558.2f, 0.f} }; int main () { cairo_surface_t *surf; cairo_t *cr; unsigned int j; volatile char fill_stack[1024]; surf = cairo_image_surface_create (0, 256, 256); cr = cairo_create (surf); cairo_scale (cr, 0.026165329093358645, 0.026165329093358645); cairo_translate (cr, -189847.64463277906, 885127.514696734); cairo_set_line_width (cr, 927.3168650511177); for (j = 0; j < ELEM(ring_a1); j++) cairo_line_to (cr, ring_a1[j][0], ring_a1[j][1]); cairo_clip_preserve (cr); /* Apparently the bug depends on the stack's content. Using this to have * some garbage on the stack makes this test much more reliable. */ memset((void*)fill_stack, 0, sizeof(fill_stack)); cairo_stroke (cr); return 0; }