[vlc-commits] egl: initialize context for error handling

Alexandre Janniaux git at videolan.org
Thu Dec 12 13:04:03 CET 2019


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Mon Dec  9 17:12:59 2019 +0100| [d31777d83a94c63ed6b06d66fe56da4476bf5e78] | committer: Thomas Guillem

egl: initialize context for error handling

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

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d31777d83a94c63ed6b06d66fe56da4476bf5e78
---

 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;
 



More information about the vlc-commits mailing list