summaryrefslogtreecommitdiff
path: root/src/mesa/shader/nvfragparse.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2010-01-06 08:27:42 -0800
committerBrian Paul <brianp@vmware.com>2010-01-06 09:47:37 -0700
commit324568f79d6e014900c981bd9a0e1dffedc326c8 (patch)
tree04c0dc711d64d575fb9adc02107803bec5c2257f /src/mesa/shader/nvfragparse.c
parent5db710a8231fe50d2faad8e9adb2a07616cc6130 (diff)
mesa: test index bounds before array element
Check whether the index is within bounds before accessing the array. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa/shader/nvfragparse.c')
-rw-r--r--src/mesa/shader/nvfragparse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c
index b739a6aa07..8ee7c93062 100644
--- a/src/mesa/shader/nvfragparse.c
+++ b/src/mesa/shader/nvfragparse.c
@@ -642,7 +642,7 @@ Parse_SwizzleSuffix(const GLubyte *token, GLuint swizzle[4])
else {
/* 4-component swizzle (vector) */
GLint k;
- for (k = 0; token[k] && k < 4; k++) {
+ for (k = 0; k < 4 && token[k]; k++) {
if (token[k] == 'x')
swizzle[k] = 0;
else if (token[k] == 'y')