Req #66488 [Opn->Sus]: 32-bit integers used internally

From: Date: Sun, 22 Jan 2017 00:03:36 +0000
Subject: Req #66488 [Opn->Sus]: 32-bit integers used internally
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206828@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66488&edit=1 ID: 66488 Updated by: cmb@php.net Reported by: scott at arciszewski dot me Summary: 32-bit integers used internally -Status: Open +Status: Suspended Type: Feature/Change Request Package: GD related Operating System: Linux PHP Version: 5.5.8 Block user comment: N Private report: N New Comment: That is something that should be resolved for libgd generally, not only for our bundled libgd, so I'm suspending this ticket as there's already a respective one for libgd, see <https://github.com/libgd/libgd/issues/122>. Previous Comments: ------------------------------------------------------------------------ [2015-07-20 21:19:15] cmb@php.net Related To: Bug #66387 ------------------------------------------------------------------------ [2014-01-15 19:31:00] sixd@php.net See https://wiki.php.net/rfc/size_t_and_int64 ------------------------------------------------------------------------ [2014-01-15 15:02:36] scott at arciszewski dot me Description: ------------ Even when using PHP with GD on a 64-bit machine, the 4 GB memory limit rears its ugly head. Thus, we have problems like this one: https://stackoverflow.com/questions/20614686/gd-warning-product-of-memory-allocation-multiplication-would-exceed-int-max I would propose going in and updating the integer definitions to accommodate 64-bit processors and its larger memory space, but GD isn't my forte so I'm not sure if I would break all of the things if I went in and patched it. Test script: --------------- echo PHP_INT_MAX . '<br/>'; echo 174400 * 249600 . '<br/>'; $img = imagecreatetruecolor(174400, 249600); Expected result: ---------------- 9223372036854775807 43530240000 Warning: imagecreatetruecolor(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully in /home/bartek/Documents/WWW/WOF/application/controllers/EditorController.php on line 5 Actual result: -------------- <b>Parse error</b>: imagecreatetruecolor(): product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66488&edit=1

« previous php.bugs (#206828) next »