From ad2a8400e9a263acf924311ce1fb050b0e1eb415 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 11 Feb 2020 12:35:10 +1100 Subject: Fix T56108: Crash editing corrupted vertex groups While the file in this report had corrupted values, this is avoidable without adding any extra overhead. Use unsigned vertex group indices since we don't need negative values, this is an alternative to checking they aren't negative in many places. Vertex group values over INT_MAX is still considered invalid, so any accidental unsigned wrapping won't be silently ignored. --- source/blender/modifiers/intern/MOD_mask.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/modifiers/intern/MOD_mask.c') diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c index 8d0f6825ee0..00b0068bd11 100644 --- a/source/blender/modifiers/intern/MOD_mask.c +++ b/source/blender/modifiers/intern/MOD_mask.c @@ -131,7 +131,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes bDeformGroup *def; bool *bone_select_array; int bone_select_tot = 0; - const int defbase_tot = BLI_listbase_count(&ob->defbase); + const uint defbase_tot = (uint)BLI_listbase_count(&ob->defbase); /* check that there is armature object with bones to use, otherwise return original mesh */ if (ELEM(NULL, oba, oba->pose, ob->defbase.first)) { -- cgit v1.2.3