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
This commit is contained in:
Neos3452 2015-03-13 17:04:17 +00:00 committed by Tim-Philipp Müller
parent bf0440f97b
commit 7d83351172

View file

@ -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);