[c] Closes #2397, buffer overflow when loading sequences with less than 10 frames.

This commit is contained in:
Mario Zechner 2023-10-19 19:43:59 +02:00
parent 3c1492ac32
commit 5989c861ca

View File

@ -33,7 +33,7 @@
static int /*bool*/ loadSequence(spAtlas *atlas, const char *basePath, spSequence *sequence) { static int /*bool*/ loadSequence(spAtlas *atlas, const char *basePath, spSequence *sequence) {
spTextureRegionArray *regions = sequence->regions; spTextureRegionArray *regions = sequence->regions;
char *path = CALLOC(char, strlen(basePath) + sequence->digits + 1); char *path = CALLOC(char, strlen(basePath) + sequence->digits + 2);
int i; int i;
for (i = 0; i < regions->size; i++) { for (i = 0; i < regions->size; i++) {
spSequence_getPath(sequence, basePath, i, path); spSequence_getPath(sequence, basePath, i, path);