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).
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user