Commit dddbca6
ext/gd: report $size with the argument number of the function called
php_imagettftext_common() serves the bbox functions, where $size is
argument #1, and the drawing ones, where it is #2, but its two size
checks hardcode 2. imageftbbox(NAN, ...) therefore blamed $angle.
Also fix the upper bound itself: (double)LONG_MAX rounds up to 2^63, so
(double)LONG_MAX / 64 is 2^57 and the check let 2^57 through, whose
product with 64 is LONG_MAX + 1. The bound is now exclusive, and the
reported values use integer division, which gives the largest size that
is actually representable. The lower bound stays inclusive:
(double)LONG_MIN / 64 is exactly -2^57 and its product with 64 is
LONG_MIN.
Co-authored-by: NickSdot <32384907+NickSdot@users.noreply.github.com>
Close GH-235411 parent 0bf872b commit dddbca6
3 files changed
Lines changed: 74 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3422 | 3422 | | |
3423 | 3423 | | |
3424 | 3424 | | |