diff options
author | Stéphane Marchesin <marcheu@chromium.org> | 2012-08-14 17:15:54 -0700 |
---|---|---|
committer | Stéphane Marchesin <marcheu@chromium.org> | 2012-08-23 11:42:19 -0700 |
commit | ff996cafce511dd8a6c4e066e409c23e147a670c (patch) | |
tree | caa16dc434175df70044c999c0b77c37f1a78414 | |
parent | 9b028faeaa2c4b0ca2e86892aac70a2f2b872fbb (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 <marcheu@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Benoit Jacob <bjacob@mozilla.com>
-rw-r--r-- | src/glsl/link_uniforms.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index 25dc1d7dc55..eef9025cf28 100644 --- a/src/glsl/link_uniforms.cpp +++ b/src/glsl/link_uniforms.cpp | |||
@@ -313,7 +313,7 @@ private: | |||
313 | const gl_texture_index target = base_type->sampler_index(); | 313 | const gl_texture_index target = base_type->sampler_index(); |
314 | const unsigned shadow = base_type->sampler_shadow; | 314 | const unsigned shadow = base_type->sampler_shadow; |
315 | for (unsigned i = this->uniforms[id].sampler | 315 | for (unsigned i = this->uniforms[id].sampler |
316 | ; i < this->next_sampler | 316 | ; i < MIN2(this->next_sampler, MAX_SAMPLERS) |
317 | ; i++) { | 317 | ; i++) { |
318 | this->targets[i] = target; | 318 | this->targets[i] = target; |
319 | this->shader_samplers_used |= 1U << i; | 319 | this->shader_samplers_used |= 1U << i; |