[Cogl] [PATCH] texture-rectangle: Initialize is_foreign

Damien Lespiau damien.lespiau at intel.com
Mon Aug 26 13:51:55 PDT 2013


So we don't read an initializes value later on. Caught by valgrind:

Conditional jump or move depends on uninitialised value(s)
  _cogl_object_texture_rectangle_indirect_free (cogl-texture-rectangle.c:105)
  _cogl_object_context_indirect_free (cogl-context.c:453)
  ...
  main (text.c:149)

Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 cogl/cogl-texture-rectangle.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cogl/cogl-texture-rectangle.c b/cogl/cogl-texture-rectangle.c
index d006085..22e5176 100644
--- a/cogl/cogl-texture-rectangle.c
+++ b/cogl/cogl-texture-rectangle.c
@@ -174,6 +174,7 @@ _cogl_texture_rectangle_create_base (CoglContext *ctx,
   _cogl_texture_init (tex, ctx, width, height, &cogl_texture_rectangle_vtable);
 
   tex_rect->gl_texture = 0;
+  tex_rect->is_foreign = FALSE;
 
   /* We default to GL_LINEAR for both filters */
   tex_rect->gl_legacy_texobj_min_filter = GL_LINEAR;
-- 
1.8.3.1



More information about the Cogl mailing list