diff options
| author | Guillaume DEVOILLE <[email protected]> | 2021-05-15 00:41:33 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-05-15 00:41:33 +0200 |
| commit | b90ac7bd3145a171de388f51adb5e7fd116e44e8 (patch) | |
| tree | ae591db95e473f9c2e930ef5a379795a20ccdc9f | |
| parent | a84e98ba6c2032646238b26c29eadf67b009ac6b (diff) | |
| download | raylib-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.c | 2 |
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++) { |
