[php-src] master: ext/gd: fix imagecreate_error_oversized.phpt on 32-bit (#25423)
| From: | Felix Bünemann via GitHub | Date: | Thu, 12 Nov 2026 16:51:49 +0000 |
| Subject: | [php-src] master: ext/gd: fix imagecreate_error_oversized.phpt on 32-bit (#25423) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-143645@lists.php.net to get a copy of this message | ||
Author: Felix Bünemann (felixbuenemann)
Committer: GitHub (web-flow)
Pusher: devnexen
Date: 2026-11-12T16:51:45Z
Commit: https://github.com/php/php-src/commit/6c0388f7794d9f64ae1372ec047045d1e809d6c1
Raw diff: https://github.com/php/php-src/commit/6c0388f7794d9f64ae1372ec047045d1e809d6c1.diff
ext/gd: fix imagecreate_error_oversized.phpt on 32-bit (#25423)
On 32-bit platforms 4294967296 is a float that doesn't fit in an int, so
imagecreate() and imagecreatetruecolor() throw a TypeError before they
check the range, and the test fails. It has failed in the
LINUX_X32_DEBUG_ZTS job since it was added in 66c0f525665.
Remove that value from the test. The values that remain, PHP_INT_MAX and
2147483647, are valid ints on all platforms.
Changed paths:
M ext/gd/tests/imagecreate_error_oversized.phpt
Diff:
diff --git a/ext/gd/tests/imagecreate_error_oversized.phpt
b/ext/gd/tests/imagecreate_error_oversized.phpt
index 333a6e7c2086..23e90231f8f0 100644
--- a/ext/gd/tests/imagecreate_error_oversized.phpt
+++ b/ext/gd/tests/imagecreate_error_oversized.phpt
@@ -4,7 +4,7 @@ imagecreate()/imagecreatetruecolor(): oversized dimensions produce a correct err
gd
--FILE--
<?php
-foreach ([PHP_INT_MAX, 2147483647, 4294967296] as $v) {
+foreach ([PHP_INT_MAX, 2147483647] as $v) {
try { imagecreate($v, 1); } catch (Throwable $e) { echo $e::class, ': ',
$e->getMessage(), "\n"; }
try { imagecreate(1, $v); } catch (Throwable $e) { echo $e::class, ': ',
$e->getMessage(), "\n"; }
try { imagecreatetruecolor($v, 1); } catch (Throwable $e) { echo $e::class, ': ',
$e->getMessage(), "\n"; }
@@ -20,7 +20,3 @@ ValueError: imagecreate(): Argument #1 ($width) must be greater than 0 and less
ValueError: imagecreate(): Argument #2 ($height) must be greater than 0 and less than %d
ValueError: imagecreatetruecolor(): Argument #1 ($width) must be greater than 0 and less than %d
ValueError: imagecreatetruecolor(): Argument #2 ($height) must be greater than 0 and less than %d
-ValueError: imagecreate(): Argument #1 ($width) must be greater than 0 and less than %d
-ValueError: imagecreate(): Argument #2 ($height) must be greater than 0 and less than %d
-ValueError: imagecreatetruecolor(): Argument #1 ($width) must be greater than 0 and less than %d
-ValueError: imagecreatetruecolor(): Argument #2 ($height) must be greater than 0 and less than %d