Bug #73116 [Ver]: imagecreatefromjpeg fatal error on empty file

From: Date: Wed, 05 Oct 2016 12:30:29 +0000
Subject: Bug #73116 [Ver]: imagecreatefromjpeg fatal error on empty file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204476@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73116&edit=1 ID: 73116 Updated by: cmb@php.net Reported by: chupaka at gmail dot com Summary: imagecreatefromjpeg fatal error on empty file Status: Verified Type: Bug Package: GD related Operating System: Fedora 24 PHP Version: 5.6.26 -Assigned To: cmb +Assigned To: Block user comment: N Private report: N New Comment: Even with an "official" external libgd I couldn't reproduce the issue, so this might be a packaging issue. I think it has to do with commit 6cb75fb1[1] which is supposed to be available as of PHP 5.6.25. [1] <https://github.com/php/php-src/commit/6cb75fb1> Previous Comments: ------------------------------------------------------------------------ [2016-10-05 11:57:34] ondrej@php.net Seems the usual dichotomy between bundled and standalone gd library in: ``` /* Called by the IJG JPEG library upon encountering a fatal error */ static void fatal_jpeg_error(j_common_ptr cinfo) { jmpbuf_wrapper *jmpbufw; - char buffer[JMSG_LENGTH_MAX]; - (*cinfo->err->format_message)(cinfo, buffer); - gd_error_ex(GD_ERROR, "gd-jpeg: JPEG library reports unrecoverable error: %s", buffer); + php_gd_error("gd-jpeg: JPEG library reports unrecoverable error: "); + (*cinfo->err->output_message) (cinfo); jmpbufw = (jmpbuf_wrapper *)cinfo->client_data; jpeg_destroy(cinfo); if(jmpbufw != 0) { longjmp(jmpbufw->jmpbuf, 1); - gd_error_ex(GD_ERROR, "gd-jpeg: EXTREMELY fatal error: longjmp returned control; terminating\n"); + php_gd_error_ex(E_ERROR, "gd-jpeg: EXTREMELY fatal error: longjmp returned control; terminating"); } else { - gd_error_ex(GD_ERROR, "gd-jpeg: EXTREMELY fatal error: jmpbuf unrecoverable; terminating\n"); + php_gd_error_ex(E_ERROR, "gd-jpeg: EXTREMELY fatal error: jmpbuf unrecoverable; terminating"); } exit(99); } ``` Different error handling in bundled GD library. Nothing packagers can do about. ------------------------------------------------------------------------ [2016-10-05 11:30:11] cmb@php.net Ondřej, can you have a look at this issue please? ------------------------------------------------------------------------ [2016-10-05 11:15:18] eforcems at o2 dot pl Hi, this is not only Fedora issue. I have the same issue on Kubuntu 16.04 from this repo http://ppa.launchpad.net/ondrej/php/ubuntu/ ------------------------------------------------------------------------ [2016-09-24 21:52:12] cmb@php.net Thanks for the version information. I can reproduce the behavior in a very similar Fedora 24 environment, but not with the original libs, so this might be a Fedora package issue. Remi, could you please have a look at this issue? ------------------------------------------------------------------------ [2016-09-24 15:48:14] chupaka at gmail dot com [root@new-info ~]# dnf list installed php gd libjpeg-turbo Last metadata expiration check: 1:16:50 ago on Sat Sep 24 17:28:15 2016. Installed Packages gd.x86_64 2.2.3-2.fc24 @updates libjpeg-turbo.x86_64 1.5.0-2.fc24 @updates php.x86_64 5.6.26-1.fc24 @updates-testing [root@new-info ~]# ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=73116 -- Edit this bug report at https://bugs.php.net/bug.php?id=73116&edit=1

« previous php.bugs (#204476) next »