Prevent possible access out of bounds when calculating CPU speed

svn path=/trunk/; revision=27563
This commit is contained in:
Hervé Poussineau 2007-07-10 13:30:43 +00:00
parent aab51cffca
commit 9541d1c816

View file

@ -227,6 +227,13 @@ KiInitMachineDependent(VOID)
/* Move on */
CurrentSample++;
Sample++;
if (Sample == sizeof(Samples) / sizeof(Samples[0]))
{
/* Restart */
CurrentSample = Samples;
Sample = 0;
}
}
/* Save the CPU Speed */