aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStéphane Marchesin <[email protected]>2012-08-14 17:15:54 -0700
committerIan Romanick <[email protected]>2012-10-24 11:41:06 -0700
commitbb2fa7ef06fd79be9f958d8b94bc87093eece655 (patch)
treea8d2b76e553e16219a420a7a2972c60e1e20992b /src
parentb75d5c671f95116c61c44729b04db19b076e9cfc (diff)
glsl/linker: Avoid buffer over-run in parcel_out_uniform_storage::visit_field
When too may uniforms are used, the error will be caught in check_resources (src/glsl/linker.cpp). NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Stéphane Marchesin <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Tested-by: Benoit Jacob <[email protected]> (cherry picked from commit ff996cafce511dd8a6c4e066e409c23e147a670c)
Diffstat (limited to 'src')
-rw-r--r--src/glsl/link_uniforms.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index 588008a8b48..e14172ce9fa 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -275,7 +275,7 @@ private:
const gl_texture_index target = base_type->sampler_index();
const unsigned shadow = base_type->sampler_shadow;
for (unsigned i = this->uniforms[id].sampler
- ; i < this->next_sampler
+ ; i < MIN2(this->next_sampler, MAX_SAMPLERS)
; i++) {
this->targets[i] = target;
this->shader_samplers_used |= 1U << i;