aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-09-16 13:23:01 -0600
committerBrian Paul <[email protected]>2008-09-16 13:31:48 -0600
commit39cb5b9f73318a069e2d8553243ae17955a85695 (patch)
tree5fb160275ef263c074a969a5e94ab425f8e35d81 /src/mesa/vbo
parent8cdab20c9a0d8794d5d85dbeef478b982ce39506 (diff)
mesa: fix display list regression (check if save->prim_count > 0 in vbo_save_EndList())
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r--src/mesa/vbo/vbo_save_api.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index f93ef3a02a0..f69a33d8176 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -1049,12 +1049,14 @@ void vbo_save_EndList( GLcontext *ctx )
/* EndList called inside a (saved) Begin/End pair?
*/
if (ctx->Driver.CurrentSavePrimitive != PRIM_OUTSIDE_BEGIN_END) {
- GLint i = save->prim_count - 1;
- ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
- save->prim[i].end = 0;
- save->prim[i].count = (save->vert_count -
- save->prim[i].start);
+ if (save->prim_count > 0) {
+ GLint i = save->prim_count - 1;
+ ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
+ save->prim[i].end = 0;
+ save->prim[i].count = (save->vert_count -
+ save->prim[i].start);
+ }
/* Make sure this vertex list gets replayed by the "loopback"
* mechanism: