[vlc-commits] opengl: add extra check

Thomas Guillem git at videolan.org
Wed Dec 6 16:34:29 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Dec  6 14:22:03 2017 +0100| [47d454df266edce435f8ae6a908f7f389b77752c] | committer: Thomas Guillem

opengl: add extra check

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

 modules/video_output/opengl/vout_helper.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 02ea66d8f2..685c752d66 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -836,6 +836,13 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
     GL_ASSERT_NOERROR();
 
     const char *extensions = (const char *)vgl->vt.GetString(GL_EXTENSIONS);
+    assert(extensions);
+    if (!extensions)
+    {
+        msg_Err(gl, "glGetString returned NULL\n");
+        free(vgl);
+        return NULL;
+    }
 #if !defined(USE_OPENGL_ES2)
     const unsigned char *ogl_version = vgl->vt.GetString(GL_VERSION);
     bool supports_shaders = strverscmp((const char *)ogl_version, "2.0") >= 0;



More information about the vlc-commits mailing list