summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_aaline.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-05-10 17:41:41 +0000
committerBrian Paul <[email protected]>2001-05-10 17:41:41 +0000
commitdbed2027444338dc09fc102d6f4bd5c707c238d7 (patch)
tree13e2805c93fea3ab3b67c310d9b0fb76f5a3dfc4 /src/mesa/swrast/s_aaline.c
parentbd3d9b9d0497e64feec50153ad953a58a35bcd89 (diff)
fixed some divide by zero problems found w/ conform
Diffstat (limited to 'src/mesa/swrast/s_aaline.c')
-rw-r--r--src/mesa/swrast/s_aaline.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c
index f60233c3aca..7ce0d6b7080 100644
--- a/src/mesa/swrast/s_aaline.c
+++ b/src/mesa/swrast/s_aaline.c
@@ -1,4 +1,4 @@
-/* $Id: s_aaline.c,v 1.8 2001/04/10 15:46:51 brianp Exp $ */
+/* $Id: s_aaline.c,v 1.9 2001/05/10 17:41:41 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -201,7 +201,10 @@ compute_lambda(const GLfloat sPlane[4], const GLfloat tPlane[4],
GLfloat r2 = dvdx * dvdx + dvdy * dvdy;
GLfloat rho2 = r1 + r2;
/* return log base 2 of rho */
- return log(rho2) * 1.442695 * 0.5; /* 1.442695 = 1/log(2) */
+ if (rho2 == 0.0F)
+ return 0.0;
+ else
+ return log(rho2) * 1.442695 * 0.5; /* 1.442695 = 1/log(2) */
}