summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/prog_statevars.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-05-18 15:41:36 -0600
committerBrian Paul <[email protected]>2008-05-18 15:41:36 -0600
commit5976a6a75cfa6749db306111a601d99c99cc00a4 (patch)
treeb4b1c595d630dc301d9922889a72171d2d80ac39 /src/mesa/shader/prog_statevars.c
parent4b6b0fd526b16d70bb5d1acc8d93af280660c810 (diff)
added div by zero check for Fog.End/Start (from gallium-0.1)
Diffstat (limited to 'src/mesa/shader/prog_statevars.c')
-rw-r--r--src/mesa/shader/prog_statevars.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c
index 4ae74c1d42b..72bdad76545 100644
--- a/src/mesa/shader/prog_statevars.c
+++ b/src/mesa/shader/prog_statevars.c
@@ -253,7 +253,8 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
value[0] = ctx->Fog.Density;
value[1] = ctx->Fog.Start;
value[2] = ctx->Fog.End;
- value[3] = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
+ value[3] = (ctx->Fog.End == ctx->Fog.Start)
+ ? 1.0 : 1.0F / (ctx->Fog.End - ctx->Fog.Start);
return;
case STATE_CLIPPLANE:
{