From 3218e8954274982836d6bef49076b237ca980959 Mon Sep 17 00:00:00 2001 From: Gwendal Grignou Date: Sat, 20 Aug 2016 15:29:58 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/373722 Reviewed-by: Aseda Aboagye --- common/math_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') 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; } -- cgit v1.2.1