aboutsummaryrefslogtreecommitdiff
path: root/hw/display
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-06-15 18:06:08 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-06-15 18:06:08 +0100
commit644ead5be1a851abff16886240c5c6fc1c5137c0 (patch)
treeb2ecf5ebe983e9ce1ed1f1eaa957c143c3d9e075 /hw/display
parent235069a380147e31236b94c31528fc5170c3a421 (diff)
hw/display/exynos4210_fimd: Fix bit-swapping code
fimd_swap_data() includes code to reverse the bits in a 64-bit integer, but an off-by-one error meant that it would try to shift off the top of the integer. Correct the bug (spotted by Coverity). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1432912615-23107-1-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'hw/display')
-rw-r--r--hw/display/exynos4210_fimd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c
index 72b3a1d063..603ef50568 100644
--- a/hw/display/exynos4210_fimd.c
+++ b/hw/display/exynos4210_fimd.c
@@ -337,7 +337,7 @@ static inline void fimd_swap_data(unsigned int swap_ctl, uint64_t *data)
if (swap_ctl & FIMD_WINCON_SWAP_BITS) {
res = 0;
for (i = 0; i < 64; i++) {
- if (x & (1ULL << (64 - i))) {
+ if (x & (1ULL << (63 - i))) {
res |= (1ULL << i);
}
}