summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-11-08 17:45:31 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2021-11-08 17:52:09 -0500
commit9f1cab154c8ac651a6468fd0f992602e6e1673cd (patch)
treec3a4bbd9c73a7e4415f0b360f2e2538a19eda2e1
parent8c954c68e59ca2e644d08524f74e9dc5b728ee6e (diff)
downloadrockbox-9f1cab154c8ac651a6468fd0f992602e6e1673cd.tar.gz
rockbox-9f1cab154c8ac651a6468fd0f992602e6e1673cd.zip
lcd-16bit-common move bugfix to sim only
Ive seen no ill effects having this disabled on target so limit it to the sim to stop Address Sanitizer from dumping on the extra byte read. the bad data is never used AFAICT since the loop ends Change-Id: I8cb54e9d1f8fe28747867d861a015edb3dbfa5ff
-rw-r--r--firmware/drivers/lcd-16bit-common.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/firmware/drivers/lcd-16bit-common.c b/firmware/drivers/lcd-16bit-common.c
index 25e3b89dc3..b9c9060216 100644
--- a/firmware/drivers/lcd-16bit-common.c
+++ b/firmware/drivers/lcd-16bit-common.c
@@ -316,6 +316,18 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
x += lcd_current_viewport->x;
y += lcd_current_viewport->y;
+ /* 'Bugfix' mono_bitmap_part reads ahead in the buffer, While this is a bug
+ * if the height is <= char bit pixels other memory gets read but is not used
+ * the other option is to check in the hot code path but this appears
+ * sufficient, limit to the sim to stop Address Sanitizer errors
+ */
+#if defined(SIMULATOR) && \
+ (!defined(LCD_STRIDEFORMAT) || LCD_STRIDEFORMAT != VERTICAL_STRIDE)
+ /* vertical stride targets don't seem affected by this */
+ if (height <= CHAR_BIT)
+ stride = 0;
+#endif
+
#if defined(HAVE_VIEWPORT_CLIP)
/********************* Viewport on screen clipping ********************/
/* nothing to draw? */
@@ -331,14 +343,6 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
x = 0;
}
- /* 'Bugfix' mono_bitmap_part reads ahead in the buffer,
- * if the height is <= char bit pixels other memory gets read
- * the other option is to check in the hot code path but this appears
- * sufficient
- */
- if (height <= CHAR_BIT)
- stride = 0;
-
if (y < 0)
{
height += y;