Bug 3044 - Segmentation fault
Summary: Segmentation fault
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: pdf backend (show other bugs)
Version: 0.9.3
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Kristian Høgsberg
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-15 21:54 UTC by Steve Chaplin
Modified: 2005-08-22 00:15 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

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.