16 bit lcd_mono_bitmap

'Bugfix' mono_bitmap_part reads ahead in the buffer,
if the height is <= char bit pixels other memory gets read

Change-Id: I6e0d7a9017e1f9c371ffbd56af149ac20cb82341
This commit is contained in:
William Wilgus 2021-04-17 00:37:11 -04:00 committed by Solomon Peachy
parent afe80742a5
commit 85fbbd9c7f

View file

@ -462,7 +462,14 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
/* Draw a full monochrome bitmap */
void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width, int height)
{
lcd_mono_bitmap_part(src, 0, 0, width, x, y, width, height);
int stride = width;
/* 'Bugfix' mono_bitmap_part reads ahead in the buffer,
* if the height is <= char bit pixels other memory gets read
*/
if (height <= CHAR_BIT)
stride = 0;
lcd_mono_bitmap_part(src, 0, 0, stride, x, y, width, height);
}