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

Alexandre Janniaux git at videolan.org
Thu Dec 12 13:05:02 CET 2019


vlc/vlc-3.0 | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Mon Dec  9 17:12:59 2019 +0100| [8ffb52d0f486e377098b67cb6571fbe803de007f] | 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>
(cherry picked from commit d31777d83a94c63ed6b06d66fe56da4476bf5e78)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 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 10277c5045..7c8dcbb785 100644
--- a/modules/video_output/opengl/egl.c
+++ b/modules/video_output/opengl/egl.c
@@ -238,6 +238,7 @@ static int Open (vlc_object_t *obj, 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