diff options
-rw-r--r-- | src/gallium/state_trackers/dri/common/dri_context.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/dri/common/dri_context.h b/src/gallium/state_trackers/dri/common/dri_context.h index 54e56c64998..b29e8533837 100644 --- a/src/gallium/state_trackers/dri/common/dri_context.h +++ b/src/gallium/state_trackers/dri/common/dri_context.h @@ -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; } diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index c3d1f2c4542..18b9035248f 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -423,6 +423,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config, return NULL; } + pdp->driContextPriv = NULL; pdp->loaderPrivate = data; pdp->hHWDrawable = hwDrawable; pdp->refcount = 1; |