ID: 38112 Updated by: [EMAIL PROTECTED] Reported By: bduclaux at yahoo dot com Status: Assigned Bug Type: GD related Operating System: Linux PHP Version: 5.1.4 Assigned To: pajoye New Comment:
Fixed in PHP_5_2. I will close the bug once I merge it in all branches. Previous Comments: ------------------------------------------------------------------------ [2006-07-16 10:37:09] [EMAIL PROTECTED] Only for the record, the gif image is corrupt. Fix coming. ------------------------------------------------------------------------ [2006-07-16 10:05:04] bduclaux at yahoo dot com Description: ------------ imagecreatefromgif segfaults when broken gif images are loaded Reproduce code: --------------- <?php $im=imagecreatefromgif("http://www.compuworldfrance.com/boutique/images_produits/26HEBOITIER0010_1.gif"); ?> Expected result: ---------------- Should not segfault ! Actual result: -------------- The bug comes from the file php-5.1.4/ext/gd/libgd/gd_gif_in.c:394 Here is the full trace : (gdb) bt #0 LWZReadByte (fd=0x856c96c, flag=Variable "flag" is not available. ) at /home/sysop/php-5.1.4/ext/gd/libgd/gd_gif_in.c:394 #1 0x080ead3c in ReadImage (im=0x8569604, fd=0x856c96c, len=130, height=130, cmap=0xbfffcd80, interlace=0) at /home/sysop/php-5.1.4/ext/gd/libgd/gd_gif_in.c:520 #2 0x080eb008 in php_gd_gdImageCreateFromGifCtx (fd=0x856c96c) at /home/sysop/php-5.1.4/ext/gd/libgd/gd_gif_in.c:199 #3 0x080d25fb in _php_image_create_from (ht=Variable "ht" is not available. ) at /home/sysop/php-5.1.4/ext/gd/gd.c:1608 #4 0x080d281b in zif_imagecreatefromgif (ht=292440, return_value=0x4000000, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at /home/sysop/php-5.1.4/ext/gd/gd.c:1674 #5 0x0822df8c in zend_do_fcall_common_helper_SPEC (execute_data=0xbfffd510) at /home/sysop/php-5.1.4/Zend/zend_vm_execute.h:200 #6 0x0822d971 in execute (op_array=0x85674e4) at /home/sysop/php-5.1.4/Zend/zend_vm_execute.h:92 #7 0x08216252 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/sysop/php-5.1.4/Zend/zend.c:1109 #8 0x081e25d0 in php_execute_script (primary_file=0xbffffa10) at /home/sysop/php-5.1.4/main/main.c:1732 #9 0x08290111 in main (argc=2, argv=0xbffffae4) at /home/sysop/php-5.1.4/sapi/cli/php_cli.c:1092 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38112&edit=1