Module: Mesa
Branch: master
Commit: ff996cafce511dd8a6c4e066e409c23e147a670c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ff996cafce511dd8a6c4e066e409c23e147a670c

Author: Stéphane Marchesin <marc...@chromium.org>
Date:   Tue Aug 14 17:15:54 2012 -0700

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 <marc...@chromium.org>
Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>
Tested-by: Benoit Jacob <bja...@mozilla.com>

---

 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 25dc1d7..eef9025 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -313,7 +313,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;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to