From 21ec35566be2c1aca07083a67f462618ae15fa86 Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Thu, 2 Feb 2017 18:01:06 +0100 Subject: glx/dri3: guard in_current_context against a disappeared drawable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: 17.0 Reviewed-by: Emil Velikov Reviewed-by: Marek Olšák --- src/glx/dri3_glx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index f7bcba32f3e..2d40f0ad458 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -119,6 +119,10 @@ static bool glx_dri3_in_current_context(struct loader_dri3_drawable *draw) { struct dri3_drawable *priv = loader_drawable_to_dri3_drawable(draw); + + if (!priv) + return false; + struct dri3_context *pcp = (struct dri3_context *) __glXGetCurrentContext(); struct dri3_screen *psc = (struct dri3_screen *) priv->base.psc; -- cgit v1.2.3