Skip to content

Commit

Permalink
stress-jpeg: fix bitwise & on bits of RGB brown noise
Browse files Browse the repository at this point in the history
Use bitwise & instead of logical &&

Fixes: 64419cf ("stress-jpeg: add brown noise source image type")
Signed-off-by: Colin Ian King <[email protected]>
  • Loading branch information
ColinIanKing committed Apr 29, 2022
1 parent 950fa47 commit 27aa0b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stress-jpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 27aa0b0

Please sign in to comment.