Mesa (master): st/mesa: fix setup_edgeflags() regression

Brian Paul brianp at kemper.freedesktop.org
Mon Jun 22 23:49:31 UTC 2009


Module: Mesa
Branch: master
Commit: a31118c25a0e2b95008683ca4be2ca635f0dbfa4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a31118c25a0e2b95008683ca4be2ca635f0dbfa4

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Jun 22 17:49:22 2009 -0600

st/mesa: fix setup_edgeflags() regression

stobj is now non-null for the default/null buffer object.  Update the
test to check the buffer ID to see if it's a real buffer object.

---

 src/mesa/state_tracker/st_draw.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 8e03622..914a507 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -229,8 +229,10 @@ setup_edgeflags(GLcontext *ctx, GLenum primMode, GLint start, GLint count,
       struct st_buffer_object *stobj = st_buffer_object(array->BufferObj);
       ubyte *map;
 
-      if (!stobj)
+      if (!stobj || stobj->Base.Name == 0) {
+         /* edge flags are not in a VBO */
          return NULL;
+      }
 
       vec = (unsigned *) _mesa_calloc(sizeof(unsigned) * ((count + 31) / 32));
       if (!vec)




More information about the mesa-commit mailing list