[PATCH] [weston] Don't crash when eglCreateContext fails

Kristian Høgsberg hoegsberg at gmail.com
Sun Feb 9 21:39:03 PST 2014


On Sat, Feb 08, 2014 at 08:11:24PM +0100, Mariusz Ceier wrote:
> eglCreateContext fails with every EGLConfig that
> nvidia blob 334.16 provides causing NULL pointer
> dereference in gl_renderer_destroy when destroying
> fragment and fan bindings.
> 
> This should fix #74699.

Looks good, thanks.  Committed to master.

Kristian

> Signed-off-by: Mariusz Ceier <mceier+wayland at gmail.com>
> ---
>  src/gl-renderer.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gl-renderer.c b/src/gl-renderer.c
> index d03bce6..76325f4 100644
> --- a/src/gl-renderer.c
> +++ b/src/gl-renderer.c
> @@ -1766,8 +1766,10 @@ gl_renderer_destroy(struct weston_compositor *ec)
>  	wl_array_release(&gr->vertices);
>  	wl_array_release(&gr->vtxcnt);
>  
> -	weston_binding_destroy(gr->fragment_binding);
> -	weston_binding_destroy(gr->fan_binding);
> +	if (gr->fragment_binding)
> +		weston_binding_destroy(gr->fragment_binding);
> +	if (gr->fan_binding)
> +		weston_binding_destroy(gr->fan_binding);
>  
>  	free(gr);
>  }
> -- 
> 1.8.5.4
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list