[cairo] Bug: Crash in cairo-1.9.8

cu cairouser at yahoo.com
Wed Jun 16 06:15:39 PDT 2010

The following drawing code crashes (inside pixman) when compiled against
cairo-1.9.8 (pixman versions of 0.17.14 and 0.18.2 tested). The crash
does not occur using cairo 1.9.6 (with a few patches). Tested on MacOS

It seems to be very specific - changing any coordinate value by even a
fraction will make it go away (which does not help me because my program
needs to render these exact values :) )

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <cairo.h>

int main()
   cairo_surface_t   *surf;
   cairo_t  *cr;
   double w, h, x, y;

   w = 1000;
   h = 500;
   surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h);
   cr = cairo_create(surf);

   cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);

   cairo_move_to(cr, -0.021833, 282.504471);
   cairo_line_to(cr, 0.275319, 281.015040);
   cairo_line_to(cr, -0.498660, 279.516418);

   cairo_set_source_rgba(cr, 1, 0, 0, 1);

   return 0;

More information about the cairo mailing list