Add a check for ForgettingCurveUtils::decodeProbability.

Bug: 13607383
Change-Id: I1a56c52173d0e458864e65fb1c1f4603c0c81c6f
This commit is contained in:
Keisuke Kuroyanagi 2014-03-24 15:48:03 +09:00 committed by Ken Wakasa
parent a17195224b
commit cf88cf6593

View file

@ -72,7 +72,8 @@ const ForgettingCurveUtils::ProbabilityTable ForgettingCurveUtils::sProbabilityT
const int elapsedTimeStepCount = getElapsedTimeStepCount(historicalInfo->getTimeStamp(),
headerPolicy->getForgettingCurveDurationToLevelDown());
return sProbabilityTable.getProbability(
headerPolicy->getForgettingCurveProbabilityValuesTableId(), historicalInfo->getLevel(),
headerPolicy->getForgettingCurveProbabilityValuesTableId(),
std::min(std::max(historicalInfo->getLevel(), 0), MAX_LEVEL),
std::min(std::max(elapsedTimeStepCount, 0), MAX_ELAPSED_TIME_STEP_COUNT));
}