From cbb915816249a68c34e8a290ca89c8aae669c461 Mon Sep 17 00:00:00 2001 From: Mariusz Ceier Date: Sat, 8 Feb 2014 20:11:24 +0100 Subject: [PATCH] Don't crash when eglCreateContext fails 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. https://bugs.freedesktop.org/show_bug.cgi?id=74699 Signed-off-by: Mariusz Ceier --- 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 d03bce64..76325f4f 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); }