Avoid out-of-bounds array index
This commit is contained in:
parent
9299f9f1d8
commit
1bba25c7ee
@ -183,7 +183,7 @@ namespace
|
||||
|
||||
int CTWeightToWX(CGFloat weight)
|
||||
{
|
||||
for (int i = 0; i < kCTWeightsCount; ++i)
|
||||
for (int i = 0; i < kCTWeightsCount - 1; ++i)
|
||||
{
|
||||
if ( (weight - gCTWeights[i]) < (gCTWeights[i+1]-weight) )
|
||||
return i * 100;
|
||||
|
Loading…
Reference in New Issue
Block a user