Mesa (master): u_vbuf_mgr: fix max_index computation when src_offset is abused as buffer_offset
Marek Olšák
mareko at kemper.freedesktop.org
Mon May 16 23:21:52 UTC 2011
Module: Mesa
Branch: master
Commit: 390196ecc73cd5d6bed48bf460d1abf70deb0eb4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=390196ecc73cd5d6bed48bf460d1abf70deb0eb4
Author: Marek Olšák <maraeo at gmail.com>
Date: Tue May 17 01:16:27 2011 +0200
u_vbuf_mgr: fix max_index computation when src_offset is abused as buffer_offset
---
src/gallium/auxiliary/util/u_vbuf_mgr.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_vbuf_mgr.c b/src/gallium/auxiliary/util/u_vbuf_mgr.c
index a034483..0414952 100644
--- a/src/gallium/auxiliary/util/u_vbuf_mgr.c
+++ b/src/gallium/auxiliary/util/u_vbuf_mgr.c
@@ -581,7 +581,12 @@ static void u_vbuf_mgr_compute_max_index(struct u_vbuf_mgr_priv *mgr)
* for that when dividing by stride. */
unused = vb->stride -
(mgr->ve->ve[i].src_offset + mgr->ve->src_format_size[i]);
- assert(unused >= 0);
+
+ /* If src_offset is greater than stride (which means it's a buffer
+ * offset rather than a vertex offset)... */
+ if (unused < 0) {
+ unused = 0;
+ }
/* Compute the maximum index for this vertex element. */
max_index =
More information about the mesa-commit
mailing list