From 2e436173aae1ff715eb1d19aebbf7243ba4afc5c Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 21 Jul 2014 22:55:06 +0200 Subject: Fix T41086: VSE separate images increases file size abnormally. We were copying everything from the old sequence into each new ones... including the stripdata, which for image sequences is an array with one item per image! So bug was an exponential one, separating strips of a few tens of images was insensible, while separating a strip of 1000 images would add above 250MB to file size (and RAM usage too)! --- source/blender/editors/space_sequencer/sequencer_edit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 973d6a97a11..dcf13dbf43f 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1919,9 +1919,12 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op) strip_new = seq_new->strip; strip_new->us = 1; - /* new stripdata */ - se_new = strip_new->stripdata; + /* new stripdata (only one element now!) */ + /* Note this assume all elements (images) have the same dimension, since we only copy the name here. */ + se_new = MEM_reallocN(strip_new->stripdata, sizeof(*se_new)); BLI_strncpy(se_new->name, se->name, sizeof(se_new->name)); + strip_new->stripdata = se_new; + BKE_sequence_calc(scene, seq_new); if (step > 1) { -- cgit v1.2.3