[cairo] cairo built against libpng16

pgajdos at suse.cz pgajdos at suse.cz
Wed Mar 20 03:11:24 PDT 2013


On Wed, Mar 20, 2013 at 10:16:44AM +0100, pgajdos at suse.cz wrote:
> Hi,
> 
> simple program attached seems to have different results when 
> cairo is built against libpng15 and when it is built against 
> libpng16*):
> 
> cairo-libpng15-changeroot> ./cairo-fail tmp.png
> PNG image read.
> 
> cairo-libpng16-changeroot> ./cairo-fail tmp.png
> Error reading PNG image tmp.png: out of memory

Oh, this actually isn't 'out of memory'*):

(gdb) n
102              png_app_error(png_ptr,
(gdb) bt
#0  png_rtran_ok (png_ptr=0x604ba0, need_IHDR=0) at pngrtran.c:102
#1  0x00007ffff66e2040 in png_set_read_user_transform_fn
(png_ptr=0x604ba0, read_user_transform_fn=0x7ffff7b4ccfa
<convert_bytes_to_data>) at pngrtran.c:1059
#2  0x00007ffff7b4d1af in read_png (png_closure=0x7fffffffe7f0) at
cairo-png.c:651
#3  0x00007ffff7b4d507 in cairo_image_surface_create_from_png
(filename=0x7fffffffec12 "tmp.png") at cairo-png.c:779
#4  0x00000000004008ae in main (argc=2, argv=0x7fffffffe928) at
cairo-fail.c:8
(gdb) l
97      png_rtran_ok(png_structrp png_ptr, int need_IHDR)
98      {
99         if (png_ptr != NULL)
100        {
101           if (png_ptr->flags & PNG_FLAG_ROW_INIT)
102              png_app_error(png_ptr,
103                 "invalid after png_start_read_image or
png_read_update_info");
104     
105           else if (need_IHDR && (png_ptr->mode & PNG_HAVE_IHDR) ==
0)
106              png_app_error(png_ptr, "invalid before the PNG header
has been read");

Petr


*) probably because of cairo-png.c's

static void
png_simple_error_callback (png_structp png,
                           png_const_charp error_msg)
{
    cairo_status_t *error = png_get_error_ptr (png);

    /* default to the most likely error */
    if (*error == CAIRO_STATUS_SUCCESS)
        *error = _cairo_error (CAIRO_STATUS_NO_MEMORY);

#ifdef PNG_SETJMP_SUPPORTED
    longjmp (png_jmpbuf (png), 1);
#endif

    /* if we get here, then we have to choice but to abort ... */
}

?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.cairographics.org/archives/cairo/attachments/20130320/b0e112b3/attachment.pgp>


More information about the cairo mailing list