[Cogl] [PATCH] Fix filling the array of texture pointers for sliced textures

Neil Roberts neil at linux.intel.com
Mon Jan 7 08:28:45 PST 2013


In commit 1fa7c0f10a8a0 the sliced texture code which creates the
array of pointers to the texture slices was changed so that the
textures are appended to the end of the array instead of initially
creating the array with the right size upfront and then shrinking the
array on error. However it was then still also setting the size of the
array after creating it so the new textures would actually end up in
an unused part of the array. The part of the array that is used was
left unitialised so it would crash. This just removes the call to set
the size of the array.
---
 cogl/cogl-texture-2d-sliced.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/cogl/cogl-texture-2d-sliced.c b/cogl/cogl-texture-2d-sliced.c
index 609695d..6189214 100644
--- a/cogl/cogl-texture-2d-sliced.c
+++ b/cogl/cogl-texture-2d-sliced.c
@@ -939,8 +939,6 @@ _cogl_texture_2d_sliced_allocate (CoglTexture *tex,
                                                sizeof (CoglTexture2D *),
                                                n_slices);
 
-  g_array_set_size (tex_2ds->slice_textures, n_slices);
-
   /* Allocate each slice */
   for (y = 0; y < n_y_slices; ++y)
     {
-- 
1.7.11.3.g3c3efa5



More information about the Cogl mailing list