From 70f8aaa0c30c640d0cce7faea9402b4e53bbfff0 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 9 Feb 2010 01:26:11 -0800 Subject: [PATCH] r300g: Fix off-by-one errors in array bounds assertions. --- src/gallium/drivers/r300/r300_fs.c | 4 ++-- src/gallium/drivers/r300/r300_vs.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c index 39bcdc8fe60..75a05498eb3 100644 --- a/src/gallium/drivers/r300/r300_fs.c +++ b/src/gallium/drivers/r300/r300_fs.c @@ -49,12 +49,12 @@ void r300_shader_read_fs_inputs(struct tgsi_shader_info* info, switch (info->input_semantic_name[i]) { case TGSI_SEMANTIC_COLOR: - assert(index <= ATTR_COLOR_COUNT); + assert(index < ATTR_COLOR_COUNT); fs_inputs->color[index] = i; break; case TGSI_SEMANTIC_GENERIC: - assert(index <= ATTR_GENERIC_COUNT); + assert(index < ATTR_GENERIC_COUNT); fs_inputs->generic[index] = i; break; diff --git a/src/gallium/drivers/r300/r300_vs.c b/src/gallium/drivers/r300/r300_vs.c index 9fbb830047f..fb81b2439b6 100644 --- a/src/gallium/drivers/r300/r300_vs.c +++ b/src/gallium/drivers/r300/r300_vs.c @@ -61,17 +61,17 @@ static void r300_shader_read_vs_outputs( break; case TGSI_SEMANTIC_COLOR: - assert(index <= ATTR_COLOR_COUNT); + assert(index < ATTR_COLOR_COUNT); vs_outputs->color[index] = i; break; case TGSI_SEMANTIC_BCOLOR: - assert(index <= ATTR_COLOR_COUNT); + assert(index < ATTR_COLOR_COUNT); vs_outputs->bcolor[index] = i; break; case TGSI_SEMANTIC_GENERIC: - assert(index <= ATTR_GENERIC_COUNT); + assert(index < ATTR_GENERIC_COUNT); vs_outputs->generic[index] = i; break; -- 2.30.2