diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-03-26 23:01:09 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-03-26 23:01:09 +0400 |
commit | fd3de8b04224711b1502e4acde33d5f772dde544 (patch) | |
tree | 776fdf32335b2e996489dc3b6da356060ce1e4e0 | |
parent | cc6b106d345bb15506a6a43be49066d48a8ebc8b (diff) |
Fix T39424: VSE: Bake Sound to Curve CRASHES Blender
BKE_sequencer_offset_animdata() was simply assuming bezt member of fcurve was always valid, while it might be NULL (e.g. when fcurve is using FPoints instead, like when generated from sound file).
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 27ac7fd700d..82d46fee0a0 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -4034,11 +4034,19 @@ void BKE_sequencer_offset_animdata(Scene *scene, Sequence *seq, int ofs) for (fcu = scene->adt->action->curves.first; fcu; fcu = fcu->next) { if (strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str)) { unsigned int i; - for (i = 0; i < fcu->totvert; i++) { - BezTriple *bezt = &fcu->bezt[i]; - bezt->vec[0][0] += ofs; - bezt->vec[1][0] += ofs; - bezt->vec[2][0] += ofs; + if (fcu->bezt) { + for (i = 0; i < fcu->totvert; i++) { + BezTriple *bezt = &fcu->bezt[i]; + bezt->vec[0][0] += ofs; + bezt->vec[1][0] += ofs; + bezt->vec[2][0] += ofs; + } + } + if (fcu->fpt) { + for (i = 0; i < fcu->totvert; i++) { + FPoint *fpt = &fcu->fpt[i]; + fpt->vec[0] += ofs; + } } } } |