From: Julien Isorce Date: Thu, 2 Jul 2015 09:26:18 +0000 (+0100) Subject: gl: initialize output params to 0 before calling gl functions X-Git-Tag: 1.6.0~439 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f037b28a7b6e3bc52d45c1ab32c2ae33edca6f35;p=platform%2Fupstream%2Fgst-plugins-bad.git gl: initialize output params to 0 before calling gl functions The client side API of the Chromium's GPU Process has asserts in debug mode that check that output params are initialized to 0. --- diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c index da903f4..549db48 100644 --- a/gst-libs/gst/gl/gstglcolorconvert.c +++ b/gst-libs/gst/gl/gstglcolorconvert.c @@ -1714,7 +1714,7 @@ _do_convert_draw (GstGLContext * context, GstGLColorConvert * convert) guint out_width, out_height; gint i; - GLint viewport_dim[4]; + GLint viewport_dim[4] = { 0 }; GLenum multipleRT[] = { GL_COLOR_ATTACHMENT0, diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c index 637ecdf..b25738c 100644 --- a/gst-libs/gst/gl/gstglcontext.c +++ b/gst-libs/gst/gl/gstglcontext.c @@ -1179,7 +1179,8 @@ _build_extension_string (GstGLContext * context) const GstGLFuncs *gl = context->gl_vtable; GString *ext_g_str = g_string_sized_new (1024); const gchar *ext_const_c_str = NULL; - int i, n; + GLint i = 0; + GLint n = 0; gl->GetIntegerv (GL_NUM_EXTENSIONS, &n); diff --git a/gst-libs/gst/gl/gstglframebuffer.c b/gst-libs/gst/gl/gstglframebuffer.c index 7e958ca..fb706f5 100644 --- a/gst-libs/gst/gl/gstglframebuffer.c +++ b/gst-libs/gst/gl/gstglframebuffer.c @@ -173,7 +173,7 @@ gst_gl_framebuffer_use_v2 (GstGLFramebuffer * frame, gint texture_fbo_width, GLuint texture_fbo, GLCB_V2 cb, gpointer stuff) { const GstGLFuncs *gl; - GLint viewport_dim[4]; + GLint viewport_dim[4] = { 0 }; g_return_val_if_fail (GST_IS_GL_FRAMEBUFFER (frame), FALSE); g_return_val_if_fail (texture_fbo_width > 0 && texture_fbo_height > 0, FALSE); diff --git a/gst-libs/gst/gl/gstglshader.c b/gst-libs/gst/gl/gstglshader.c index 016e475..a41bf38 100644 --- a/gst-libs/gst/gl/gstglshader.c +++ b/gst-libs/gst/gl/gstglshader.c @@ -522,6 +522,7 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error) /* compile */ gl->CompileShader (priv->vertex_handle); /* check everything is ok */ + status = GL_FALSE; gl->GetShaderiv (priv->vertex_handle, GL_COMPILE_STATUS, &status); priv->vtable.GetShaderInfoLog (priv->vertex_handle, @@ -561,6 +562,7 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error) /* compile */ gl->CompileShader (priv->fragment_handle); /* check everything is ok */ + status = GL_FALSE; priv->vtable.GetShaderiv (priv->fragment_handle, GL_COMPILE_STATUS, &status); @@ -587,6 +589,7 @@ gst_gl_shader_compile (GstGLShader * shader, GError ** error) /* if nothing failed link shaders */ gl->LinkProgram (priv->program_handle); + status = GL_FALSE; priv->vtable.GetProgramiv (priv->program_handle, GL_LINK_STATUS, &status); priv->vtable.GetProgramInfoLog (priv->program_handle, diff --git a/gst-libs/gst/gl/gstglviewconvert.c b/gst-libs/gst/gl/gstglviewconvert.c index f48e3a5..ebe4ed3 100644 --- a/gst-libs/gst/gl/gstglviewconvert.c +++ b/gst-libs/gst/gl/gstglviewconvert.c @@ -1586,7 +1586,7 @@ _do_view_convert_draw (GstGLContext * context, GstGLViewConvert * viewconvert) GstGLFuncs *gl; guint out_width, out_height; gint out_views, i; - GLint viewport_dim[4]; + GLint viewport_dim[4] = { 0 }; GLenum multipleRT[] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1,