diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-02-11 17:28:41 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-02-11 17:29:17 +0400 |
commit | 0a50757a590b3ff6fdb44371d2f9cda86b3bfd92 (patch) | |
tree | 60f6b21ca0d0189e4b032028842bbe3aef55b15c /source/blender/blenkernel | |
parent | 5a35034fb3b046986a06837692bfa6c225f27878 (diff) |
Fix null-pointer dereference in previous sequencer commit
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index d389bd130fa..c25b3da15eb 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -2902,26 +2902,35 @@ static ImBuf *seq_render_strip_stack(const SeqRenderData *context, ListBase *seq } if (count == 1) { + Sequence *seq = seq_arr[0]; + /* Some of the blend modes are unclear how to apply with only single input, * or some of them will just produce an empty result.. */ - if (ELEM3(seq_arr[0]->blend_mode, SEQ_BLEND_REPLACE, SEQ_TYPE_CROSS, SEQ_TYPE_ALPHAOVER)) { - int early_out = seq_get_early_out_for_blend_mode(seq_arr[0]); + if (ELEM3(seq->blend_mode, SEQ_BLEND_REPLACE, SEQ_TYPE_CROSS, SEQ_TYPE_ALPHAOVER)) { + int early_out; + if (seq->blend_mode == SEQ_BLEND_REPLACE) { + early_out = EARLY_NO_INPUT; + } + else { + early_out = seq_get_early_out_for_blend_mode(seq); + } + if (ELEM(early_out, EARLY_NO_INPUT, EARLY_USE_INPUT_2)) { - out = seq_render_strip(context, seq_arr[0], cfra); + out = seq_render_strip(context, seq, cfra); } else if (early_out == EARLY_USE_INPUT_1) { out = IMB_allocImBuf(context->rectx, context->recty, 32, IB_rect); } else { - out = seq_render_strip(context, seq_arr[0], cfra); + out = seq_render_strip(context, seq, cfra); if (early_out == EARLY_DO_EFFECT) { ImBuf *ibuf1 = IMB_allocImBuf(context->rectx, context->recty, 32, out->rect_float ? IB_rectfloat : IB_rect); ImBuf *ibuf2 = out; - out = seq_render_strip_stack_apply_effect(context, seq_arr[0], cfra, ibuf1, ibuf2); + out = seq_render_strip_stack_apply_effect(context, seq, cfra, ibuf1, ibuf2); IMB_freeImBuf(ibuf1); IMB_freeImBuf(ibuf2); @@ -2929,10 +2938,10 @@ static ImBuf *seq_render_strip_stack(const SeqRenderData *context, ListBase *seq } } else { - out = seq_render_strip(context, seq_arr[0], cfra); + out = seq_render_strip(context, seq, cfra); } - BKE_sequencer_cache_put(context, seq_arr[0], cfra, SEQ_STRIPELEM_IBUF_COMP, out); + BKE_sequencer_cache_put(context, seq, cfra, SEQ_STRIPELEM_IBUF_COMP, out); return out; } |