From: Brian Date: Wed, 12 Dec 2007 21:45:22 +0000 (-0700) Subject: move some code to avoid deref of NULL ptr X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a51d0e419a285c5445061a38fdaf3aca02ad2c3c;p=mesa.git move some code to avoid deref of NULL ptr --- 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 ||