mirror of https://github.com/mstorsjo/fdk-aac.git
DO NOT MERGE Prevent out of bound memory access in GetInvInt
am: 9fb4261c43
Change-Id: If0378d7935b9f651f7096eee8916d4f83889a629
This commit is contained in:
commit
f6100335b8
|
@ -479,15 +479,19 @@ inline FIXP_DBL fAddSaturate(const FIXP_DBL a, const FIXP_DBL b)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Calculate the value of 1/i where i is a integer value. It supports
|
* \brief Calculate the value of 1/i where i is a integer value. It supports
|
||||||
* input values from 1 upto 80.
|
* input values from 0 upto 79.
|
||||||
* \param intValue Integer input value.
|
* \param intValue Integer input value.
|
||||||
* \param FIXP_DBL representation of 1/intValue
|
* \param FIXP_DBL representation of 1/intValue
|
||||||
*/
|
*/
|
||||||
inline FIXP_DBL GetInvInt(int intValue)
|
inline FIXP_DBL GetInvInt(int intValue)
|
||||||
{
|
{
|
||||||
FDK_ASSERT((intValue > 0) && (intValue < 80));
|
FDK_ASSERT((intValue >= 0) && (intValue < 80));
|
||||||
FDK_ASSERT(intValue<80);
|
if (intValue > 79)
|
||||||
return invCount[intValue];
|
return invCount[79];
|
||||||
|
else if (intValue < 0)
|
||||||
|
return invCount[0];
|
||||||
|
else
|
||||||
|
return invCount[intValue];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue