summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-12-12 14:45:22 -0700
committerBrian <[email protected]>2007-12-12 14:45:22 -0700
commita51d0e419a285c5445061a38fdaf3aca02ad2c3c (patch)
tree65abc015c4a5c2059ebd14fc034315ff915decc3 /src/mesa/pipe
parent06036bc8c4d31d36f2e143f5d7f2db866f44b342 (diff)
move some code to avoid deref of NULL ptr
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_tile_cache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/pipe/softpipe/sp_tile_cache.c b/src/mesa/pipe/softpipe/sp_tile_cache.c
index 25c6dd4d173..d637c7291f6 100644
--- a/src/mesa/pipe/softpipe/sp_tile_cache.c
+++ b/src/mesa/pipe/softpipe/sp_tile_cache.c
@@ -147,10 +147,10 @@ sp_tile_cache_set_surface(struct softpipe_tile_cache *tc,
pipe_surface_reference(&tc->surface, ps);
- if (!ps->map)
- pipe_surface_map(ps);
-
if (ps) {
+ if (!ps->map)
+ pipe_surface_map(ps);
+
tc->depth_stencil = (ps->format == PIPE_FORMAT_S8Z24_UNORM ||
ps->format == PIPE_FORMAT_Z16_UNORM ||
ps->format == PIPE_FORMAT_Z32_UNORM ||