gallium: fix TFP on gallium
authorDave Airlie <airlied@redhat.com>
Mon, 31 May 2010 09:24:50 +0000 (19:24 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 31 May 2010 09:28:08 +0000 (19:28 +1000)
This fixes an uninitialised value use in the dri2 st when doing TFP.

It uses the driContextPriv which isn't initialised at alloc time.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/state_trackers/dri/common/dri_context.h
src/mesa/drivers/dri/common/dri_util.c

index 54e56c6..b29e853 100644 (file)
@@ -65,6 +65,8 @@ struct dri_context
 static INLINE struct dri_context *
 dri_context(__DRIcontext * driContextPriv)
 {
+   if (!driContextPriv)
+     return NULL;
    return (struct dri_context *)driContextPriv->driverPrivate;
 }
 
index c3d1f2c..18b9035 100644 (file)
@@ -423,6 +423,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config,
        return NULL;
     }
 
+    pdp->driContextPriv = NULL;
     pdp->loaderPrivate = data;
     pdp->hHWDrawable = hwDrawable;
     pdp->refcount = 1;