Fix [#21582] Adjusting material color (color picker) crashes
authorMatt Ebb <matt@mke3.net>
Fri, 23 Apr 2010 01:41:01 +0000 (01:41 +0000)
committerMatt Ebb <matt@mke3.net>
Fri, 23 Apr 2010 01:41:01 +0000 (01:41 +0000)
Thanks to the testers for helping diagnose this!

source/blender/editors/interface/interface_handlers.c

index c444ef253d5dd1c2b3245478e3d47244c7dbe67a..4dd47059e0111b32813755e18bf6657a8a1672a8 100644 (file)
@@ -2944,6 +2944,8 @@ static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx,
                if (color_profile)
                        hsv[2] = srgb_to_linearrgb(hsv[2]);
                
+               if (hsv[2] > but->softmax)
+                       hsv[2] = but->softmax;
        }
 
        hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2);