[Bf-blender-cvs] [997dfa6] : Fix T38990: Crash in mask shape re-key

Campbell Barton noreply at git.blender.org
Wed Mar 12 18:15:35 CET 2014


Commit: 997dfa6e7fa565bb3e7d9c69583c94b3bec75e40
Author: Campbell Barton
Date:   Fri Mar 7 14:37:14 2014 +1100
https://developer.blender.org/rB997dfa6e7fa565bb3e7d9c69583c94b3bec75e40

Fix T38990: Crash in mask shape re-key

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

M	source/blender/editors/mask/mask_shapekey.c

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

diff --git a/source/blender/editors/mask/mask_shapekey.c b/source/blender/editors/mask/mask_shapekey.c
index cea3502..9dcc0aa 100644
--- a/source/blender/editors/mask/mask_shapekey.c
+++ b/source/blender/editors/mask/mask_shapekey.c
@@ -272,16 +272,18 @@ static int mask_shape_key_rekey_exec(bContext *C, wmOperator *op)
 		}
 
 		if (masklay->splines_shapes.first) {
-			MaskLayerShape *masklay_shape;
+			MaskLayerShape *masklay_shape, *masklay_shape_next;
 			MaskLayerShape *masklay_shape_lastsel = NULL;
 
 			for (masklay_shape = masklay->splines_shapes.first;
 			     masklay_shape;
-			     masklay_shape = masklay_shape->next)
+			     masklay_shape = masklay_shape_next)
 			{
 				MaskLayerShape *masklay_shape_a = NULL;
 				MaskLayerShape *masklay_shape_b = NULL;
 
+				masklay_shape_next = masklay_shape->next;
+
 				/* find contiguous selections */
 				if (masklay_shape->flag & MASK_SHAPE_SELECT) {
 					if (masklay_shape_lastsel == NULL) {
@@ -293,6 +295,9 @@ static int mask_shape_key_rekey_exec(bContext *C, wmOperator *op)
 						masklay_shape_a = masklay_shape_lastsel;
 						masklay_shape_b = masklay_shape;
 						masklay_shape_lastsel = NULL;
+
+						/* this will be freed below, sep over selection */
+						masklay_shape_next = masklay_shape->next;
 					}
 				}




More information about the Bf-blender-cvs mailing list