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
This commit is contained in:
parent
9511009438
commit
54a821e8fd
Notes:
blender-bot
2023-02-13 22:20:49 +01:00
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
|
@ -710,13 +710,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);
|
||||
|
@ -1045,6 +1045,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;
|
||||
}
|
||||
|
||||
|
@ -1067,9 +1068,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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue