summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2010-04-16 00:35:30 -0700
committerVinson Lee <vlee@vmware.com>2010-04-16 00:36:50 -0700
commit8c456775887e192dd7464b94295f4410045c7c07 (patch)
tree7b636dedb54440069d38e7ded2c2a3cded7ac955
parente0543599b583ab93c28fff7c91cfc527051b45b1 (diff)
drisw: Move pointer dereferences to after NULL checks.
-rw-r--r--src/mesa/drivers/dri/swrast/swrast.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index 8b68281fab..6f54981eba 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;