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:
authorCampbell Barton <ideasman42@gmail.com>2020-02-11 04:35:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-02-11 05:20:49 +0300
commitad2a8400e9a263acf924311ce1fb050b0e1eb415 (patch)
treeee692cb7d489915c5b1242f2652a807e048e4f0a /source/blender/modifiers/intern/MOD_mask.c
parent56a4ee3fdbc647d037a89128725e5988715c59ad (diff)
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.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_mask.c')
-rw-r--r--source/blender/modifiers/intern/MOD_mask.c2
1 files changed, 1 insertions, 1 deletions
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)) {