summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2014-01-16 15:37:53 +0000
committerEmil Velikov <[email protected]>2014-01-18 19:17:09 +0000
commit12e744abbb9fd8cb07a12954aaa7127521d5af0a (patch)
tree478436038dab8f03645852fb446f4d8d44bb3c66 /src/gallium/drivers
parentd606ca37eb20f18d8ac4727c68831fcecb2f7de4 (diff)
nv50: access only the available amount of constbuf
The textures array is defined as a number of NV50_MAX_PIPE_CONSTBUFS per shader stage. Currently the nv50 driver handles only 3 shader stages, thus we wreck chaos when accessing array-out-of-bounds. Cc: 9.1 9.2 10.0 <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_context.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_context.c b/src/gallium/drivers/nouveau/nv50/nv50_context.c
index eb345dc24bc..bd00b501446 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_context.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_context.c
@@ -179,7 +179,7 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx,
}
if (res->bind & PIPE_BIND_CONSTANT_BUFFER) {
- for (s = 0; s < 5; ++s) {
+ for (s = 0; s < 3; ++s) {
for (i = 0; i < nv50->num_vtxbufs; ++i) {
if (!nv50->constbuf[s][i].user &&
nv50->constbuf[s][i].u.buf == res) {