diff options
-rw-r--r-- | firmware/drivers/lcd-16bit-common.c | 20 |
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, | |||
316 | x += lcd_current_viewport->x; | 316 | x += lcd_current_viewport->x; |
317 | y += lcd_current_viewport->y; | 317 | y += lcd_current_viewport->y; |
318 | 318 | ||
319 | /* 'Bugfix' mono_bitmap_part reads ahead in the buffer, While this is a bug | ||
320 | * if the height is <= char bit pixels other memory gets read but is not used | ||
321 | * the other option is to check in the hot code path but this appears | ||
322 | * sufficient, limit to the sim to stop Address Sanitizer errors | ||
323 | */ | ||
324 | #if defined(SIMULATOR) && \ | ||
325 | (!defined(LCD_STRIDEFORMAT) || LCD_STRIDEFORMAT != VERTICAL_STRIDE) | ||
326 | /* vertical stride targets don't seem affected by this */ | ||
327 | if (height <= CHAR_BIT) | ||
328 | stride = 0; | ||
329 | #endif | ||
330 | |||
319 | #if defined(HAVE_VIEWPORT_CLIP) | 331 | #if defined(HAVE_VIEWPORT_CLIP) |
320 | /********************* Viewport on screen clipping ********************/ | 332 | /********************* Viewport on screen clipping ********************/ |
321 | /* nothing to draw? */ | 333 | /* nothing to draw? */ |
@@ -331,14 +343,6 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x, | |||
331 | x = 0; | 343 | x = 0; |
332 | } | 344 | } |
333 | 345 | ||
334 | /* 'Bugfix' mono_bitmap_part reads ahead in the buffer, | ||
335 | * if the height is <= char bit pixels other memory gets read | ||
336 | * the other option is to check in the hot code path but this appears | ||
337 | * sufficient | ||
338 | */ | ||
339 | if (height <= CHAR_BIT) | ||
340 | stride = 0; | ||
341 | |||
342 | if (y < 0) | 346 | if (y < 0) |
343 | { | 347 | { |
344 | height += y; | 348 | height += y; |