Fix [#21582] Adjusting material color (color picker) crashes

Thanks to the testers for helping diagnose this!
This commit is contained in:
2010-04-23 01:41:01 +00:00
parent d4e1bcb7f2
commit 8f286a80d0

View 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);