Check for index in range before returning CPIS value.

This commit is contained in:
Rich 2011-06-23 21:31:09 +00:00
parent 595db08cc7
commit 0a14f6f3fc

View File

@ -282,7 +282,10 @@ namespace CvtFont
public static float GetCPIs(uint i)
{
if (FontIsPropt(i)) return 12;
return CPIS[i & 63];
uint j = i & 63;
if (j > CPIS.Length - 1)
return CPIS[0];
return CPIS[j];
}
public static float GetPrintPitch(uint i)
{