From 42a9582cc148f98e5f687958f2e0e0f4d95ccea5 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 10 Mar 2025 00:34:15 -0400 Subject: [PATCH] Asan fix warning for 1-bit vert 1-bit vertical displays overread the buffer due to the way the packing works, this isn't the hottest path anyway but we can check if height <= 8 and make stride 0 so the dummy data gets the beginning of the data instead Change-Id: I88ab4dc37bfd2d680d125f964beafe0ddfb00645 --- firmware/drivers/lcd-1bit-vert.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firmware/drivers/lcd-1bit-vert.c b/firmware/drivers/lcd-1bit-vert.c index 77eb4ab2a1..77323517cd 100644 --- a/firmware/drivers/lcd-1bit-vert.c +++ b/firmware/drivers/lcd-1bit-vert.c @@ -402,6 +402,9 @@ 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 {