diff --git a/sweet_geometry.c b/sweet_geometry.c index a1cdd96..3bb81e9 100644 --- a/sweet_geometry.c +++ b/sweet_geometry.c @@ -397,7 +397,7 @@ sweet_geometry_subdivide_mesh_vt (unsigned int nb_iterations, float scale, (*mesh_indices) = malloc (nb_faces * 3 * sizeof (unsigned int)); (*mesh_vertices) = malloc (v.nb_vertices * sizeof (float) * 3); - (*mesh_tcoord) = malloc ((*count_vertices) * sizeof (float) * 2); + (*mesh_tcoord) = malloc (t.nb_uv * sizeof (float) * 2); if ((*mesh_indices) == NULL || (*mesh_vertices) == NULL || (*mesh_tcoord) == NULL) {