diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-01-06 09:35:13 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-01-06 09:35:13 +0100 |
commit | 2c5860517c4a1f7ebc81ef79858aa5aff5aad76c (patch) | |
tree | 47a546da523e752d082265d3a37bc0be0bb9ea66 /ext/gd/libgd/gd_interpolation.c | |
parent | c05a069adfcca56763d5db06afce8801382477a5 (diff) | |
download | php-git-2c5860517c4a1f7ebc81ef79858aa5aff5aad76c.tar.gz |
Fix #79067: gdTransformAffineCopy() may use unitialized values
We port
<https://github.com/libgd/libgd/commit/7a06c1669c563917bc48c464521e3de962ddb4e8>.
Diffstat (limited to 'ext/gd/libgd/gd_interpolation.c')
-rw-r--r-- | ext/gd/libgd/gd_interpolation.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c index 86549a279d..489f3c9694 100644 --- a/ext/gd/libgd/gd_interpolation.c +++ b/ext/gd/libgd/gd_interpolation.c @@ -2334,7 +2334,7 @@ int gdTransformAffineGetImage(gdImagePtr *dst, * src_area - Rectangular region to rotate in the src image * * Returns: - * GD_TRUE if the affine is rectilinear or GD_FALSE + * GD_TRUE on success or GD_FALSE on failure */ int gdTransformAffineCopy(gdImagePtr dst, int dst_x, int dst_y, @@ -2393,7 +2393,10 @@ int gdTransformAffineCopy(gdImagePtr dst, end_y = bbox.height + (int) fabs(bbox.y); /* Get inverse affine to let us work with destination -> source */ - gdAffineInvert(inv, affine); + if (gdAffineInvert(inv, affine) == GD_FALSE) { + gdImageSetInterpolationMethod(src, interpolation_id_bak); + return GD_FALSE; + } src_offset_x = src_region->x; src_offset_y = src_region->y; |