Segfault with statc build on Win32
Submitted by Christoph Bauer
Assigned to Carl Worth @cworth
Description
Hi,
I took from the FAQ this program:
#include <cairo.h>
int
main (int argc, char *argv[]) {
cairo_surface_t *surface;
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 200, 100);
cairo_t *cr;
cr = cairo_create (surface);
cairo_select_font_face (cr, "Serif", CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 32.0);
cairo_set_source_rgba (cr, 0.0, 0.3, 1.0, 1.0);
cairo_move_to (cr, 10.0, 50.0);
cairo_show_text (cr, "Hello World");
cairo_destroy (cr);
cairo_surface_write_to_png (surface, "hw.png");
cairo_surface_destroy (surface);
return 0;
}
and get with the latest CVS cairo this:
Program received signal SIGSEGV, Segmentation fault.
0x7788f281 in ?? ()
(gdb) where
#0 0x7788f281 in ?? ()
#1 0x77887f26 in ?? ()
#2 0x004145c7 in _cairo_toy_font_face_create (family=0x437000 "Serif",
slant=CAIRO_FONT_SLANT_NORMAL, weight=CAIRO_FONT_WEIGHT_BOLD)
at ../../src/cairo-font.c:336
#3 0x00412c80 in _cairo_gstate_select_font_face (gstate=0xa12d50,
family=0x437000 "Serif", slant=CAIRO_FONT_SLANT_NORMAL,
weight=CAIRO_FONT_WEIGHT_BOLD) at ../../src/cairo-gstate.c:1683
#4 0x004059a7 in cairo_select_font_face (cr=0xa12be8,
family=0x437000 "Serif", slant=CAIRO_FONT_SLANT_NORMAL,
weight=CAIRO_FONT_WEIGHT_BOLD) at ../../src/cairo.c:1805
#5 0x0040135a in main (argc=1, argv=0xa14f48) at hw.c:8
regards, Christoph Bauer
Version: 1.0.3