Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f3f3e8a

Browse files
committed
backport fix from upstream
1 parent d3acdf5 commit f3f3e8a

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

‎ext/gd/libgd/gd_interpolation.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,12 +2461,17 @@ int gdTransformAffineBoundingBox(gdRectPtr src, const double affine[6], gdRectPt
24612461
if (max.y < extent[i].y)
24622462
max.y=extent[i].y;
24632463
}
2464-
double twidth = floor(max.x - min.x) - 1;
2465-
double theight = floor(max.y - min.y);
2466-
2467-
if (twidth < (double)INT_MIN || twidth > (double)INT_MAX ||
2468-
theight < (double)INT_MIN || theight > (double)INT_MAX)
2469-
return GD_FALSE;
2464+
double twidth = ceil((max.x - min.x));
2465+
double theight = ceil(max.y - min.y);
2466+
2467+
if (twidth < (double)INT_MIN)
2468+
twidth = (double)INT_MIN;
2469+
else if (twidth > (double)INT_MAX)
2470+
twidth = (double)INT_MAX;
2471+
if (theight < (double)INT_MIN)
2472+
theight = (double)INT_MIN;
2473+
else if (theight > (double)INT_MAX)
2474+
theight = (double)INT_MAX;
24702475

24712476
bbox->x = (int) min.x;
24722477
bbox->y = (int) min.y;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /