fix for segfault loading a file with a proxy that is a missing link.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 20 Jun 2012 21:10:34 +0000 (21:10 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 20 Jun 2012 21:10:34 +0000 (21:10 +0000)
source/blender/blenkernel/intern/armature.c

index 9af1d5f52c4a5dea12deb37ef8c178afb89d6d4b..96959398bc2e9d1449752abd9faa89561512a67a 100644 (file)
@@ -1588,7 +1588,11 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
        for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
                pchanp = BKE_pose_channel_find_name(frompose, pchan->name);
 
-               if (pchan->bone->layer & layer_protected) {
+               if (UNLIKELY(pchanp == NULL)) {
+                       /* happens for proxies that become invalid because of a missing link
+                        * for regulat cases it shouldn't happen at all */
+               }
+               else if (pchan->bone->layer & layer_protected) {
                        ListBase proxylocal_constraints = {NULL, NULL};
 
                        /* copy posechannel to temp, but restore important pointers */