[php-src] PR #25181: Fix GH-25175: imagecopyresampled() ignores negative source width/height
| From: | lazerg | Date: | Wed, 04 Nov 2026 01:10:27 +0000 |
| Subject: | [php-src] PR #25181: Fix GH-25175: imagecopyresampled() ignores negative source width/height | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40281@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25181
Author: lazerg
Since the GD 2.4 sync,
gdImageCopyResampled() runs the new
gdImageClipCopyResized() helper first, and that bails out on any
srcW/srcH <= 0. A negative source size used to mirror the copy, so
flipping through imagecopyresampled() (WordPress does this) now leaves the destination
blank. The helper now only rejects a zero source size; the clipping math already works with negative
values, and gdImageCopyResized() still refuses them through its
overflow2() checks.
Fixes GH-25175