summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Slusarz <[email protected]>2010-01-12 17:39:23 +0100
committerChristoph Bumiller <[email protected]>2010-01-12 17:39:23 +0100
commit90762bd3550338368d989c0b212c10b6e33b023b (patch)
tree77798d62197b2c377cb80e264abb6ed1cba9773c
parentc83093973e7e3ffb494a9d6ce265180664497437 (diff)
nv50: fix 2 off by one memory leaks (nv50_miptree_level->image_offset)
-rw-r--r--src/gallium/drivers/nv50/nv50_miptree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c
index 3f1edf0a139..cecb1efc900 100644
--- a/src/gallium/drivers/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nv50/nv50_miptree.c
@@ -145,7 +145,7 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
mt->level[0].tile_mode, tile_flags,
&mt->base.bo);
if (ret) {
- for (l = 0; l < pt->last_level; ++l)
+ for (l = 0; l <= pt->last_level; ++l)
FREE(mt->level[l].image_offset);
FREE(mt);
return NULL;
@@ -188,7 +188,7 @@ nv50_miptree_destroy(struct pipe_texture *pt)
struct nv50_miptree *mt = nv50_miptree(pt);
unsigned l;
- for (l = 0; l < pt->last_level; ++l)
+ for (l = 0; l <= pt->last_level; ++l)
FREE(mt->level[l].image_offset);
nouveau_bo_ref(NULL, &mt->base.bo);