com php-src: fix the fix for bug #70976 (imagerotate): ext/gd/libgd/gd_interpolation.c ext/gd/tests/bug709 76.phpt

From: Date: Tue, 12 Jan 2016 13:03:35 +0000
Subject: com php-src: fix the fix for bug #70976 (imagerotate): ext/gd/libgd/gd_interpolation.c ext/gd/tests/bug709 76.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-90621@lists.php.net to get a copy of this message
Commit: aa8d3a8cc612ba87c0497275f58a2317a90fb1c4 Author: Remi Collet <remi@php.net> Tue, 12 Jan 2016 13:52:27 +0100 Committer: Julien Pauli <jpauli@php.net> Tue, 12 Jan 2016 14:03:35 +0100 Parents: a6734f70e124fcccb1b488f40cc00a1fa07b5d4a Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=aa8d3a8cc612ba87c0497275f58a2317a90fb1c4 Log: fix the fix for bug #70976 (imagerotate) Bugs: https://bugs.php.net/70976 Changed paths: M ext/gd/libgd/gd_interpolation.c M ext/gd/tests/bug70976.phpt Diff: diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c index eb35efb..6b7360a 100644 --- a/ext/gd/libgd/gd_interpolation.c +++ b/ext/gd/libgd/gd_interpolation.c @@ -2154,7 +2154,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; } @@ -2162,7 +2162,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); diff --git a/ext/gd/tests/bug70976.phpt b/ext/gd/tests/bug70976.phpt index 23af4ee..dfbd4b4 100644 --- a/ext/gd/tests/bug70976.phpt +++ b/ext/gd/tests/bug70976.phpt @@ -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) \ No newline at end of file +resource(5) of type (gd) \ No newline at end of file

« previous php.cvs (#90621) next »