CRAS: mix: remove undefined behaviors around shift

The error messages are:
server/cras_mix_ops.c:233:28: runtime error: left shift of negative
value -2105343
tests/mix_unittest.cc:414:33: runtime error: left shift of negative
value -2105343

Add casts and bitwise AND to make ubsan happy.

BUG=chromium:911689
TEST=FEATURES=test USE=ubsan emerge-atlas adhd
Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org>
Change-Id: I7e00195c40c9d61989a4061dbe9cbae420a3d895
Reviewed-on: https://chromium-review.googlesource.com/1362263
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
2 files changed