diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 5381cc4..0a8289a 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -374,10 +374,16 @@ void vbo_exec_vtx_flush( struct vbo_exec_context *exec, if (unmap) exec->vtx.max_vert = 0; - else - exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) / - (exec->vtx.vertex_size * sizeof(GLfloat))); - + else { + if (exec->vtx.vertex_size != 0) { + exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) / + (exec->vtx.vertex_size * sizeof(GLfloat))); + } + else { + exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) / + sizeof(GLfloat)); + } + } exec->vtx.buffer_ptr = exec->vtx.buffer_map; exec->vtx.prim_count = 0;