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
path: root/source
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2017-03-24 10:35:17 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2017-03-24 10:35:17 +0300
commitd52191616b5fecbdf4012909dae9a5446987ee54 (patch)
treef7b93313527f6474fb050ec8f060dd1a04877d81 /source
parent178708f1426dbde1d1fda33da47a76fab18e0bc8 (diff)
Fix for last fix of fix: (unsigned)char is limited to 255
setting char as value outside its range will wrap
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/customdata.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index debc7491fb8..ea2c4f05423 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -831,18 +831,15 @@ static void layerInterp_mloopcol(
}
}
- /* delay writing to the destination incase dest is in sources */
- mc->r = iroundf(col.r);
- mc->g = iroundf(col.g);
- mc->b = iroundf(col.b);
- mc->a = iroundf(col.a);
/* Subdivide smooth or fractal can cause problems without clamping
* although weights should also not cause this situation */
- CLAMP(mc->a, 0, 255);
- CLAMP(mc->r, 0, 255);
- CLAMP(mc->g, 0, 255);
- CLAMP(mc->b, 0, 255);
+
+ /* also delay writing to the destination incase dest is in sources */
+ mc->r = CLAMPIS(iroundf(col.r), 0, 255);
+ mc->g = CLAMPIS(iroundf(col.g), 0, 255);
+ mc->b = CLAMPIS(iroundf(col.b), 0, 255);
+ mc->a = CLAMPIS(iroundf(col.a), 0, 255);
}
static int layerMaxNum_mloopcol(void)