Revision: 36717
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36717
Author:   schlaile
Date:     2011-05-16 17:54:55 +0000 (Mon, 16 May 2011)
Log Message:
-----------
== Sequencer ==

This fixes one part of [#27353] VSE crashes on large M4V

StripData was alloced in full length for MOVIE and SOUND-tracks, which only
use the first element for filename storage. (StripData as an array is only
used in IMAGE strips).

Fixed the crash and documented accordingly.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/sequencer.c

Modified: trunk/blender/source/blender/blenkernel/intern/sequencer.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sequencer.c  2011-05-16 
17:14:47 UTC (rev 36716)
+++ trunk/blender/source/blender/blenkernel/intern/sequencer.c  2011-05-16 
17:54:55 UTC (rev 36717)
@@ -1003,7 +1003,11 @@
 {
        StripElem *se= seq->strip->stripdata;
 
-       if(seq->type != SEQ_MOVIE) { /* movie use the first */
+       if(seq->type == SEQ_IMAGE) { /* only 
+                                       IMAGE strips use the whole array,
+                                       MOVIE strips use only 
+                                       the first element, all other strips
+                                       don't use this... */
                int nr = (int) give_stripelem_index(seq, cfra);
 
                if (nr == -1 || se == NULL) return NULL;
@@ -3505,7 +3509,8 @@
        strip->len = seq->len = ceil(info.length * FPS);
        strip->us= 1;
 
-       strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), 
"stripelem");
+       /* we only need 1 element to store the filename */
+       strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
 
        BLI_split_dirfile(seq_load->path, strip->dir, se->name);
 
@@ -3554,7 +3559,8 @@
        strip->len = seq->len = IMB_anim_get_duration( an );
        strip->us= 1;
 
-       strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), 
"stripelem");
+       /* we only need 1 element for MOVIE strips */
+       strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
 
        BLI_split_dirfile(seq_load->path, strip->dir, se->name);
 

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to