Bug 3063

Summary: libpng error: Read Error
Product: cairo Reporter: Steve Chaplin <d74n5pohf9>
Component: png functionsAssignee: Carl Worth <cworth>
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:
Attachments: Here's a patch to address the problem

Description Steve Chaplin 2005-04-18 19:09:14 UTC
When /tmp/test.png is a 0 byte file the following program produces the error:
libpng error: Read Error
Aborted


#include <stdio.h>
#include <cairo.h>
#include <cairo-png.h>

#define FILENAME "/tmp/test.png" 

int
main (void)
{
    cairo_surface_t *surface;
    FILE *file;
    int width, height;

    file = fopen (FILENAME, "w");
    if (file == NULL) {
	fprintf (stderr, "Failed to open file %s for writing.\n", FILENAME);
	return 1;
    }
    surface = cairo_image_surface_create_for_png(file, &width, &height);
    return 0;
}
Comment 1 Steve Chaplin 2005-04-18 19:13:04 UTC
Created attachment 2455 [details] [review]
Here's a patch to address the problem
Comment 2 Steve Chaplin 2005-04-27 01:06:27 UTC
This problem has been fixed by the recent png changes in cvs.
Comment 3 Carl Worth 2005-08-22 17:14:39 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.