diff options
author | Emil Velikov <[email protected]> | 2014-01-16 16:53:45 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2014-01-18 19:17:24 +0000 |
commit | 1773611c526844cecee84dd8c8241f888666aa1c (patch) | |
tree | 42b8a2a9a59dce22e5aeac87de6a61b1061e3fe5 /src/gallium/drivers/nouveau/nv50/nv50_context.c | |
parent | 741e935a72b57cba2999239ce6d2bd3744214376 (diff) |
nv50: assert before trying to out-of-bounds access vtxbuf
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50/nv50_context.c')
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_context.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_context.c b/src/gallium/drivers/nouveau/nv50/nv50_context.c index 9ea425e4c9b..a4ec93a7a08 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_context.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_context.c @@ -80,6 +80,7 @@ nv50_context_unreference_resources(struct nv50_context *nv50) util_unreference_framebuffer_state(&nv50->framebuffer); + assert(nv50->num_vtxbufs <= PIPE_MAX_ATTRIBS); for (i = 0; i < nv50->num_vtxbufs; ++i) pipe_resource_reference(&nv50->vtxbuf[i].buffer, NULL); @@ -149,6 +150,7 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx, } if (res->bind & PIPE_BIND_VERTEX_BUFFER) { + assert(nv50->num_vtxbufs <= PIPE_MAX_ATTRIBS); for (i = 0; i < nv50->num_vtxbufs; ++i) { if (nv50->vtxbuf[i].buffer == res) { nv50->dirty |= NV50_NEW_ARRAYS; |