[vlc-commits] opengl: add extra check
Thomas Guillem
git at videolan.org
Thu Dec 7 09:28:15 CET 2017
vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Dec 6 14:22:03 2017 +0100| [d114c3a2fbe135fdb6d6a22722c1d3a5f3097c7e] | committer: Thomas Guillem
opengl: add extra check
(cherry picked from commit 47d454df266edce435f8ae6a908f7f389b77752c)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=d114c3a2fbe135fdb6d6a22722c1d3a5f3097c7e
---
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