From 3146305de14bbb27a4c4333d44c54e5fe9043c4b Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 14 Sep 2020 09:48:33 +0200 Subject: [PATCH] waveshare: fix RGB for some screensizes --- client/src/cmdhfwaveshare.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/cmdhfwaveshare.c b/client/src/cmdhfwaveshare.c index 02841e53f..bcddce856 100644 --- a/client/src/cmdhfwaveshare.c +++ b/client/src/cmdhfwaveshare.c @@ -216,8 +216,8 @@ static int read_bmp_rgb(const uint8_t *bmp, const size_t bmpsize, uint8_t **blac Black_data = Black_data << 1; Red_data = Red_data << 1; } - // Skip BMP line padding - offset+=(((pbmpheader->BMP_Width*3/4)+1)*4)-pbmpheader->BMP_Width*3; + // Skip BMP line padding: we accumulate 3* %4 per line and need one more %4 as padding + offset += pbmpheader->BMP_Width % 4; } return PM3_SUCCESS; }