Skip to content

Fix GH-25949: BMP width above INT_MAX is published as a negative HTML attribute - #25951

Open
lazerg wants to merge 1 commit into
php:PHP-8.4from
lazerg:fix/gh-25949
Open

lazerg wants to merge 1 commit into
php:PHP-8.4from
lazerg:fix/gh-25949

Conversation

@lazerg

@lazerg lazerg commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

biWidth in a BMP info header is a signed 32-bit value, but php_handle_bmp() stores the raw bits in an unsigned width. A width with the sign bit set (a negative width, which is invalid) was returned as e.g. 2147483649 and printed as -2147483647 in the width="..." string. Such headers are now rejected, so getimagesize() returns false.

Fixes #25949

@lazerg

lazerg commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

The WINDOWS_X64_ZTS failure is in pdo_odbc (SQL Server not reachable) and a sockets test, so it's not caused by this change.

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.

1 participant