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>
This commit is contained in:
@@ -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')
|
||||
|
Reference in New Issue
Block a user