diff options
author | William Wilgus <wilgus.william@gmail.com> | 2021-11-08 17:45:31 -0500 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2021-11-08 17:52:09 -0500 |
commit | 9f1cab154c8ac651a6468fd0f992602e6e1673cd (patch) | |
tree | c3a4bbd9c73a7e4415f0b360f2e2538a19eda2e1 /firmware | |
parent | 8c954c68e59ca2e644d08524f74e9dc5b728ee6e (diff) | |
download | rockbox-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
Diffstat (limited to 'firmware')
-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; |