Skip to content
Snippets Groups Projects
Commit 12e744ab authored by Emil Velikov's avatar Emil Velikov
Browse files

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 <mesa-stable@lists.freedesktop.org>
Signed-off-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: default avatarIlia Mirkin <imirkin@alum.mit.edu>
parent d606ca37
No related branches found
No related tags found
No related merge requests found
...@@ -179,7 +179,7 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx, ...@@ -179,7 +179,7 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx,
} }
if (res->bind & PIPE_BIND_CONSTANT_BUFFER) { 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) { for (i = 0; i < nv50->num_vtxbufs; ++i) {
if (!nv50->constbuf[s][i].user && if (!nv50->constbuf[s][i].user &&
nv50->constbuf[s][i].u.buf == res) { nv50->constbuf[s][i].u.buf == res) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment