Mesa (gallium-0.1): mesa: protect against segfault in get_fp_input_mask()

Keith Whitwell keithw at kemper.freedesktop.org
Tue Oct 7 15:34:26 UTC 2008


Module: Mesa
Branch: gallium-0.1
Commit: 6ff1cf5b82488dc5a07513b0806c23e70f7a665e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6ff1cf5b82488dc5a07513b0806c23e70f7a665e

Author: Keith Whitwell <keith at tungstengraphics.com>
Date:   Tue Oct  7 12:31:31 2008 +0100

mesa: protect against segfault in get_fp_input_mask()

---

 src/mesa/main/texenvprogram.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index ea2ee16..7049467 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -204,7 +204,10 @@ static GLuint get_fp_input_mask( GLcontext *ctx )
 {
    GLuint fp_inputs = 0;
 
-   if (!ctx->VertexProgram._Enabled) {
+   if (!ctx->VertexProgram._Enabled ||
+       !ctx->VertexProgram._Current) {
+
+      /* Fixed function logic */
       GLuint varying_inputs = ctx->varying_vp_inputs;
 
       /* First look at what values may be computed by the generated




More information about the mesa-commit mailing list