summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2010-07-22 18:32:50 +0200
committerMichal Krol <[email protected]>2010-07-23 16:20:37 +0200
commit8122baf8badfa9fe7a80bfc904ad7b6ddcdecb0c (patch)
tree03469b6497809591da036adb5a4bc2c7106172a7 /src/gallium/drivers
parenta0fc83b277ad26d63545996b2affa7da6772e32a (diff)
softpipe: Check for NULL pointer in sp_destroy_tile_cache().
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index d7bc356e507..bf33fd94173 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -115,16 +115,18 @@ sp_create_tile_cache( struct pipe_context *pipe )
void
sp_destroy_tile_cache(struct softpipe_tile_cache *tc)
{
- uint pos;
+ if (tc) {
+ uint pos;
- for (pos = 0; pos < NUM_ENTRIES; pos++) {
- /*assert(tc->entries[pos].x < 0);*/
- }
- if (tc->transfer) {
- tc->pipe->transfer_destroy(tc->pipe, tc->transfer);
- }
+ for (pos = 0; pos < NUM_ENTRIES; pos++) {
+ /*assert(tc->entries[pos].x < 0);*/
+ }
+ if (tc->transfer) {
+ tc->pipe->transfer_destroy(tc->pipe, tc->transfer);
+ }
- FREE( tc );
+ FREE( tc );
+ }
}