Skip to content

ext/gd: fix imagecreate_error_oversized.phpt on 32-bit - #25423

Merged
devnexen merged 1 commit into
php:masterfrom
felixbuenemann:fix-gd-imagecreate-test-32bit
Nov 12, 2026
Merged

devnexen merged 1 commit into
php:masterfrom
felixbuenemann:fix-gd-imagecreate-test-32bit

Conversation

@felixbuenemann

Copy link
Copy Markdown
Contributor

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 66c0f52.

Move that value to a test for 64-bit platforms. The values that remain, PHP_INT_MAX and 2147483647, are valid ints on all platforms.

@devnexen

Copy link
Copy Markdown
Member

thanks for report but the additional 64 bits test is unnecessary. After its removal I ll merge. Cheers !

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 66c0f52.

Remove that value from the test. The values that remain, PHP_INT_MAX and
2147483647, are valid ints on all platforms.
@felixbuenemann
felixbuenemann force-pushed the fix-gd-imagecreate-test-32bit branch from 1d9da89 to 87bd330 Compare November 12, 2026 15:52
@felixbuenemann

Copy link
Copy Markdown
Contributor Author

thanks for report but the additional 64 bits test is unnecessary. After its removal I ll merge. Cheers !

OK, 64-bit test removed.

@devnexen
devnexen merged commit 6c0388f into php:master Nov 12, 2026
18 checks passed
@felixbuenemann
felixbuenemann deleted the fix-gd-imagecreate-test-32bit branch November 13, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants