From 4494e2a9dad4f1e837e488cecebcedaeb0ef7b39 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 22 Feb 2020 18:43:32 +0000 Subject: Further quietening of scan-build Signed-off-by: Daniel Silverstone --- src/libnsbmp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libnsbmp.c') diff --git a/src/libnsbmp.c b/src/libnsbmp.c index 760ac91..f6ebd6c 100644 --- a/src/libnsbmp.c +++ b/src/libnsbmp.c @@ -325,11 +325,11 @@ static bmp_result bmp_info_header_parse(bmp_image *bmp, uint8_t *data) if (!bmp->colour_table) return BMP_INSUFFICIENT_MEMORY; for (i = 0; i < bmp->colours; i++) { - bmp->colour_table[i] = data[2] | (data[1] << 8) | (data[0] << 16); + uint32_t colour = data[2] | (data[1] << 8) | (data[0] << 16); if (bmp->opaque) - bmp->colour_table[i] |= ((uint32_t)0xff << 24); + colour |= ((uint32_t)0xff << 24); data += palette_size; - bmp->colour_table[i] = read_uint32((uint8_t *)&bmp->colour_table[i],0); + bmp->colour_table[i] = read_uint32((uint8_t *)&colour,0); } /* some bitmaps have a bad offset if there is a pallete, work @@ -771,7 +771,7 @@ static bmp_result bmp_decode_rgb(bmp_image *bmp, uint8_t **start, int bytes) uint8_t cur_byte = 0, bit, i; /* Belt and braces, we shouldn't get here unless this holds */ - assert(bmp->bpp > 0 && bmp->bpp <= 8); + assert(ppb >= 1); for (i = 0; i < ppb; i++) bit_shifts[i] = 8 - ((i + 1) * bmp->bpp); -- cgit v1.2.1