diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-09-18 20:50:40 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-09-18 21:04:27 +0300 |
commit | bb4a12914fad3cb1867e34ff01a5ddc9f761e7f0 (patch) | |
tree | 67caebfe78ae165822d17a0155ba533ac6d1f501 /source/blender/editors | |
parent | 785e96a11d452b2ea67cfc0be573ccd0f5cbdb8f (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')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 9376de8c095..e14a3a3ff0a 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -996,7 +996,7 @@ void uiItemsFullEnumO( struct IDProperty *properties, int context, int flag); void uiItemsFullEnumO_items( uiLayout *layout, struct wmOperatorType *ot, PointerRNA ptr, PropertyRNA *prop, - IDProperty *properties, int context, int flag, + struct IDProperty *properties, int context, int flag, const EnumPropertyItem *item_array, int totitem); void uiItemL(uiLayout *layout, const char *name, int icon); /* label */ 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); } |