[Mesa-dev] [PATCH] glsl: fix a bug with loop counter in find_empty_block

Tapani Pälli tapani.palli at intel.com
Wed Jan 20 03:42:01 PST 2016


Reported-by: Ilia Mirkin <imirkin at alum.mit.edu>
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 src/glsl/link_uniforms.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index 76ee70d..23b3d66 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -1069,7 +1069,7 @@ find_empty_block(struct gl_shader_program *prog,
    for (unsigned i = 0, j; i < prog->NumUniformRemapTable; i++) {
       /* We found empty space in UniformRemapTable. */
       if (prog->UniformRemapTable[i] == NULL) {
-         for (j = i; j < entries && j < prog->NumUniformRemapTable; j++) {
+         for (j = i; j - i < entries && j < prog->NumUniformRemapTable; j++) {
             if (prog->UniformRemapTable[j] != NULL) {
                /* Entries do not fit in this space, continue searching
                 * after this location.
-- 
2.5.0



More information about the mesa-dev mailing list