Bug 3044

Summary: Segmentation fault
Product: cairo Reporter: Steve Chaplin <d74n5pohf9>
Component: pdf backendAssignee: Kristian Høgsberg <krh>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: high CC: jwatt
Version: 0.9.3   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Steve Chaplin 2005-04-15 21:54:41 UTC
This short program gives a Segmentation fault

// gcc `pkg-config --cflags --libs cairo` pdf-test.c -o pdf-test

#include <cairo.h>
#include <cairo-pdf.h>

#define X_INCHES 2
#define Y_INCHES 2
#define X_PPI    300.0
#define Y_PPI    300.0

#define WIDTH    X_INCHES * 96.0
#define HEIGHT   Y_INCHES * 96.0

#define FILENAME "/tmp/test.pdf" 

int
main (void)
{
    cairo_t *cr;
    cairo_surface_t *surface;
    FILE *file;

    file = fopen (FILENAME, "w");
    if (file == NULL) {
	fprintf (stderr, "Failed to open file %s for writing.\n", FILENAME);
	return 1;
    }
    cr = cairo_create ();
    surface = cairo_pdf_surface_create (file, X_INCHES, Y_INCHES, X_PPI, Y_PPI);
    cairo_set_target_surface (cr, surface);
    cairo_save(cr);
    cairo_restore(cr);
    return 0;
}
Comment 1 Kristian Høgsberg 2005-04-22 10:37:20 UTC
I committed a fix yesterday, could you try out the latest cvs and see if that helps?
Comment 2 Steve Chaplin 2005-04-27 00:38:11 UTC
I checked with today's cvs and the seg fault no longer occurs, thanks.
Comment 3 Carl Worth 2005-08-22 17:15:01 UTC
Move bugs against "cvs" version to "0.9.3" so we can remove the "cvs" version.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.