Subject: | [PATCH] division by zero in axestype.pm _best_ends |
A bug in the GD/Graph/axestype.pm method _best_ends causes divide by zero errors with large data sets and normal or small sized images. Adding a test to ensure the step is not <= 0 avoids the problem. See attached patch.
dd
--
David Dooling
--- axestype.pm.orig 2005-12-18 23:06:05.000000000 -0600
+++ axestype.pm 2005-12-29 12:21:11.000000000 -0600
@@ -1677,7 +1693,7 @@
for my $step (@step)
{
- next if ($n != 1) && ($step < $range/$n); # $step too small
+ next if ($n != 1) && (($step < $range/$n) || $step <= 0); # $step too small
my ($nice_min, $nice_max, $fit)
= _fit_interval($min, $max, $n, $step);