UI: prevent softrange from becoming nan
authorCampbell Barton <ideasman42@gmail.com>
Wed, 29 Jun 2016 02:00:17 +0000 (12:00 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 29 Jun 2016 02:09:00 +0000 (12:09 +1000)
Quiets assert

source/blender/editors/interface/interface.c

index 779900660271a0c875dd0f6b41fe5d497558ab21..ba7240be5d832038116a3ba7c3313facf89eb581 100644 (file)
@@ -2576,9 +2576,11 @@ static void ui_set_but_soft_range(uiBut *but)
        }
        else if (but->poin && (but->pointype & UI_BUT_POIN_TYPES)) {
                float value = ui_but_value_get(but);
-               CLAMP(value, but->hardmin, but->hardmax);
-               but->softmin = min_ff(but->softmin, value);
-               but->softmax = max_ff(but->softmax, value);
+               if (isfinite(value)) {
+                       CLAMP(value, but->hardmin, but->hardmax);
+                       but->softmin = min_ff(but->softmin, value);
+                       but->softmax = max_ff(but->softmax, value);
+               }
        }
        else {
                BLI_assert(0);