Fix out of bound memory access in lppTransposer am: 6d3dd40e20 am: 2a7b438754 am: fca1027937 am: d8e897ae9e am: 6e15baff97 am: 06c27a9feb am: e6b649a380 am: 902decfc99 am: 77aac03fb6 am: 5a2ae5cc27 am: 117691fe59 am: 60c9a6e4c7 am: 565a2fba56
am: 3c6799a870
Change-Id: I5c065e48a043c697c801f84a26bf9dedde9750da
diff --git a/libFDK/include/fixpoint_math.h b/libFDK/include/fixpoint_math.h
index 6aa0a90..0d50f0a 100644
--- a/libFDK/include/fixpoint_math.h
+++ b/libFDK/include/fixpoint_math.h
@@ -479,19 +479,15 @@
/**
* \brief Calculate the value of 1/i where i is a integer value. It supports
- * input values from 0 upto 79.
+ * input values from 1 upto 80.
* \param intValue Integer input value.
* \param FIXP_DBL representation of 1/intValue
*/
inline FIXP_DBL GetInvInt(int intValue)
{
- FDK_ASSERT((intValue >= 0) && (intValue < 80));
- if (intValue > 79)
- return invCount[79];
- else if (intValue < 0)
- return invCount[0];
- else
- return invCount[intValue];
+ FDK_ASSERT((intValue > 0) && (intValue < 80));
+ FDK_ASSERT(intValue<80);
+ return invCount[intValue];
}