From: Ilia Alshanetsky Date: Wed, 4 Jun 2003 00:20:19 +0000 (+0000) Subject: GD 2.0.15 sync X-Git-Tag: RELEASE_1_0_2~441 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2a9f31160007b377c664db6c0e789f248961628;p=php GD 2.0.15 sync --- diff --git a/ext/gd/gd.c b/ext/gd/gd.c index ec097e9e8e..eb7d24ef87 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -440,7 +440,7 @@ PHP_RSHUTDOWN_FUNCTION(gd) /* }}} */ #if HAVE_GD_BUNDLED -#define PHP_GD_VERSION_STRING "bundled (2.0.14 compatible)" +#define PHP_GD_VERSION_STRING "bundled (2.0.15 compatible)" #elif HAVE_LIBGD20 #define PHP_GD_VERSION_STRING "2.0 or higher" #elif HAVE_GDIMAGECOLORRESOLVE diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index a71a8d7ea1..a25a6f2afd 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -873,11 +873,6 @@ static void gdImageAntiAliasedApply (gdImagePtr im, int px, int py) float p_dist, p_alpha; unsigned char opacity; - /* 2.0.13: bounds check! AA_opacity is just as capable of overflowing as the main pixel array. Arne Jorgensen. */ - if (!gdImageBoundsSafeMacro(im, px, py)) { - return; - } - /* * Find the perpendicular distance from point C (px, py) to the line * segment AB that is being drawn. (Adapted from an algorithm from the @@ -892,6 +887,15 @@ static void gdImageAntiAliasedApply (gdImagePtr im, int px, int py) int Bx_Cx = im->AAL_x2 - px; int By_Cy = im->AAL_y2 - py; + /* 2.0.13: bounds check! AA_opacity is just as capable of + * overflowing as the main pixel array. Arne Jorgensen. + * 2.0.14: typo fixed. 2.0.15: moved down below declarations + * to satisfy non-C++ compilers. + */ + if (!gdImageBoundsSafeMacro(im, px, py)) { + return; + } + /* Get the squares of the lengths of the segemnts AC and BC. */ LAC_2 = (Ax_Cx * Ax_Cx) + (Ay_Cy * Ay_Cy); LBC_2 = (Bx_Cx * Bx_Cx) + (By_Cy * By_Cy);