|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #66488 32-bit integers used internally
Submitted: 2014-01-15 15:02 UTC Modified: 2017-01-22 00:03 UTC
Avg. Score:4.8 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:2 (50.0%)
From: scott at arciszewski dot me Assigned:
Status: Suspended Package: GD related
PHP Version: 5.5.8 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: scott at arciszewski dot me
New email:
PHP Version: OS:


 [2014-01-15 15:02 UTC] scott at arciszewski dot me
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:

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:
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-22 00:03 UTC]
-Status: Open +Status: Suspended
 [2017-01-22 00:03 UTC]
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
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 23:01:31 2024 UTC