From 15fd4e164a213ad2dacae6d608350d65eb1ffd30 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Fri, 13 Mar 2015 17:41:17 +0000 Subject: [PATCH] glshader: attribute locations are -1 on error --- ext/gl/gltestsrc.c | 6 +++--- gst-libs/gst/gl/gstglshader.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/gl/gltestsrc.c b/ext/gl/gltestsrc.c index 525a959a68..d5e75aa1e6 100644 --- a/ext/gl/gltestsrc.c +++ b/ext/gl/gltestsrc.c @@ -222,8 +222,8 @@ gst_gl_test_src_shader (GstGLTestSrc * v, GstBuffer * buffer, int w, int h) GLushort indices[] = { 0, 1, 2, 3, 0 }; - GLint attr_position_loc = 0; - GLint attr_uv_loc = 0; + GLint attr_position_loc = -1; + GLint attr_uv_loc = -1; if (gst_gl_context_get_gl_api (v->context)) { @@ -316,7 +316,7 @@ gst_gl_test_src_checkers (GstGLTestSrc * v, gint checker_width) GLushort indices[] = { 0, 1, 2, 3, 0 }; - GLint attr_position_loc = 0; + GLint attr_position_loc = -1; if (gst_gl_context_get_gl_api (v->context)) { diff --git a/gst-libs/gst/gl/gstglshader.c b/gst-libs/gst/gl/gstglshader.c index 3ec1799f9f..fa166982f4 100644 --- a/gst-libs/gst/gl/gstglshader.c +++ b/gst-libs/gst/gl/gstglshader.c @@ -1167,9 +1167,9 @@ gst_gl_shader_get_attribute_location (GstGLShader * shader, const gchar * name) GstGLShaderPrivate *priv; GstGLFuncs *gl; - g_return_val_if_fail (shader != NULL, 0); + g_return_val_if_fail (shader != NULL, -1); priv = shader->priv; - g_return_val_if_fail (priv->program_handle != 0, 0); + g_return_val_if_fail (priv->program_handle != 0, -1); if (0 == priv->vertex_handle) return -1;