From dbed2027444338dc09fc102d6f4bd5c707c238d7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 10 May 2001 17:41:41 +0000 Subject: fixed some divide by zero problems found w/ conform --- src/mesa/swrast/s_aatriangle.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa/swrast/s_aatriangle.c') diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c index 8235e957e33..9a9eb877f10 100644 --- a/src/mesa/swrast/s_aatriangle.c +++ b/src/mesa/swrast/s_aatriangle.c @@ -1,4 +1,4 @@ -/* $Id: s_aatriangle.c,v 1.13 2001/04/10 15:46:51 brianp Exp $ */ +/* $Id: s_aatriangle.c,v 1.14 2001/05/10 17:41:41 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -341,7 +341,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) */ } -- cgit v1.2.3