fixes to _mesa_combine_programs(), from gallium-0.1
[mesa.git] / src / mesa / shader / prog_statevars.c
index 01ab051d13a075d8a9e5d087abf4630c5df141d7..72bdad7654599e4e1a98a7e31bef0d3eacaa2287 100644 (file)
@@ -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:
       {
@@ -813,7 +814,7 @@ _mesa_load_state_parameters(GLcontext *ctx,
    GLuint i;
 
    if (!paramList)
-      return retval;
+      return;
 
    for (i = 0; i < paramList->NumParameters; i++) {
       if (paramList->Parameters[i].Type == PROGRAM_STATE_VAR) {