bug and fix
| From: | Ducky Sherwood | Date: | Thu, 19 Jul 2007 05:37:19 +0000 |
| Subject: | bug and fix | ||
| Groups: | php.gd.devel | ||
| Request: | Send a blank email to php-gd-devel+get-229@lists.php.net to get a copy of this message | ||
Hi --
I found a bug in gdImageFilledPolygon.
In some cases, you can get an odd number of x-intercepts, which means that
in the call to gdImageLine
gdImageLine (im, im->polyInts[i], y, im->polyInts[i + 1], y, fill_color);
the im->polyInts[i+1] will be garbage. This can mess up the drawing of the
line.
I have attached a test case (bug.c) which shows a horizontal line being
drawn where it shouldn't.
I have also attached a patch, made with
diff -Naur gd.c gd.c.good > horizontalLineBug.patch
(I would have reported the bug and patch on flypaper, but I never saw a
reply (and yes, I told it my correct email address, and no, I couldn't find
it in my spam folder).)
--
Ducky Sherwood
Attachment: [text/x-csrc] bug.c
Attachment: [text/x-patch] horizontalLineBug.patch
Attachment: [text/x-csrc] bug.c
Attachment: [text/x-patch] horizontalLineBug.patch