Skip to contentSkip to conversation

nv50: fix nv50_sampler_state_delete array overflow

PATCH New Marcin Slusarz 1 participant 1 message Jun 5, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nv50: fix nv50_sampler_state_delete array overflow

num_samplers is array of 3 elements, not 5

---
 src/gallium/drivers/nv50/nv50_state.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/gallium/drivers/nv50/nv50_state.c +1 -1
index 799f496..8b54d9f 100644
@@ -478,7 +478,7 @@ nv50_sampler_state_delete(struct pipe_context *pipe, void *hwcso)
 {
    unsigned s, i;
 
-   for (s = 0; s < 5; ++s)
+   for (s = 0; s < 3; ++s)
       for (i = 0; i < nv50_context(pipe)->num_samplers[s]; ++i)
          if (nv50_context(pipe)->samplers[s][i] == hwcso)
             nv50_context(pipe)->samplers[s][i] = NULL;
Signature · 1 line
1.7.4.1