Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2021-07-12 16:38:25 +0300
committerSebastian Parborg <darkdefende@gmail.com>2021-08-16 15:52:57 +0300
commit43ad345caa0ac156f585eab55e335dfca2465ce4 (patch)
treed3fbc6df7f45d444ae0dba031edc55dc36862cb3
parente314260fa778b5d0874cadab1f70f91bddd18434 (diff)
VSE: Fix memory leak when adding bad image/movie strips
If the add strip operator errored out, we wouldn't free custom data allocated Reviewed By: Richard Antalik Differential Revision: http://developer.blender.org/D11919
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 265a52ed1a6..47495eaa57a 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -707,13 +707,13 @@ static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op)
}
else {
if (!sequencer_add_movie_single_strip(C, op, &load_data)) {
+ sequencer_add_cancel(C, op);
return OPERATOR_CANCELLED;
}
}
- if (op->customdata) {
- MEM_freeN(op->customdata);
- }
+ /* Free custom data. */
+ sequencer_add_cancel(C, op);
DEG_relations_tag_update(bmain);
DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS);
@@ -1040,6 +1040,7 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
load_data.image.len = sequencer_add_image_strip_calculate_length(
op, load_data.start_frame, &minframe, &numdigits);
if (load_data.image.len == 0) {
+ sequencer_add_cancel(C, op);
return OPERATOR_CANCELLED;
}
@@ -1062,9 +1063,8 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
- if (op->customdata) {
- MEM_freeN(op->customdata);
- }
+ /* Free custom data. */
+ sequencer_add_cancel(C, op);
return OPERATOR_FINISHED;
}