From b90ac7bd3145a171de388f51adb5e7fd116e44e8 Mon Sep 17 00:00:00 2001 From: Guillaume DEVOILLE Date: Sat, 15 May 2021 00:41:33 +0200 Subject: [PATCH] Fixed over-allocation of buffer (#1772) output->framePoses[frame] is over-allocated. framePoses is a 2D array: - first dimension: frames (allocated l. 4717) - second dimension: nodes (allocated l. 4731) Second dimension should be allocated of nodes_count transformations only. --- src/models.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models.c b/src/models.c index 51788d7a6..1e0297d6f 100644 --- a/src/models.c +++ b/src/models.c @@ -4728,7 +4728,7 @@ static ModelAnimation *LoadGLTFModelAnimations(const char *fileName, int *animCo // Initiate with zero bone translations for (int frame = 0; frame < output->frameCount; frame++) { - output->framePoses[frame] = RL_MALLOC(output->frameCount*data->nodes_count*sizeof(Transform)); + output->framePoses[frame] = RL_MALLOC(data->nodes_count*sizeof(Transform)); for (unsigned int i = 0; i < data->nodes_count; i++) {