summaryrefslogtreecommitdiffstats
path: root/src/glx/dri2_glx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/dri2_glx.c')
-rw-r--r--src/glx/dri2_glx.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index b9f6f7fcf03..506754ccc1f 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -457,6 +457,12 @@ static void
dri2FlushFrontBuffer(__DRIdrawable *driDrawable, void *loaderPrivate)
{
struct dri2_drawable *pdraw = loaderPrivate;
+ if (!pdraw)
+ return;
+
+ if (!pdraw->base.psc)
+ return;
+
struct glx_display *priv = __glXInitialize(pdraw->base.psc->dpy);
struct dri2_display *pdp = (struct dri2_display *)priv->dri2Display;
struct glx_context *gc = __glXGetCurrentContext();
@@ -675,9 +681,14 @@ dri2InvalidateBuffers(Display *dpy, XID drawable)
{
__GLXDRIdrawable *pdraw =
dri2GetGlxDrawableFromXDrawableId(dpy, drawable);
- struct dri2_screen *psc = (struct dri2_screen *) pdraw->psc;
+ struct dri2_screen *psc;
struct dri2_drawable *pdp = (struct dri2_drawable *) pdraw;
+ if (!pdraw)
+ return;
+
+ psc = (struct dri2_screen *) pdraw->psc;
+
#if __DRI2_FLUSH_VERSION >= 3
if (pdraw && psc->f && psc->f->base.version >= 3 && psc->f->invalidate)
psc->f->invalidate(pdp->driDrawable);