==Sequencer==
authorPeter Schlaile <peter@schlaile.de>
Sun, 4 Jun 2006 13:46:51 +0000 (13:46 +0000)
committerPeter Schlaile <peter@schlaile.de>
Sun, 4 Jun 2006 13:46:51 +0000 (13:46 +0000)
Bugfix: If you use the IPO-pinning feature and edited an IPO that wasn't
  highlighted as the current Sequence (current Sequence being a Metastrip),
  you'll get obscure crashes, since the code
  a) was mistakenly using last_seq
  b) didn't test for se->ok != 2, thereby doing double frees on imbufs

  Am I the only one, who wants to remove the last_seq global completely... ?

source/blender/include/BIF_editseq.h
source/blender/src/editipo.c
source/blender/src/editseq.c

index 600bf3314a42e2c9c27c06926271f912855945b5..95bfbcf63aeb318635d8b7628d40dbf151b8ddea 100644 (file)
@@ -43,7 +43,7 @@ void                          change_sequence(void);
 void                    update_seq_ipo_rect(struct Sequence * seq);
 struct Sequence*                get_last_seq();
 void                            set_last_seq_to_null();
-void                           clear_last_seq(void);
+void                           clear_seq_belonging_to_ipo(struct Ipo * ipo);
 void                           clever_numbuts_seq(void);
 void                           del_seq(void);
 void                           enter_meta(void);
index 0ffd951cdb1e9db51ba68c1c7b4f71154744fc6e..74cd4cb8f1a9a7be40baca41a448ef1b6e7fdeac 100644 (file)
@@ -323,7 +323,7 @@ void editipo_changed(SpaceIpo *si, int doredraw)
                        allqueue(REDRAWBUTSEDIT, 0);
                        allqueue(REDRAWVIEW3D, 0);
                }
-               else if(si->blocktype==ID_SEQ) clear_last_seq();
+               else if(si->blocktype==ID_SEQ) clear_seq_belonging_to_ipo(si->ipo);
                else if(si->blocktype==ID_PO) {
                        Object *ob= OBACT;
                        if(ob && ob->pose) {
index e43d82f33234b8ab83b2639ca2dc80318ad960c8..ba750572abaf692189f476e93d7d5a0e813e3dc0 100644 (file)
@@ -256,7 +256,7 @@ void update_seq_ipo_rect(Sequence * seq)
        seq->ipo->cur.xmax= end;
 }
 
-void clear_last_seq(void)
+void clear_seq_belonging_to_ipo(struct Ipo * ipo)
 {
        /* from (example) ipo: when it is changed, also do effects with same ipo */
        Sequence *seq;
@@ -264,27 +264,24 @@ void clear_last_seq(void)
        StripElem *se;
        int a;
 
-       if(last_seq) {
-
-               ed= G.scene->ed;
-               if(ed==0) return;
+       ed= G.scene->ed;
+       if(ed==0) return;
 
-               WHILE_SEQ(&ed->seqbase) {
-                       if(seq==last_seq || (last_seq->ipo && seq->ipo==last_seq->ipo)) {
-                               a= seq->len;
-                               se= seq->strip->stripdata;
-                               if(se) {
-                                       while(a--) {
-                                               if(se->ibuf) IMB_freeImBuf(se->ibuf);
-                                               se->ibuf= 0;
-                                               se->ok= 1;
-                                               se++;
-                                       }
+       WHILE_SEQ(&ed->seqbase) {
+               if(seq->ipo == ipo) {
+                       a= seq->len;
+                       se= seq->strip->stripdata;
+                       if(se) {
+                               while(a--) {
+                                       if(se->ibuf && se->ok != 2) IMB_freeImBuf(se->ibuf);
+                                       se->ibuf= 0;
+                                       se->ok= 1;
+                                       se++;
                                }
                        }
                }
-               END_SEQ
        }
+       END_SEQ
 }
 
 static int test_overlap_seq(Sequence *test)