From f6a786c6eae56a273305071c7238f0959b77e4f4 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 11 Mar 2015 14:32:05 +1000 Subject: [PATCH] renderer: allow binding 0 vbos This was broken calculation, we should allow binding 0 vbos. --- src/vrend_decode.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/vrend_decode.c b/src/vrend_decode.c index 296b26b..1da942c 100644 --- a/src/vrend_decode.c +++ b/src/vrend_decode.c @@ -257,14 +257,13 @@ static int vrend_decode_set_vertex_buffers(struct vrend_decode_ctx *ctx, uint16_ int num_vbo; int i; - if (length < 3) - return EINVAL; - /* must be a multiple of 3 */ - if (length % 3) + if (length && (length % 3)) return EINVAL; num_vbo = (length / 3); + if (num_vbo > PIPE_MAX_ATTRIBS) + return EINVAL; for (i = 0; i < num_vbo; i++) { vrend_set_single_vbo(ctx->grctx, i,