Fix T85762: Crash when opening 2.83 VSE file

Crash happened in versioning code on NULL dereference in function
seq_convert_transform_crop() for Strip crop and transform
fields.

Strips created after rB1fd7b380f4cf were assumed to have crop and
transform always initialized, but this wasn't the case. This has been
fixed in 2.90, but not in versioning code.

Initialize these fields if they are not initialized already.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10463
This commit is contained in:
Richard Antalik 2021-02-18 18:57:19 +01:00
parent f1f8074b8d
commit c297bef9af

View File

@ -124,6 +124,13 @@ static void seq_convert_transform_crop(const Scene *scene,
Sequence *seq,
const eSpaceSeq_Proxy_RenderSize render_size)
{
if (seq->strip->transform == NULL) {
seq->strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform");
}
if (seq->strip->crop == NULL) {
seq->strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop");
}
StripCrop *c = seq->strip->crop;
StripTransform *t = seq->strip->transform;
int old_image_center_x = scene->r.xsch / 2;