From 69664cc4e9957b899d1f5ea458e78f62ba77e511 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Tue, 11 Mar 2025 01:17:12 -0400 Subject: [PATCH] Asan fix warning for 1-bit vert #2 try #2 at this if there isn't enough data remaining to fill the columns then don't read any more data looking at the blame for this driver it had similar logic originally But really on native this is just extra overhead so.. Ifdef out for native Change-Id: I105dea1f7adc0448f345b268fcfa8574333132a9 --- firmware/drivers/lcd-1bit-vert.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/firmware/drivers/lcd-1bit-vert.c b/firmware/drivers/lcd-1bit-vert.c index 77323517cd..214d26b964 100644 --- a/firmware/drivers/lcd-1bit-vert.c +++ b/firmware/drivers/lcd-1bit-vert.c @@ -402,9 +402,6 @@ void ICODE_ATTR LCDFN(bitmap_part)(const unsigned char *src, int src_x, } else { - if (height <= 8) - stride = 0; /* ASAN fix keep from reading beyond buffer */ - dst_end = dst + width; do { @@ -429,7 +426,10 @@ void ICODE_ATTR LCDFN(bitmap_part)(const unsigned char *src, int src_x, dst_col += stride_dst; data >>= 8; } - data |= *src_col << shift; +#if !(CONFIG_PLATFORM & PLATFORM_NATIVE) + if (y>=shift) /* ASAN fix keep from reading beyond buffer */ +#endif + data |= *src_col << shift; bfunc(dst_col, mask_col & mask_bottom, data); } while (dst < dst_end);