From a9c307ff5d94489b30d7398ac80072fe7222a434 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 17 Feb 2010 22:16:17 +0000 Subject: [PATCH] cogl-vertex-buffer: Fix the malloc fallback for indices The size of the malloc'd buffer for indices when VBOs are not available was too small so memory corruption would result if it was used. http://bugzilla.o-hand.com/show_bug.cgi?id=1996 --- clutter/cogl/cogl/cogl-vertex-buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clutter/cogl/cogl/cogl-vertex-buffer.c b/clutter/cogl/cogl/cogl-vertex-buffer.c index 043448ed8..4da57cb25 100644 --- a/clutter/cogl/cogl/cogl-vertex-buffer.c +++ b/clutter/cogl/cogl/cogl-vertex-buffer.c @@ -1819,7 +1819,7 @@ cogl_vertex_buffer_indices_new (CoglIndicesType indices_type, indices_bytes = get_indices_type_size (indices->type) * indices_len; if (fallback) { - indices->vbo_name = g_malloc (indices_len); + indices->vbo_name = g_malloc (indices_bytes); memcpy (indices->vbo_name, indices_array, indices_bytes); } else