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

Vinson Lee vlee at freedesktop.org
Sat Dec 15 00:20:52 PST 2012


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;
         }
-- 
1.8.0.1



More information about the Piglit mailing list