summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2014-01-16 17:34:31 +0000
committerEmil Velikov <[email protected]>2014-01-18 19:17:41 +0000
commite1e30f6dfb52b5c59ed551f13316bce0c039de79 (patch)
treef381f4e3eff4de36b4543c19e37fb883a79799be
parent3805a864b1df00ddb6053f616435326f31007663 (diff)
nv50: assert before trying to out-of-bounds access framebuffer.cbufs
Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_context.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_context.c b/src/gallium/drivers/nouveau/nv50/nv50_context.c
index 8183b01cbfb..24264d5adbe 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_context.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_context.c
@@ -130,6 +130,7 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx,
unsigned s, i;
if (res->bind & PIPE_BIND_RENDER_TARGET) {
+ assert(nv50->framebuffer.nr_cbufs <= PIPE_MAX_COLOR_BUFS);
for (i = 0; i < nv50->framebuffer.nr_cbufs; ++i) {
if (nv50->framebuffer.cbufs[i] &&
nv50->framebuffer.cbufs[i]->texture == res) {