Commit: cf38c4d49f0e15e207459dde5a3aa27e0eb6a34a
Author: Julian Eisel
Date:   Wed Nov 27 16:03:00 2019 +0100
Branches: temp-lanpr-review
https://developer.blender.org/rBcf38c4d49f0e15e207459dde5a3aa27e0eb6a34a

Fix NULL-ptr mem-copy

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

M       source/blender/blenkernel/intern/collection.c

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

diff --git a/source/blender/blenkernel/intern/collection.c 
b/source/blender/blenkernel/intern/collection.c
index 44fb108bac7..ec8e8bb1b3f 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -239,7 +239,9 @@ void BKE_collection_copy_data(Main *bmain,
     CollectionLANPR *lanpr = MEM_callocN(sizeof(CollectionLANPR), "Duplicated 
CollectionLANPR");
     collection_dst->lanpr = lanpr;
   }
-  memcpy(collection_dst->lanpr, collection_src->lanpr, 
sizeof(CollectionLANPR));
+  if (collection_dst->lanpr != NULL) {
+    memcpy(collection_dst->lanpr, collection_src->lanpr, 
sizeof(CollectionLANPR));
+  }
 }
 
 static Collection *collection_duplicate_recursive(Main *bmain,

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to