From 8c456775887e192dd7464b94295f4410045c7c07 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 16 Apr 2010 00:35:30 -0700 Subject: [PATCH] drisw: Move pointer dereferences to after NULL checks. --- src/mesa/drivers/dri/swrast/swrast.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.30.2