mesa/uniform_query: Don't write to *params if there is an error
authorMatt Turner <mattst88@gmail.com>
Sat, 8 Dec 2012 00:32:30 +0000 (16:32 -0800)
committerAndreas Boll <andreas.boll.dev@gmail.com>
Wed, 13 Feb 2013 17:46:38 +0000 (18:46 +0100)
commit5f8a8716b6b58a470be0b0d176e38d37eda2c8f7
tree90094ca7f22bbe98c1a84e91d752ee48d754369c
parent460096f5da820d3701cf7ca2800d94ef00b5967e
mesa/uniform_query: Don't write to *params if there is an error

The GL 3.1 and ES 3.0 specs say of glGetActiveUniformsiv:
   "If an error occurs, nothing will be written to params."

So, make a pass through the indices and check that they're valid before
the pass that actually writes to params. Checking pname happens on the
first iteration of the second loop.

Fixes es3conform's getactiveuniformsiv_for_nonexistent_uniform_indices
test.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 11cea472466f731fa9c44d56f1643dec26e6601c)
src/mesa/main/uniform_query.cpp