mirror of
https://github.com/php/php-src.git
synced 2026-04-25 08:58:28 +02:00
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #79067: gdTransformAffineCopy() may use unitialized values
This commit is contained in:
@@ -2289,7 +2289,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,
|
||||
@@ -2346,7 +2346,10 @@ int gdTransformAffineCopy(gdImagePtr dst,
|
||||
end_y = bbox.height + abs(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;
|
||||
|
||||
@@ -55,7 +55,7 @@ int gdAffineApplyToPointF (gdPointFPtr dst, const gdPointFPtr src,
|
||||
* <gdAffineIdentity>
|
||||
*
|
||||
* Returns:
|
||||
* GD_TRUE if the affine is rectilinear or GD_FALSE
|
||||
* GD_TRUE on success or GD_FALSE on failure
|
||||
*/
|
||||
int gdAffineInvert (double dst[6], const double src[6])
|
||||
{
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #79067 (gdTransformAffineCopy() may use unitialized values)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$matrix = [1, 1, 1, 1, 1, 1];
|
||||
$src = imagecreatetruecolor(8, 8);
|
||||
var_dump(imageaffine($src, $matrix));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
Reference in New Issue
Block a user