[Mesa-dev] [PATCH 75/84] st/nine: Fix leak with cubetexture dtor

Axel Davy axel.davy at ens.fr
Wed Dec 7 22:55:48 UTC 2016


The last level was not released.

Signed-off-by: Axel Davy <axel.davy at ens.fr>
---
 src/gallium/state_trackers/nine/cubetexture9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/nine/cubetexture9.c b/src/gallium/state_trackers/nine/cubetexture9.c
index 0a834eb..977a345 100644
--- a/src/gallium/state_trackers/nine/cubetexture9.c
+++ b/src/gallium/state_trackers/nine/cubetexture9.c
@@ -173,7 +173,7 @@ NineCubeTexture9_dtor( struct NineCubeTexture9 *This )
     DBG("This=%p\n", This);
 
     if (This->surfaces) {
-        for (i = 0; i < This->base.base.info.last_level * 6; ++i)
+        for (i = 0; i < (This->base.base.info.last_level + 1) * 6; ++i)
             NineUnknown_Destroy(&This->surfaces[i]->base.base);
         FREE(This->surfaces);
     }
-- 
2.10.2



More information about the mesa-dev mailing list