drisw: Move pointer dereferences to after NULL checks.
authorVinson Lee <vlee@vmware.com>
Fri, 16 Apr 2010 07:35:30 +0000 (00:35 -0700)
committerVinson Lee <vlee@vmware.com>
Fri, 16 Apr 2010 07:36:50 +0000 (00:36 -0700)
src/mesa/drivers/dri/swrast/swrast.c

index 8b68281fab0c39255f4d8248bca98c02bfaf3ac2..6f54981eba159bf4bb09d9709a04cdd1586c1ad2 100644 (file)
@@ -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;