From 24f5ebb1d735ca7e8944b346359de5941e707047 Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Fri, 6 Aug 2010 09:53:15 +0200 Subject: [PATCH] u_surfaces: fix surface leak due to off by one --- src/gallium/auxiliary/util/u_surfaces.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/util/u_surfaces.c b/src/gallium/auxiliary/util/u_surfaces.c index b5d21570d57..f6e5801ef65 100644 --- a/src/gallium/auxiliary/util/u_surfaces.c +++ b/src/gallium/auxiliary/util/u_surfaces.c @@ -99,7 +99,7 @@ util_surfaces_destroy(struct util_surfaces *us, struct pipe_resource *pt, void ( if(us->u.array) { unsigned i; - for(i = 0; i < pt->last_level; ++i) + for(i = 0; i <= pt->last_level; ++i) { struct pipe_surface *ps = us->u.array[i]; if(ps) -- 2.30.2