u_surfaces: fix surface leak due to off by one
authorLuca Barbieri <luca@luca-barbieri.com>
Fri, 6 Aug 2010 07:53:15 +0000 (09:53 +0200)
committerLuca Barbieri <luca@luca-barbieri.com>
Wed, 11 Aug 2010 09:17:35 +0000 (11:17 +0200)
src/gallium/auxiliary/util/u_surfaces.c

index b5d21570d5715e44089587996486e3c6a7508745..f6e5801ef654753ef05fad1cce5cd366f570bd13 100644 (file)
@@ -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)