diff options
author | Dalai Felinto <dalai@blender.org> | 2021-10-29 11:33:40 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-10-29 11:33:40 +0300 |
commit | 14b8f6c25b2912fdc669c1b5640dcb4bb7d927f1 (patch) | |
tree | 47bf06a954a6ed42607de3c4a2109cf77d3a7a50 | |
parent | b382632665b3552d580a3c65e94dd36857d5fb68 (diff) |
VSE: Implement sanity check for files with more channels than supported
This is a follow up to 8fecc2a8525467ee2fbbaae16ddbbc10b3050d46.
This makes sure future .blend files that have more channels than the
limit won't break Blender.
For LTS this happens silently, without warning the users.
This is part of https://developer.blender.org/D12645
Differential Revision: https://developer.blender.org/D12648
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 630ead642a3..47cbff0d391 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6789,7 +6789,11 @@ static void link_recurs_seq(FileData *fd, ListBase *lb) link_list(fd, lb); for (seq = lb->first; seq; seq = seq->next) { - if (seq->seqbase.first) { + /* Sanity check. */ + if ((seq->machine < 1) || (seq->machine > MAXSEQ)) { + BLI_freelinkN(lb, seq); + } + else if (seq->seqbase.first) { link_recurs_seq(fd, &seq->seqbase); } } |