Skip to contentSkip to conversation

fbdev: fix 1bpp logo for unusual width

PATCH In review David Lechner 2 participants 2 messages Jul 28, 2017 – Aug 18, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbdev: fix 1bpp logo for unusual width

This check is needed in the case where the width of the framebuffer is not a multiple of 8 pixels. For example, LEGO MINDSTORMS EV3 has a 178x128 1bpp display.

---
 drivers/video/fbdev/core/fbmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/core/fbmem.c +1 -1
index 7a42238..805a42c 100644
@@ -315,7 +315,7 @@ static void fb_set_logo(struct fb_info *info,
 		for (i = 0; i < logo->height; i++) {
 			for (j = 0; j < logo->width; src++) {
 				d = *src ^ xor;
-				for (k = 7; k >= 0; k--) {
+				for (k = 7; k >= 0 && j < logo->width; k--) {
 					*dst++ = ((d >> k) & 1) ? fg : 0;
 					j++;
 				}
Signature · 1 line
2.7.4
#1 lore raw
Quoted 5 lines · David Lechner

This check is needed in the case where the width of the framebuffer is not a multiple of 8 pixels. For example, LEGO MINDSTORMS EV3 has a 178x128 1bpp display.

Patch queued for 4.14, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics