aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_draw.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_draw.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c
index 11ebd067e..6530a06ad 100644
--- a/mesalib/src/mesa/state_tracker/st_draw.c
+++ b/mesalib/src/mesa/state_tracker/st_draw.c
@@ -315,10 +315,13 @@ setup_interleaved_attribs(struct gl_context *ctx,
const GLubyte *low_addr = NULL;
/* Find the lowest address. */
- for (attr = 0; attr < vpv->num_inputs; attr++) {
- const GLubyte *start = arrays[vp->index_to_input[attr]]->Ptr;
+ if(vpv->num_inputs) {
+ low_addr = arrays[vp->index_to_input[0]]->Ptr;
- low_addr = !low_addr ? start : MIN2(low_addr, start);
+ for (attr = 1; attr < vpv->num_inputs; attr++) {
+ const GLubyte *start = arrays[vp->index_to_input[attr]]->Ptr;
+ low_addr = MIN2(low_addr, start);
+ }
}
for (attr = 0; attr < vpv->num_inputs; attr++) {