From: Vinson Lee Date: Fri, 16 Apr 2010 06:15:05 +0000 (-0700) Subject: st/mesa: Move dereference and assignment to after NULL check. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b8c4f22d4fd78829dd5843db92321ec0665932e;p=mesa.git st/mesa: Move dereference and assignment to after NULL check. --- diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 196bf1325fb..9479819e833 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1213,10 +1213,11 @@ st_CompressedTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, int srcBlockStride; int dstBlockStride; int y; - enum pipe_format pformat= stImage->pt->format; + enum pipe_format pformat; if (stImage->pt) { unsigned face = _mesa_tex_target_to_face(target); + pformat = stImage->pt->format; st_teximage_flush_before_map(ctx->st, stImage->pt, face, level, PIPE_TRANSFER_WRITE);