From 7d833511724c0a8fd7152591057833a287ea32a0 Mon Sep 17 00:00:00 2001 From: Neos3452 Date: Fri, 13 Mar 2015 17:04:17 +0000 Subject: [PATCH] glshader: prevent from getting attributes without vertex shader It doesn't make sense to query for vertex attributes without a vertex shader. Moreover this is causing a crash on OSX. https://bugzilla.gnome.org/show_bug.cgi?id=746168 --- gst-libs/gst/gl/gstglshader.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst-libs/gst/gl/gstglshader.c b/gst-libs/gst/gl/gstglshader.c index 143fe5e9e2..3ec1799f9f 100644 --- a/gst-libs/gst/gl/gstglshader.c +++ b/gst-libs/gst/gl/gstglshader.c @@ -1170,6 +1170,9 @@ gst_gl_shader_get_attribute_location (GstGLShader * shader, const gchar * name) g_return_val_if_fail (shader != NULL, 0); priv = shader->priv; g_return_val_if_fail (priv->program_handle != 0, 0); + if (0 == priv->vertex_handle) + return -1; + gl = shader->context->gl_vtable; return gl->GetAttribLocation (priv->program_handle, name);