aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2015-07-03 08:45:30 +1000
committerTimothy Arceri <[email protected]>2015-07-22 12:58:33 +1000
commit09c440c718992d48ef118c1aad6929ad215ccd3b (patch)
treeaf336df39e26f58d257ec322a7c6d1a954185544
parent7fccebf9803973c7403318da20afe23e80b5b59f (diff)
glsl: check for leading zeros in array index validation
Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
-rw-r--r--src/glsl/linker.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 28ad2f38e0e..58dd9fbfdae 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -462,6 +462,10 @@ parse_program_resource_name(const GLchar *name,
if (array_index < 0)
return -1;
+ /* Check for leading zero */
+ if (name[i] == '0' && name[i+1] != ']')
+ return -1;
+
*out_base_name_end = name + (i - 1);
return array_index;
}