From 27aa0b02cfc1c7efc4647c87afc1266266f372bc Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Fri, 29 Apr 2022 23:03:40 +0100 Subject: [PATCH] stress-jpeg: fix bitwise & on bits of RGB brown noise Use bitwise & instead of logical && Fixes: 64419cfe4e8f ("stress-jpeg: add brown noise source image type") Signed-off-by: Colin Ian King --- stress-jpeg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stress-jpeg.c b/stress-jpeg.c index 919334c04..39794e9b5 100644 --- a/stress-jpeg.c +++ b/stress-jpeg.c @@ -197,9 +197,9 @@ static void OPTIMIZE3 stress_rgb_brown( int32_t i, size = x_max * y_max * 3; uint8_t *ptr = (uint8_t *)rgb; const uint32_t val = stress_mwc32(); - register uint8_t r = (val >> 24) && 0xff; - register uint8_t g = (val >> 16) && 0xff; - register uint8_t b = (val >> 8) && 0xff; + register uint8_t r = (val >> 24) & 0xff; + register uint8_t g = (val >> 16) & 0xff; + register uint8_t b = (val >> 8) & 0xff; for (i = 0; i < size; i++) { const uint8_t v = stress_mwc8();