[Bf-blender-cvs] [aaa85ad2e0f] blender-v2.93-release: VSE: Implement sanity check for files with more channels than supported

Dalai Felinto noreply at git.blender.org
Tue Nov 2 13:52:38 CET 2021


Commit: aaa85ad2e0f867a32c467ea06e56565704db0344
Author: Dalai Felinto
Date:   Tue Nov 2 11:32:24 2021 +0100
Branches: blender-v2.93-release
https://developer.blender.org/rBaaa85ad2e0f867a32c467ea06e56565704db0344

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

===================================================================

M	source/blender/blenkernel/intern/scene.c

===================================================================

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);
     }
   }



More information about the Bf-blender-cvs mailing list