Skip to content

Commit

Permalink
Fixed bug #75139 (libgd/gd_interpolation.c:1786: suspicious if ?)
Browse files Browse the repository at this point in the history
We back-port libgd/libgd@dd48286 even though
we cannot come up with a regression test, because the erroneous
condition appears to be impossible to trigger.

We also parenthesize the inner ternary operation to avoid confusion.
  • Loading branch information
cmb69 committed Sep 1, 2017
1 parent a86df6b commit e20a6b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ PHP NEWS

- GD:
. Fixed bug #75124 (gdImageGrayScale() may produce colors). (cmb)
. Fixed bug #75139 (libgd/gd_interpolation.c:1786: suspicious if ?). (cmb)

- Intl:
. Fixed bug #75090 (IntlGregorianCalendar doesn't have constants from parent
Expand Down
4 changes: 2 additions & 2 deletions ext/gd/libgd/gd_interpolation.c
Original file line number Diff line number Diff line change
Expand Up @@ -1783,8 +1783,8 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b

const gdFixed f_slop_y = f_sin;
const gdFixed f_slop_x = f_cos;
const gdFixed f_slop = f_slop_x > 0 && f_slop_x > 0 ?
f_slop_x > f_slop_y ? gd_divfx(f_slop_y, f_slop_x) : gd_divfx(f_slop_x, f_slop_y)
const gdFixed f_slop = f_slop_x > 0 && f_slop_y > 0 ?
(f_slop_x > f_slop_y ? gd_divfx(f_slop_y, f_slop_x) : gd_divfx(f_slop_x, f_slop_y))
: 0;


Expand Down

0 comments on commit e20a6b0

Please sign in to comment.