From 6c98bfbc0219e4af7c6bdaacc9f2ff5de6d526db Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Wed, 22 Jan 2020 11:17:43 +0100 Subject: [PATCH] CMSIS-DSP: Corrected preconditions on arm_bilinear_interp functions. rows and cols were switched and the bounds were not correct. --- Include/arm_math.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Include/arm_math.h b/Include/arm_math.h index 824b2ba2..5551f917 100644 --- a/Include/arm_math.h +++ b/Include/arm_math.h @@ -8555,7 +8555,7 @@ float32_t arm_yule_distance(const uint32_t *pA, const uint32_t *pB, uint32_t num /* Care taken for table outside boundary */ /* Returns zero output when values are outside table boundary */ - if (xIndex < 0 || xIndex > (S->numRows - 2) || yIndex < 0 || yIndex > (S->numCols - 2)) + if (xIndex < 0 || xIndex > (S->numCols - 2) || yIndex < 0 || yIndex > (S->numRows - 2)) { return (0); } @@ -8628,7 +8628,7 @@ float32_t arm_yule_distance(const uint32_t *pA, const uint32_t *pB, uint32_t num /* Care taken for table outside boundary */ /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) + if (rI < 0 || rI > (S->numCols - 2) || cI < 0 || cI > (S->numRows - 2)) { return (0); } @@ -8702,7 +8702,7 @@ float32_t arm_yule_distance(const uint32_t *pA, const uint32_t *pB, uint32_t num /* Care taken for table outside boundary */ /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) + if (rI < 0 || rI > (S->numCols - 2) || cI < 0 || cI > (S->numRows - 2)) { return (0); } @@ -8780,7 +8780,7 @@ float32_t arm_yule_distance(const uint32_t *pA, const uint32_t *pB, uint32_t num /* Care taken for table outside boundary */ /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) + if (rI < 0 || rI > (S->numCols - 2) || cI < 0 || cI > (S->numRows - 2)) { return (0); }