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

Ilia Mirkin imirkin at alum.mit.edu
Wed Jan 20 03:44:18 PST 2016


Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

I still hate this whole thing and think it should be reverted. But
I'll wait until the US wakes up to gather more opinions before doing
so.

  -ilia

On Wed, Jan 20, 2016 at 6:42 AM, Tapani Pälli <tapani.palli at intel.com> wrote:
> 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
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list