From 4ca0af188267ab92f84223acd7f8b957be0cb5f6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 9 Jul 2008 08:35:50 -0600 Subject: [PATCH] mesa: fix state.clip[n].plane parsing bug (bug 16611) --- src/mesa/shader/arbprogparse.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 97bda9c6b38..f10233e5fed 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -1132,7 +1132,9 @@ parse_state_single_item (GLcontext * ctx, const GLubyte ** inst, struct arb_program *Program, gl_state_index state_tokens[STATE_LENGTH]) { - switch (*(*inst)++) { + GLubyte token = *(*inst)++; + + switch (token) { case STATE_MATERIAL_PARSER: state_tokens[0] = STATE_MATERIAL; state_tokens[1] = parse_face_type (inst); @@ -1317,7 +1319,6 @@ parse_state_single_item (GLcontext * ctx, const GLubyte ** inst, case STATE_CLIP_PLANE: state_tokens[0] = STATE_CLIPPLANE; - state_tokens[1] = parse_integer (inst, Program); if (parse_clipplane_num (ctx, inst, Program, (GLint *) &state_tokens[1])) return 1; @@ -1769,7 +1770,9 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst, gl_state_index state_tokens[STATE_LENGTH] = {0, 0, 0, 0, 0}; GLfloat const_values[4]; - switch (*(*inst)++) { + GLubyte token = *(*inst)++; + + switch (token) { case PARAM_STATE_ELEMENT: if (parse_state_single_item (ctx, inst, Program, state_tokens)) return 1; -- 2.30.2