diff options
author | Eric Anholt <eric@anholt.net> | 2011-07-27 14:40:08 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2011-08-29 10:10:03 -0700 |
commit | 68f8cf72638e974a5bf2ae3e88c2e3539d88e2b6 (patch) | |
tree | 2b0ab3376ffadcf7281c6f9d122a5c4297610166 /src/mesa/main/mipmap.c | |
parent | 5401590815b0ef095e7881bbabce233bab07c1e6 (diff) |
mesa: Don't check for image->Data when freeing an image's contents.
All driver implementations of FreeTextureImageBuffer already check
that Data != NULL and free it. However, this means that we will also
free driver storage if the driver storage wasn't in the form of a Data
pointer.
This was produced by the following semantic patch:
@@
expression C;
expression T;
@@
- if (T->Data) {
- C->Driver.FreeTextureImageBuffer(C, T);
+ C->Driver.FreeTextureImageBuffer(C, T);
- }
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/main/mipmap.c')
-rw-r--r-- | src/mesa/main/mipmap.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 611f3755010..cf9d522f2f1 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1948,8 +1948,7 @@ generate_mipmap_uncompressed(struct gl_context *ctx, GLenum target, } /* Free old image data */ - if (dstImage->Data) - ctx->Driver.FreeTextureImageBuffer(ctx, dstImage); + ctx->Driver.FreeTextureImageBuffer(ctx, dstImage); /* initialize new image */ _mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight, |