From b052ae4cdbfea85d50827efd10a5a4e953836463 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 13 Feb 2009 06:24:15 +0000 Subject: [PATCH] [#18209] 3 VSE crash bugs with .blends (all left click and move mouse over Metastrip/Blend Mode related) Workaround for a bug where dragging the playhead over a metastrip with blending on it could segfault blender. Tried to figure out why the imbuf rect is not set, but for now a NULL check stops the crash. --- source/blender/src/sequence.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index 219768b2776..3c3c7c7b30a 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -2111,6 +2111,14 @@ static TStripElem* do_build_seq_recursively(Sequence * seq, int cfra) } } +/* Bug: 18209 + * when dragging the mouse over a metastrip, on mouse-up for some unknown + * reason in some cases the metastrips TStripElem->ibuf->rect is NULL, + * This should be fixed but I had a look and couldnt work out why its + * happening so for now workaround with a NULL check - campbell */ + +#define SEQ_SPECIAL_SEQ_UPDATE_WORKAROUND + static TStripElem* do_build_seq_array_recursively( ListBase *seqbasep, int cfra, int chanshown) { @@ -2277,7 +2285,14 @@ static TStripElem* do_build_seq_array_recursively( !se2->ibuf_comp->rect_float) { IMB_rect_from_float(se2->ibuf); } - + +#ifdef SEQ_SPECIAL_SEQ_UPDATE_WORKAROUND + if (se2->ibuf->rect==NULL && se2->ibuf->rect_float==NULL) { + printf("ERROR: sequencer se2->ibuf missing buffer\n"); + } else if (se1->ibuf->rect==NULL && se1->ibuf->rect_float==NULL) { + printf("ERROR: sequencer se1->ibuf missing buffer\n"); + } else { +#endif /* bad hack, to fix crazy input ordering of those two effects */ @@ -2299,6 +2314,10 @@ static TStripElem* do_build_seq_array_recursively( se2->ibuf_comp); } +#ifdef SEQ_SPECIAL_SEQ_UPDATE_WORKAROUND + } +#endif + IMB_cache_limiter_insert(se2->ibuf_comp); IMB_cache_limiter_ref(se2->ibuf_comp); IMB_cache_limiter_touch(se2->ibuf_comp);