glx: Move deref after NULL check
authorKristian Høgsberg <krh@bitplanet.net>
Wed, 4 Aug 2010 16:50:36 +0000 (12:50 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 4 Aug 2010 16:51:26 +0000 (12:51 -0400)
src/glx/dri2_glx.c

index 99384f8c371fce73c85c09eba36f6ceae2ffd99c..ff48c79c272e12a85834b5eba87c62fab80741da 100644 (file)
@@ -657,9 +657,10 @@ dri2_bind_tex_image(Display * dpy,
    struct dri2_drawable *pdraw = (struct dri2_drawable *) base;
    struct dri2_display *pdp =
       (struct dri2_display *) dpyPriv->dri2Display;
-   struct dri2_screen *psc = (struct dri2_screen *) base->psc;
+   struct dri2_screen *psc;
 
    if (pdraw != NULL) {
+      psc = (struct dri2_screen *) base->psc;
 
 #if __DRI2_FLUSH_VERSION >= 3
       if (!pdp->invalidateAvailable && psc->f)