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 54e56c6499801f8265a5fa9e5c539213cf5d0ecd..b29e8533837a50df2a705f6512cb6a80eb875d95 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 c3d1f2c4542bc227664742ec495b18580a9a2ade..18b9035248f7c735273587ef367e34af504c3d1a 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;