mesa: fix type for array indexing validation
authorTimothy Arceri <t_arceri@yahoo.com.au>
Sun, 2 Aug 2015 01:40:26 +0000 (11:40 +1000)
committerTimothy Arceri <t_arceri@yahoo.com.au>
Mon, 3 Aug 2015 11:28:12 +0000 (21:28 +1000)
commitcf5667108b2cdd6f37e1a561c18fb5c757258f06
tree0e34b29143b2f52aa9e8fbe68abe84a0e87cb5c5
parent704e764f06e8e6ec75484e28271e502bbc4cf06a
mesa: fix type for array indexing validation

parse_program_resource_name returns -1 when the index is invalid this needs to
be tested before assigning the value to the unsigned array_index.

In link_varyings.cpp (the other place parse_program_resource_name is used) after
the -1 check is done the value is just assigned to an unsigned variable so it
seems long is just used so we can return the -1 rather than actually expecting
index values to be ridiculously large.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/mesa/main/shader_query.cpp