Fix invalid argument to BLI_path_split_dir_file

get_index_dir passed in the wrong size, also remove strange use of
BLI_path_split_dir_file which copied the directory into `file`,
only to overwrite it with the `file` afterwards.
This commit is contained in:
Campbell Barton
2023-05-02 21:13:20 +10:00
parent 27e4ab80fb
commit 3b5aba8cf8

View File

@@ -383,7 +383,7 @@ static void get_index_dir(struct anim *anim, char *index_dir, size_t index_dir_l
if (!anim->index_dir[0]) {
char filename[FILE_MAXFILE];
char dirname[FILE_MAXDIR];
BLI_path_split_dir_file(anim->name, dirname, index_dir_len, filename, sizeof(filename));
BLI_path_split_dir_file(anim->name, dirname, sizeof(dirname), filename, sizeof(filename));
BLI_path_join(index_dir, index_dir_len, dirname, "BL_proxy", filename);
}
else {
@@ -393,9 +393,7 @@ static void get_index_dir(struct anim *anim, char *index_dir, size_t index_dir_l
void IMB_anim_get_fname(struct anim *anim, char *file, int size)
{
char filename[FILE_MAXFILE];
BLI_path_split_dir_file(anim->name, file, size, filename, sizeof(filename));
BLI_strncpy(file, filename, size);
BLI_path_split_file_part(anim->name, file, size);
}
static bool get_proxy_filepath(struct anim *anim,