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/blenkernel/intern/armature.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/blenkernel/intern/armature.c')
-rw-r--r--source/blender/blenkernel/intern/armature.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index ed752986ddd..d4498017ffd 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1562,8 +1562,8 @@ static void armature_vert_task(void *__restrict userdata,
int deformed = 0;
unsigned int j;
for (j = dvert->totweight; j != 0; j--, dw++) {
- const int index = dw->def_nr;
- if (index >= 0 && index < data->defbase_tot && (pchan = data->defnrToPC[index])) {
+ const uint index = dw->def_nr;
+ if (index < data->defbase_tot && (pchan = data->defnrToPC[index])) {
float weight = dw->weight;
Bone *bone = pchan->bone;