1
0
Fork 0

cogl-vertex-buffer: Fix the size of the array of attribute pointers

In update_primitive_attributes it tries to fill in an array of
pointers with a NULL terminator. However it was only allocating enough
space for a pointer for each of the attributes plus one byte instead
of plus enough bytes for another pointer.

Thomas Wood found this bug with static analysis.
This commit is contained in:
Neil Roberts 2011-05-11 13:43:02 +01:00
parent 463603f1a0
commit cdfad9cdbe

View file

@ -1164,7 +1164,7 @@ update_primitive_attributes (CoglVertexBuffer *buffer)
g_return_if_fail (n_attributes > 0);
attributes = g_alloca (sizeof (CoglAttribute *) * n_attributes + 1);
attributes = g_alloca (sizeof (CoglAttribute *) * (n_attributes + 1));
i = 0;
for (l = buffer->submitted_vbos; l; l = l->next)