Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2016-08-05 18:09:56 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-08-05 18:09:56 +0300
commit50c017b6eabd7339cf02c20e369ec7fb2259d1ef (patch)
treef968da13f9431df76cc011e79c512a75a73b772e
parentb7bf9ed2b4a43269ede4289c967f9a85f809372b (diff)
Fix T49022: Crash in BKE_libblock_remap_locked.
Previous check to skip non-linkable IDs resulted in not clearing those skipped ID's newid member, wich lead to try to remap it later in code.
-rw-r--r--source/blender/blenkernel/intern/library.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 03a2552ac31..2eae2153605 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1641,11 +1641,9 @@ void BKE_library_make_local(Main *bmain, const Library *lib, const bool untagged
for (a = set_listbasepointers(bmain, lbarray); a--; ) {
id = lbarray[a]->first;
- if (!id || !BKE_idcode_is_linkable(GS(id->name))) {
- /* Do not explicitly make local non-linkable IDs (shapekeys, in fact), they are assumed to be handled
- * by real datablocks responsible of them. */
- continue;
- }
+ /* Do not explicitly make local non-linkable IDs (shapekeys, in fact), they are assumed to be handled
+ * by real datablocks responsible of them. */
+ const bool do_skip = (id && BKE_idcode_is_linkable(GS(id->name)));
for (; id; id = id_next) {
id->newid = NULL;
@@ -1656,7 +1654,7 @@ void BKE_library_make_local(Main *bmain, const Library *lib, const bool untagged
* appending data, so any libdata already linked wont become local
* (very nasty to discover all your links are lost after appending)
* */
- if (id->tag & (LIB_TAG_EXTERN | LIB_TAG_INDIRECT | LIB_TAG_NEW) &&
+ if (!do_skip && id->tag & (LIB_TAG_EXTERN | LIB_TAG_INDIRECT | LIB_TAG_NEW) &&
((untagged_only == false) || !(id->tag & LIB_TAG_PRE_EXISTING)))
{
if (lib == NULL || id->lib == lib) {