diff options
author | Emil Velikov <[email protected]> | 2014-01-16 17:08:19 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2014-01-18 19:17:34 +0000 |
commit | 6a53b81086bd80ad5a5e79939e0aeb208253026a (patch) | |
tree | 7cbb229d7415f3ed857af46f5e083f52b07cde46 /src/gallium/drivers/nouveau/nv50/nv50_state.c | |
parent | 19069803bed95e64bf43185e7f02550ebbf92dde (diff) |
nv50: assert before trying to out-of-bounds access textures
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50/nv50_state.c')
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_state.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c index 6b5a28893d4..c59a096f1c9 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_state.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c @@ -646,6 +646,7 @@ nv50_stage_set_sampler_views(struct nv50_context *nv50, int s, { unsigned i; + assert(nr <= PIPE_MAX_SAMPLERS); for (i = 0; i < nr; ++i) { struct nv50_tic_entry *old = nv50_tic_entry(nv50->textures[s][i]); if (old) @@ -654,6 +655,7 @@ nv50_stage_set_sampler_views(struct nv50_context *nv50, int s, pipe_sampler_view_reference(&nv50->textures[s][i], views[i]); } + assert(nv50->num_textures[s] <= PIPE_MAX_SAMPLERS); for (i = nr; i < nv50->num_textures[s]; ++i) { struct nv50_tic_entry *old = nv50_tic_entry(nv50->textures[s][i]); if (!old) |