[Bf-blender-cvs] [c297bef9aff] blender-v2.92-release: Fix T85762: Crash when opening 2.83 VSE file

Richard Antalik noreply at git.blender.org
Thu Feb 18 19:02:04 CET 2021


Commit: c297bef9aff5d6eeea26ddd869f4dc03a34d3457
Author: Richard Antalik
Date:   Thu Feb 18 18:57:19 2021 +0100
Branches: blender-v2.92-release
https://developer.blender.org/rBc297bef9aff5d6eeea26ddd869f4dc03a34d3457

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

===================================================================

M	source/blender/blenloader/intern/versioning_290.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list