summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-07-09 08:47:23 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-07-09 08:47:23 -0600
commit57f2d071d1503823867029e4d672c09e6417cc68 (patch)
tree2d1f191487c027f693bcb96ca0007b9008cc31c4
parent48b8a32c6dcd259046958b187927ac584b1a564a (diff)
mesa: fix state.clip[n].plane parsing bug (bug 16611)
cherry-picked from master
-rw-r--r--src/mesa/shader/arbprogparse.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index a6bbdc64f16..ff583352cec 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -1133,7 +1133,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);
@@ -1318,7 +1320,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;
@@ -1770,7 +1771,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;