Bug 6909 - cairo_surface_write_to_png_stream ignores status returned by the write function
Summary: cairo_surface_write_to_png_stream ignores status returned by the write function
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: png functions (show other bugs)
Version: 1.1.7
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-14 03:47 UTC by Torsten Schönfeld
Modified: 2007-09-25 15:49 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Torsten Schönfeld 2006-05-14 03:47:09 UTC
In case of an error (status != CAIRO_STATUS_SUCCESS)
cairo_surface_write_to_png_stream seems to ignore what the write function
actually returned.  It always simply returns CAIRO_STATUS_NO_MEMORY (that's what
that setjmp branch sets).

A quick look at the source reveals that this probably isn't easy to change since
png_rw_ptr doesn't have a return value, but I thought I file it anyway in case I
missed something obvious.  Feel free to dismiss this bug report if there is
nothing that can be done about it.
Comment 1 Chris Wilson 2007-09-25 15:49:20 UTC
I found a png_error_ptr through which we can propagate the error status.

Pushed:
commit 1469de5211e84e40490fa612538986768748bd55
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Sep 25 23:35:25 2007 +0100

    [cairo-png] Propagate error from read and write funcs.
    
    Use the png_struct->error_ptr to propagate the error status from the
    user/stdio read and write functions through the png_error() to the
    cairo_surface_write_to_png*() and cairo_surface_read_from_png*()
    functions. From there the error is returned back to the user either
    directly or as the most appropriate error surface.
    
    (Fixes https://bugs.freedesktop.org/show_bug.cgi?id=6909)


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.