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:
authorBastien Montagne <montagne29@wanadoo.fr>2017-09-18 20:50:40 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-09-18 21:04:27 +0300
commitbb4a12914fad3cb1867e34ff01a5ddc9f761e7f0 (patch)
tree67caebfe78ae165822d17a0155ba533ac6d1f501 /source/blender/editors/interface
parent785e96a11d452b2ea67cfc0be573ccd0f5cbdb8f (diff)
Add some security checks against future bad float UIprecision values.
This commit and previous one should be backported to 2.79a should we release it.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index fd5159bb76c..5c05fc8c530 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -488,6 +488,9 @@ static int ui_but_calc_float_precision(uiBut *but, double value)
else if (prec == -1) {
prec = (but->hardmax < 10.001f) ? 3 : 2;
}
+ else {
+ CLAMP(prec, 0, UI_PRECISION_FLOAT_MAX);
+ }
return UI_calc_float_precision(prec, value);
}