From: Tony Cook Date: Sat, 30 Mar 2002 13:59:13 +0000 (+0000) Subject: - i_box_cfill() went into an infinite loop on fountain fills X-Git-Tag: Imager-0.48^2~409 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/2de568dc8e4846137102408db5caf60d36f777cc - i_box_cfill() went into an infinite loop on fountain fills or fills on images with more than 8-bits/sample --- diff --git a/Changes b/Changes index 30775a28..77e8ad46 100644 --- a/Changes +++ b/Changes @@ -617,6 +617,8 @@ Revision history for Perl extension Imager. - handle the presence of the default broken giflib better, by giving them some more prose about the problem, and skipping all but the first test that fails with the broken giflib + - i_box_cfill() went into an infinite loop on fountain fills + or fills on images with more than 8-bits/sample ================================================================= diff --git a/draw.c b/draw.c index 68ada4f5..882c9b3a 100644 --- a/draw.c +++ b/draw.c @@ -413,6 +413,7 @@ i_box_cfill(i_img *im,int x1,int y1,int x2,int y2,i_fill_t *fill) { (fill->fill_with_fcolor)(fill, x1, y1, x2-x1, im->channels, line); } i_plinf(im, x1, x2, y1, line); + ++y1; } myfree(line); if (work) diff --git a/t/t20fill.t b/t/t20fill.t index 39c6edf2..45ac7665 100644 --- a/t/t20fill.t +++ b/t/t20fill.t @@ -1,7 +1,7 @@ #!perl -w use strict; -print "1..39\n"; +print "1..40\n"; use Imager ':handy'; use Imager::Fill; @@ -240,6 +240,22 @@ ok($testnum++, $oocopy->errstr =~ /Unknown hatch type/, "error message for automatic fill conversion"); +# previous box fills to float images, or using the fountain fill +# got into a loop here +{ + local $SIG{ALRM} = sub { die; }; + + eval { + alarm(2); + ok($testnum, + $ooim->box(xmin=>20, ymin=>20, xmax=>80, ymax=>40, + fill=>{ fountain=>'linear', xa=>20, ya=>20, xb=>80, + yb=>20 }), "linear box fill"); + ++$testnum; + }; + $@ and ok($testnum++, 0, "linear box fill alarmed"); +} + sub ok ($$$) { my ($num, $test, $desc) = @_;