[Piglit] [PATCH] glsl-routing: Fix off-by-one error in for loop.

Brian Paul brian.e.paul at gmail.com
Sun Dec 16 08:59:19 PST 2012


On Sat, Dec 15, 2012 at 1:20 AM, Vinson Lee <vlee at freedesktop.org> wrote:
> Fixes out-of-bounds read defect reported by Coverity.
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  tests/shaders/glsl-routing.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/shaders/glsl-routing.c b/tests/shaders/glsl-routing.c
> index 4b7e46f..5a1b5d9 100644
> --- a/tests/shaders/glsl-routing.c
> +++ b/tests/shaders/glsl-routing.c
> @@ -213,7 +213,7 @@ static GLboolean test(unsigned vsbitmask, unsigned fsbitmask, int line)
>      }
>      assert(glGetError() == 0);
>
> -    for (i = 0; i <= ATTRIBS; i++) {
> +    for (i = 0; i < ATTRIBS; i++) {
>          if (((1 << i) & vsbitmask) && ((1 << i) & fsbitmask)) {
>              pass = piglit_probe_pixel_rgb(7 + (i*(BOX_SIZE+5)), 7 + height, &input[i*4]) && pass;
>          }

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the Piglit mailing list