mirror of
https://github.com/php/php-src.git
synced 2025-08-17 22:48:57 +02:00
fix the fix for bug #70976 (imagerotate)
This commit is contained in:
parent
63c77ee4b1
commit
14e4d393cf
2 changed files with 4 additions and 4 deletions
|
@ -2162,7 +2162,7 @@ gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, in
|
|||
{
|
||||
const int angle_rounded = (int)floor(angle * 100);
|
||||
|
||||
if (bgcolor < 0 || (!src->trueColor && bgcolor >= gdMaxColors)) {
|
||||
if (bgcolor < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -2170,7 +2170,7 @@ gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, in
|
|||
images can be done at a later point.
|
||||
*/
|
||||
if (src->trueColor == 0) {
|
||||
if (bgcolor >= 0) {
|
||||
if (bgcolor < gdMaxColors) {
|
||||
bgcolor = gdTrueColorAlpha(src->red[bgcolor], src->green[bgcolor], src->blue[bgcolor], src->alpha[bgcolor]);
|
||||
}
|
||||
gdImagePaletteToTrueColor(src);
|
||||
|
|
|
@ -6,8 +6,8 @@ Bug #70976 (Memory Read via gdImageRotateInterpolated Array Index Out of Bounds)
|
|||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$img = imagerotate(imagecreate(1,1),45,0x7ffffff9);
|
||||
$img = imagerotate(imagecreate(10,10),45,0x7ffffff9);
|
||||
var_dump($img);
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
resource(5) of type (gd)
|
Loading…
Add table
Add a link
Reference in a new issue