summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-01-03 22:56:23 +0000
committerBrian Paul <[email protected]>2001-01-03 22:56:23 +0000
commit1c768645c5449f3bb66edb198821cf4947998a68 (patch)
tree34d9ad4cc78a8b29ba7468b25380b61d2d0bb556 /src/mesa/tnl
parentd14fce03f0b5db720cfc52a3c81f407626e28111 (diff)
added divide by zero check
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_vb_fog.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c
index 38a80702ab2..2adb8d18500 100644
--- a/src/mesa/tnl/t_vb_fog.c
+++ b/src/mesa/tnl/t_vb_fog.c
@@ -1,4 +1,4 @@
-/* $Id: t_vb_fog.c,v 1.1 2000/12/26 05:09:33 keithw Exp $ */
+/* $Id: t_vb_fog.c,v 1.2 2001/01/03 22:56:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -68,7 +68,10 @@ static void make_win_fog_coords( GLcontext *ctx, GLvector1f *out,
switch (ctx->Fog.Mode) {
case GL_LINEAR:
- d = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
+ if (ctx->Fog.Start == ctx->Fog.End)
+ d = 1.0F;
+ else
+ d = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride))
data[i] = (end - ABSF(*v)) * d;
break;