diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2016-08-20 15:29:58 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-08-24 17:40:27 -0700 |
commit | 3218e8954274982836d6bef49076b237ca980959 (patch) | |
tree | a907ba39768013342ed84f664ab6997852fa2ffe | |
parent | bb15561db56728b83ee7fe35e534da7577a7729d (diff) | |
download | chrome-ec-3218e8954274982836d6bef49076b237ca980959.tar.gz |
math_util: Fix rotation by identity.
Rotation by identity matrix from a to b fails if a != b.
BUG=none
BRANCH=none
TEST=Use identity matrix in test motion_lid.c, check test passes.
Change-Id: I852132ee8cd67063921077cd0b7d848d10a730e0
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373722
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r-- | common/math_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/math_util.c b/common/math_util.c index 247bda6dd9..ad98aecdf5 100644 --- a/common/math_util.c +++ b/common/math_util.c @@ -167,7 +167,7 @@ void rotate(const vector_3_t v, const matrix_3x3_t R, vector_3_t res) if (R == NULL) { if (v != res) - memcpy(res, v, sizeof(*v)); + memcpy(res, v, sizeof(vector_3_t)); return; } @@ -196,7 +196,7 @@ void rotate_inv(const vector_3_t v, const matrix_3x3_t R, vector_3_t res) if (R == NULL) { if (v != res) - memcpy(res, v, sizeof(*v)); + memcpy(res, v, sizeof(vector_3_t)); return; } |