From: Nicolai Hähnle <nicolai.haeh...@amd.com> With a subsequent patch, we might see NULL loaderPrivates, e.g. when a DRIdrawable is flushed whose corresponding GLXDRIdrawable was destroyed. This resulted in a crash, since the loader vs. DRI3 drawable structures have a non-zero offset.
Fixes glx-visuals-{depth,stencil} -pixmap Cc: 17.0 <mesa-sta...@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.ol...@amd.com> --- src/glx/dri3_glx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index 4472a0b..f7bcba3 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -74,20 +74,22 @@ #include <sys/time.h> #include "dri_common.h" #include "dri3_priv.h" #include "loader.h" #include "dri2.h" static struct dri3_drawable * loader_drawable_to_dri3_drawable(struct loader_dri3_drawable *draw) { size_t offset = offsetof(struct dri3_drawable, loader_drawable); + if (!draw) + return NULL; return (struct dri3_drawable *)(((void*) draw) - offset); } static int glx_dri3_get_swap_interval(struct loader_dri3_drawable *draw) { struct dri3_drawable *priv = loader_drawable_to_dri3_drawable(draw); return priv->swap_interval; } -- 2.9.3 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev