OSDN Git Service

nv50: add missing brackets when handling the samplers array
authorEmil Velikov <emil.l.velikov@gmail.com>
Wed, 12 Mar 2014 16:22:15 +0000 (16:22 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 14 Mar 2014 13:00:01 +0000 (13:00 +0000)
commitc26b488088a459be26cfdb0b134fb058aa4c0411
tree71b2cc076d865ab6a5e3c03234be084dde23fc65
parent4d0e30accd3a17d3c484566901b028f1864d2875
nv50: add missing brackets when handling the samplers array

Commit 3805a864b1d(nv50: assert before trying to out-of-bounds access
samplers) introduced a series of asserts as a precausion of a previous
illegal memory access.

Although it failed to encapsulate loop within nv50_sampler_state_delete
effectively failing to clear the sampler state, apart from exadurating
the illegal memory access issue.

Fixes gcc warning "array subscript is above array bounds" and
"Nesting level does not match indentation" and "Out-of-bounds read"
defects reported by Coverity.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nv50/nv50_state.c