php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50734 GD won't complie against libpng 1.4.0
Submitted: 2010-01-12 22:31 UTC Modified: 2010-01-12 22:47 UTC
From: tsteiner at nerdclub dot net Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.3.1 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tsteiner at nerdclub dot net
New email:
PHP Version: OS:

 

 [2010-01-12 22:31 UTC] tsteiner at nerdclub dot net
Description:
------------
From the libpng README at ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.4.0-README.txt :
"Removed the deprecated png_check_sig() function/macro."

The file ext/gd/libgd/gd_png.c currently uses this function and so will not compile against libpng 1.4.0.  The libpng man page notes the following:

"The function
    png_check_sig(sig, num) was replaced with
    !png_sig_cmp(sig, 0, num) It has been deprecated since libpng-0.90."

I made the following change in gd_png.c and php compiled successfully.


--- ext/gd/libgd/gd_png.c.bad     2010-01-12 16:16:18.000000000 -0600
+++ ext/gd/libgd/gd_png.c 2010-01-12 16:16:55.000000000 -0600
@@ -145,7 +145,7 @@
                return NULL;
        }
 
-       if (!png_check_sig (sig, 8)) { /* bad signature */
+       if (png_sig_cmp (sig, 0, 8)) { /* bad signature */
                return NULL;
        }
 


Reproduce code:
---------------
Compile PHP with --with-gd and --with-libpng-dir pointing to a libpng-1.4.0 install.

Expected result:
----------------
PHP should compile without error.

Actual result:
--------------
ext/gd/libgd/.libs/gd_png.o: In function `php_gd_gdImageCreateFromPngCtx':
....../php-5.3.1/ext/gd/libgd/gd_png.c:148: undefined reference to `png_check_sig'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-12 22:47 UTC] pajoye@php.net
Already fixed in SVN.

Thanks for your report!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 04:01:28 2024 UTC