diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-02-18 20:57:19 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-02-18 20:59:42 +0300 |
commit | c297bef9aff5d6eeea26ddd869f4dc03a34d3457 (patch) | |
tree | 2df3cf9656fc8859218a15625dc2f0a6110a67e2 | |
parent | f1f8074b8daaaaba0e90d9cfbaffc66d9c702fd3 (diff) |
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
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 840726e4add..d43c948cadb 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -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; |