mesa: Don't check for image->Data when freeing an image's contents.
authorEric Anholt <eric@anholt.net>
Wed, 27 Jul 2011 21:40:08 +0000 (14:40 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 29 Aug 2011 17:10:03 +0000 (10:10 -0700)
commit68f8cf72638e974a5bf2ae3e88c2e3539d88e2b6
tree2b0ab3376ffadcf7281c6f9d122a5c4297610166
parent5401590815b0ef095e7881bbabce233bab07c1e6
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>
src/mesa/main/mipmap.c
src/mesa/main/teximage.c
src/mesa/state_tracker/st_gen_mipmap.c