Bug #66625 [Opn->Dup]: imagescale() segmentation fault on 64bits environment

From: Date: Wed, 18 Jan 2017 18:58:20 +0000
Subject: Bug #66625 [Opn->Dup]: imagescale() segmentation fault on 64bits environment
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206732@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66625&edit=1 ID: 66625 Updated by: cmb@php.net Reported by: yoya at awm dot jp Summary: imagescale() segmentation fault on 64bits environment -Status: Open +Status: Duplicate Type: Bug Package: GD related Operating System: Any PHP Version: 5.5.8 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: This has already been fixed as resolution of bug #66890, so I'm marking this ticket as duplicate. Previous Comments: ------------------------------------------------------------------------ [2016-06-07 04:03:39] pajoye@php.net They are different issues. #72337 is about new width or height being zero. This one is wrong type used for the new_width and height, as described precisely here. Patches coming, running further tests. ------------------------------------------------------------------------ [2016-06-06 18:43:38] cmb@php.net Related To: Bug #72337 ------------------------------------------------------------------------ [2014-03-24 22:47:00] mwanat at forall dot pl Confirmed on 64Bit CentOS & PHP 5.5.10 ------------------------------------------------------------------------ [2014-02-02 03:50:22] yoya at awm dot jp Description: ------------ * ext/gd.c ---- PHP_FUNCTION(imagescale) { zval *IM; gdImagePtr im; gdImagePtr im_scaled; int new_width, new_height = -1; gdInterpolationMethod method = GD_BILINEAR_FIXED; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|ll", &IM, &new_width, &new_height, &method) == FAILURE) { ---- On 64 bits environment ,'l'(long) have 64 bits width, int and gdInterpolationMethod type have 32 bits, so IM pointer be destroyed by value of other variables. This problem related to id:65171, I guess. - https://bugs.php.net/bug.php?id=65171 Test script: --------------- <?php $data = file_get_contents($argv[1]); $im = ImageCreateFromString($data); $im2 = imagescale($im, 256, 192, IMG_NEAREST_NEIGHBOUR); imagepng($im2, 'output.png'); Actual result: -------------- Segmentation fault ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66625&edit=1

« previous php.bugs (#206732) next »