summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuillaume DEVOILLE <[email protected]>2021-05-15 00:41:33 +0200
committerGitHub <[email protected]>2021-05-15 00:41:33 +0200
commitb90ac7bd3145a171de388f51adb5e7fd116e44e8 (patch)
treeae591db95e473f9c2e930ef5a379795a20ccdc9f
parenta84e98ba6c2032646238b26c29eadf67b009ac6b (diff)
downloadraylib-b90ac7bd3145a171de388f51adb5e7fd116e44e8.tar.gz
raylib-b90ac7bd3145a171de388f51adb5e7fd116e44e8.zip
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.
-rw-r--r--src/models.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/models.c b/src/models.c
index 51788d7a..1e0297d6 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++)
{