[vlc-devel] [PATCH] egl: initialize context for error handling

Alexandre Janniaux ajanni at videolabs.io
Mon Dec 9 17:12:59 CET 2019


Otherwise, we end up calling eglDestroyContext with a bad value in the
case the surface cannot be create. Not being able to create the surface
isn't even rare as it can happen if the format we required is not supported.

Harmless regression from f5a766e3699f19f3a37f6331e62bdc5de0e7fd04
---
 modules/video_output/opengl/egl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/video_output/opengl/egl.c b/modules/video_output/opengl/egl.c
index 53d770365a..c1c19462c9 100644
--- a/modules/video_output/opengl/egl.c
+++ b/modules/video_output/opengl/egl.c
@@ -216,6 +216,7 @@ static int Open(vlc_gl_t *gl, const struct gl_api *api,
     gl->sys = sys;
     sys->display = EGL_NO_DISPLAY;
     sys->surface = EGL_NO_SURFACE;
+    sys->context = EGL_NO_CONTEXT;
     sys->eglCreateImageKHR = NULL;
     sys->eglDestroyImageKHR = NULL;
 
-- 
2.24.0



More information about the vlc-devel mailing list