From e2f61d20a29b59a0a38be64b4484a6d5e5cb3173 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 6 Nov 2014 18:37:23 +1100 Subject: [PATCH] glcontext: fail context creation if glGetString returns NULL --- gst-libs/gst/gl/gstglcontext.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c index 9ef92c8f99..a5843f58fd 100644 --- a/gst-libs/gst/gl/gstglcontext.c +++ b/gst-libs/gst/gl/gstglcontext.c @@ -1063,6 +1063,12 @@ _create_context_info (GstGLContext * context, GstGLAPI gl_api, gint * gl_major, gl = context->gl_vtable; + if (!gl->GetString || !gl->GetString (GL_VERSION)) { + g_set_error (error, GST_GL_CONTEXT_ERROR, GST_GL_CONTEXT_ERROR_FAILED, + "glGetString not defined or returned invalid value"); + return FALSE; + } + GST_INFO ("GL_VERSION: %s", GST_STR_NULL ((const gchar *) gl->GetString (GL_VERSION))); GST_INFO ("GL_SHADING_LANGUAGE_VERSION: %s", GST_STR_NULL ((const gchar *)