From: Pierre Joye Date: Sat, 13 Mar 2004 23:36:29 +0000 (+0000) Subject: - MFH bug #27582 (imagefilltoborder crashes) X-Git-Tag: php-4.3.5RC4~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d76514d8920eba1c3131370df75debcaac05767b;p=php - MFH bug #27582 (imagefilltoborder crashes) --- diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index e7edf12880..a800aa8397 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -1769,6 +1769,11 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) return; } + if (im->alphaBlendingFlag) { + restoreAlphaBleding = 1; + im->alphaBlendingFlag = 0; + } + if (x >= im->sx) { x = im->sx - 1; } @@ -1784,6 +1789,9 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) leftLimit = i; } if (leftLimit == -1) { + if (restoreAlphaBleding) { + im->alphaBlendingFlag = 1; + } return; } /* Seek right */ @@ -1827,6 +1835,9 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) } } } + if (restoreAlphaBleding) { + im->alphaBlendingFlag = 1; + } } diff --git a/ext/gd/tests/bug27582_1.phpt b/ext/gd/tests/bug27582_1.phpt new file mode 100644 index 0000000000..6dee785b16 --- /dev/null +++ b/ext/gd/tests/bug27582_1.phpt @@ -0,0 +1,23 @@ +--TEST-- +gdimagefill() function (Bug #19366 (fixed in bundled libgd)) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +08287f8f5d406946009df5f04ca83dc0