projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a3ac28a
)
u_vbuf_mgr: fix max_index computation when src_offset is abused as buffer_offset
author
Marek Olšák
<maraeo@gmail.com>
Mon, 16 May 2011 23:16:27 +0000
(
01:16
+0200)
committer
Marek Olšák
<maraeo@gmail.com>
Mon, 16 May 2011 23:21:30 +0000
(
01:21
+0200)
src/gallium/auxiliary/util/u_vbuf_mgr.c
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/util/u_vbuf_mgr.c
b/src/gallium/auxiliary/util/u_vbuf_mgr.c
index a034483ee5c4272bf1e8987fab1029c9d29504b7..04149525ea778fde8aa6cf14786ce49b151273ab 100644
(file)
--- 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 =