r300g: Fix off-by-one errors in array bounds assertions.
authorVinson Lee <vlee@vmware.com>
Tue, 9 Feb 2010 09:26:11 +0000 (01:26 -0800)
committerVinson Lee <vlee@vmware.com>
Tue, 9 Feb 2010 09:26:11 +0000 (01:26 -0800)
src/gallium/drivers/r300/r300_fs.c
src/gallium/drivers/r300/r300_vs.c

index 39bcdc8fe60c9e6837262a366dd2fd7b376d8bcf..75a05498eb32c22b01a8d84941aa16a7f98b8b28 100644 (file)
@@ -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;
 
index 9fbb830047f2b1f40bb50301891678b5fc44c4b6..fb81b2439b6fd13a925fdf9b33bdd225564008ea 100644 (file)
@@ -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;