зеркало из https://github.com/mozilla/gecko-dev.git
Bug 550969 - Fix white_point_from_temp to handle out of range input. r=jmuizelaar
This commit is contained in:
Родитель
f51437197c
Коммит
4426ead531
|
@ -917,6 +917,8 @@ qcms_profile* qcms_profile_create_rgb_with_table(
|
|||
|
||||
/* from lcms: cmsWhitePointFromTemp */
|
||||
/* tempK must be >= 4000. and <= 25000.
|
||||
* Invalid values of tempK will return
|
||||
* (x,y,Y) = (-1.0, -1.0, -1.0)
|
||||
* similar to argyll: icx_DTEMP2XYZ() */
|
||||
static qcms_CIE_xyY white_point_from_temp(int temp_K)
|
||||
{
|
||||
|
@ -938,7 +940,14 @@ static qcms_CIE_xyY white_point_from_temp(int temp_K)
|
|||
if (T > 7000.0 && T <= 25000.0) {
|
||||
x = -2.0064*(1E9/T3) + 1.9018*(1E6/T2) + 0.24748*(1E3/T) + 0.237040;
|
||||
} else {
|
||||
// Invalid tempK
|
||||
white_point.x = -1.0;
|
||||
white_point.y = -1.0;
|
||||
white_point.Y = -1.0;
|
||||
|
||||
assert(0 && "invalid temp");
|
||||
|
||||
return white_point;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче