From: Vinson Lee Date: Fri, 16 Apr 2010 07:35:30 +0000 (-0700) Subject: drisw: Move pointer dereferences to after NULL checks. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8c456775887e192dd7464b94295f4410045c7c07;p=mesa.git drisw: Move pointer dereferences to after NULL checks. --- diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 8b68281fab0..6f54981eba1 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -602,12 +602,14 @@ dri_make_current(__DRIcontext * cPriv, if (cPriv) { struct dri_context *ctx = dri_context(cPriv); - struct dri_drawable *draw = dri_drawable(driDrawPriv); - struct dri_drawable *read = dri_drawable(driReadPriv); + struct dri_drawable *draw; + struct dri_drawable *read; if (!driDrawPriv || !driReadPriv) return GL_FALSE; + draw = dri_drawable(driDrawPriv); + read = dri_drawable(driReadPriv); mesaCtx = &ctx->Base; mesaDraw = &draw->Base; mesaRead = &read->Base;