Mesa (master): draw: Mask out vertex flags in GS and stream output.
Chia-I Wu
olv at kemper.freedesktop.org
Fri Aug 6 05:53:01 UTC 2010
Module: Mesa
Branch: master
Commit: f1fc444bb05421404f42e8d08e9085c6fb6ce7a9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f1fc444bb05421404f42e8d08e9085c6fb6ce7a9
Author: Chia-I Wu <olv at lunarg.com>
Date: Wed Aug 4 14:39:16 2010 +0800
draw: Mask out vertex flags in GS and stream output.
This fixes out-of-bound access to the vertices.
---
src/gallium/auxiliary/draw/draw_gs.c | 2 +-
src/gallium/auxiliary/draw/draw_pt_so_emit.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c
index f2535c5..4a1013e 100644
--- a/src/gallium/auxiliary/draw/draw_gs.c
+++ b/src/gallium/auxiliary/draw/draw_gs.c
@@ -380,7 +380,7 @@ static void gs_tri_adj(struct draw_geometry_shader *shader,
#define FUNC gs_run_elts
#define LOCAL_VARS const ushort *elts = input_prims->elts;
-#define GET_ELT(idx) (elts[idx])
+#define GET_ELT(idx) (elts[idx] & ~DRAW_PIPE_FLAG_MASK)
#include "draw_gs_tmp.h"
diff --git a/src/gallium/auxiliary/draw/draw_pt_so_emit.c b/src/gallium/auxiliary/draw/draw_pt_so_emit.c
index c86bdd9..f7f4f24 100644
--- a/src/gallium/auxiliary/draw/draw_pt_so_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_so_emit.c
@@ -225,7 +225,7 @@ static void so_tri(struct pt_so_emit *so, int i0, int i1, int i2)
#define FUNC so_run_elts
#define LOCAL_VARS const ushort *elts = input_prims->elts;
-#define GET_ELT(idx) (elts[start + (idx)])
+#define GET_ELT(idx) (elts[start + (idx)] & ~DRAW_PIPE_FLAG_MASK)
#include "draw_so_emit_tmp.h"
More information about the mesa-commit
mailing list