From c27808657bd633fade6fe3e5f193504aab713b07 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 4 Jan 2012 22:50:09 +0100 Subject: [PATCH] sm501: Fix size of color_reg color_reg is expected to hold 32 bit values, so it was too small. This bug was reported by coverity: hw/sm501.c:624: result_independent_of_operands: color_reg >> 16 is 0 regardless of the values of its operands. This occurs as the bitwise first operand of '&'. Cc: Shin-ichiro Kawasaki Signed-off-by: Stefan Weil Signed-off-by: Aurelien Jarno --- hw/sm501.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sm501.c b/hw/sm501.c index 326531c57e..09c5894cf9 100644 --- a/hw/sm501.c +++ b/hw/sm501.c @@ -593,7 +593,7 @@ static inline uint32_t get_hwc_x(SM501State *state, int crt) */ static inline uint16_t get_hwc_color(SM501State *state, int crt, int index) { - uint16_t color_reg = 0; + uint32_t color_reg = 0; uint16_t color_565 = 0; if (index == 0) {