[Mesa-dev] [PATCH] egl/dri3: don't crash on no context.

Marek Olšák maraeo at gmail.com
Sun May 29 23:33:50 UTC 2016


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Candidate for stable?

Marek

On Mon, May 30, 2016 at 12:02 AM, Dave Airlie <airlied at gmail.com> wrote:
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94925
>
> Pointed out by Karol Herbst on irc.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/egl/drivers/dri2/platform_x11_dri3.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c
> index 8e4a131..9363a8a 100644
> --- a/src/egl/drivers/dri2/platform_x11_dri3.c
> +++ b/src/egl/drivers/dri2/platform_x11_dri3.c
> @@ -96,8 +96,10 @@ static __DRIcontext *
>  egl_dri3_get_dri_context(struct loader_dri3_drawable *draw)
>  {
>     _EGLContext *ctx = _eglGetCurrentContext();
> -   struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
> -
> +   struct dri2_egl_context *dri2_ctx;
> +   if (!ctx)
> +      return NULL;
> +   dri2_ctx = dri2_egl_context(ctx);
>     return dri2_ctx->dri_context;
>  }
>
> --
> 2.5.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list