Re: cairo built against libpng16

[email protected]
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On Wed, Mar 20, 2013 at 10:16:44AM +0100, [email protected] 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 ... */
}

?

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iEYEARECAAYFAlFJi0wACgkQGevYtT2kPwOkZQCghXniL6a9w4oKik0Z7wsWW+6t
/6oAn1GQOeYlwuB5/YJMlObGt1iycUJk
=Qle0
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.