summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-09-18 15:29:57 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-09-18 15:29:57 -0600
commit58dce864e659da3d1f9761154e622a45e420c229 (patch)
tree7336dd1c2146ed2179de055442f79eabef445a23 /src/mesa
parentecadb51bbcb972a79f3ed79e65a7986b9396e757 (diff)
mesa: fix null ptr deref bug in _tnl_InvalidateState(), bug 15834
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/tnl/t_context.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index e772a06eda..00f43b553b 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.2
+ * Version: 7.2
*
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -137,11 +137,19 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR_INDEX );
}
- if (ctx->Fog.Enabled ||
- ((ctx->FragmentProgram._Active || ctx->FragmentProgram._Current) &&
- (ctx->FragmentProgram._Current->FogOption != GL_NONE ||
- (ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC))))
+ if (ctx->Fog.Enabled) {
+ /* fixed-function fog */
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG );
+ }
+ else if (ctx->FragmentProgram._Active || ctx->FragmentProgram._Current) {
+ struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
+ if (fp) {
+ if (fp->FogOption != GL_NONE || (fp->Base.InputsRead & FRAG_BIT_FOGC)) {
+ /* fragment program needs fog coord */
+ RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG );
+ }
+ }
+ }
if (ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL)