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 12:52:27 +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-90617@lists.php.net to get a copy of this message
Commit: 14e4d393cf07a43fc68853e6d9cd9440a950d002 Author: Remi Collet <remi@php.net> Tue, 12 Jan 2016 13:52:27 +0100 Parents: 63c77ee4b12f8489f50add87af4371d9511b0295 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=14e4d393cf07a43fc68853e6d9cd9440a950d002 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 2f5df48..24fc3ce 100644 --- a/ext/gd/libgd/gd_interpolation.c +++ b/ext/gd/libgd/gd_interpolation.c @@ -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); 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 (#90617) next »