Bug 3063 - libpng error: Read Error
Summary: libpng error: Read Error
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: png functions (show other bugs)
Version: 0.9.3
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-18 19:09 UTC by Steve Chaplin
Modified: 2005-08-22 00:14 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Here's a patch to address the problem (626 bytes, patch)
2005-04-18 19:13 UTC, Steve Chaplin
Details | Splinter Review

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.