Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dalai@blender.org>2021-11-02 13:32:24 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-11-02 13:32:24 +0300
commitaaa85ad2e0f867a32c467ea06e56565704db0344 (patch)
tree1f5be90a596b6dadeab4a08af0fa8c62335c54a0 /source/blender/blenkernel/intern
parent5d8a7ba7deb39863c60e49bfe694dfde6d3b488b (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
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/scene.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 649878fe59b..17ff8088355 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1055,8 +1055,12 @@ static void link_recurs_seq(BlendDataReader *reader, ListBase *lb)
{
BLO_read_list(reader, lb);
- LISTBASE_FOREACH (Sequence *, seq, lb) {
- if (seq->seqbase.first) {
+ LISTBASE_FOREACH_MUTABLE (Sequence *, seq, lb) {
+ /* Sanity check. */
+ if ((seq->machine < 1) || (seq->machine > MAXSEQ)) {
+ BLI_freelinkN(lb, seq);
+ }
+ else if (seq->seqbase.first) {
link_recurs_seq(reader, &seq->seqbase);
}
}