summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-04-17 00:37:11 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-04-17 15:33:58 +0000
commit85fbbd9c7f3e1ac84910a16095a297cbe13a8123 (patch)
treea469179a599eaf07f3c8ad7ba07308e80e536e7b
parentafe80742a5d39c3d7fb9fc3e104bd6d18bf28da9 (diff)
downloadrockbox-85fbbd9c7f3e1ac84910a16095a297cbe13a8123.tar.gz
rockbox-85fbbd9c7f3e1ac84910a16095a297cbe13a8123.zip
16 bit lcd_mono_bitmap
'Bugfix' mono_bitmap_part reads ahead in the buffer, if the height is <= char bit pixels other memory gets read Change-Id: I6e0d7a9017e1f9c371ffbd56af149ac20cb82341
-rw-r--r--firmware/drivers/lcd-16bit-common.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/firmware/drivers/lcd-16bit-common.c b/firmware/drivers/lcd-16bit-common.c
index 49e515f59f..5ec142c855 100644
--- a/firmware/drivers/lcd-16bit-common.c
+++ b/firmware/drivers/lcd-16bit-common.c
@@ -462,7 +462,14 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
462/* Draw a full monochrome bitmap */ 462/* Draw a full monochrome bitmap */
463void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width, int height) 463void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width, int height)
464{ 464{
465 lcd_mono_bitmap_part(src, 0, 0, width, x, y, width, height); 465 int stride = width;
466
467 /* 'Bugfix' mono_bitmap_part reads ahead in the buffer,
468 * if the height is <= char bit pixels other memory gets read
469 */
470 if (height <= CHAR_BIT)
471 stride = 0;
472 lcd_mono_bitmap_part(src, 0, 0, stride, x, y, width, height);
466} 473}
467 474
468 475