intel: Fix improper freeing of texture data in TFP.
authorEric Anholt <eric@anholt.net>
Wed, 21 Sep 2011 22:17:36 +0000 (15:17 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 26 Sep 2011 22:33:42 +0000 (15:33 -0700)
If there happened to be ->Data present, we assertion failed instead of
handling it correctly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35234
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/intel/intel_tex_image.c

index 15196c0ebcc7498062fdc9313f376aa0551ab9eb..30e1776baa917b53282d076a1e23b581936bdfc4 100644 (file)
@@ -686,10 +686,7 @@ intel_set_texture_image_region(struct gl_context *ctx,
                              region->width, region->height, 1,
                              0, internalFormat, format);
 
-   if (intel_image->mt) {
-      intel_miptree_release(intel, &intel_image->mt);
-      assert(!image->Data);
-   }
+   ctx->Driver.FreeTextureImageBuffer(ctx, image);
 
    intel_image->mt = intel_miptree_create_for_region(intel, target,
                                                     image->TexFormat,