attribute: cleanup some sentinel array left over logic
It used to be that we passed around NULL terminated arrays of attributes, but since 3c1e83c7f we now explicitly pass an n_attributes count instead. There were some leftovers of the old approach in the cogl_vdraw_[indexed]_attributes functions and also there was an off-by-one error with the n_attributes values passed on which was causing crashes. Signed-off-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
parent
098a193802
commit
f0a28f4287
@ -1156,8 +1156,7 @@ cogl_vdraw_attributes (CoglVerticesMode mode,
|
|||||||
;
|
;
|
||||||
va_end (ap);
|
va_end (ap);
|
||||||
|
|
||||||
attributes = g_alloca (sizeof (CoglAttribute *) * (n_attributes + 1));
|
attributes = g_alloca (sizeof (CoglAttribute *) * n_attributes);
|
||||||
attributes[n_attributes] = NULL;
|
|
||||||
|
|
||||||
va_start (ap, n_vertices);
|
va_start (ap, n_vertices);
|
||||||
for (i = 0; (attribute = va_arg (ap, CoglAttribute *)); i++)
|
for (i = 0; (attribute = va_arg (ap, CoglAttribute *)); i++)
|
||||||
@ -1165,7 +1164,7 @@ cogl_vdraw_attributes (CoglVerticesMode mode,
|
|||||||
va_end (ap);
|
va_end (ap);
|
||||||
|
|
||||||
cogl_draw_attributes (mode, first_vertex, n_vertices,
|
cogl_draw_attributes (mode, first_vertex, n_vertices,
|
||||||
attributes, i + 1);
|
attributes, n_attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t
|
static size_t
|
||||||
@ -1274,8 +1273,7 @@ cogl_vdraw_indexed_attributes (CoglVerticesMode mode,
|
|||||||
;
|
;
|
||||||
va_end (ap);
|
va_end (ap);
|
||||||
|
|
||||||
attributes = g_alloca (sizeof (CoglAttribute *) * (n_attributes + 1));
|
attributes = g_alloca (sizeof (CoglAttribute *) * n_attributes);
|
||||||
attributes[n_attributes] = NULL;
|
|
||||||
|
|
||||||
va_start (ap, indices);
|
va_start (ap, indices);
|
||||||
for (i = 0; (attribute = va_arg (ap, CoglAttribute *)); i++)
|
for (i = 0; (attribute = va_arg (ap, CoglAttribute *)); i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user