From ff884f4179a1371e40b6fe255cbff616dd1b6c47 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Mon, 16 May 2011 17:54:55 +0000 Subject: == 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. --- source/blender/blenkernel/intern/sequencer.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source/blender/blenkernel/intern/sequencer.c') diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index b0da40bf0c5..fb72ab676b0 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1003,7 +1003,11 @@ StripElem *give_stripelem(Sequence *seq, int cfra) { 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 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo 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 @@ Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo 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); -- cgit v1.2.3