From ad1186431220e90d16af4580aec461311ad031cb Mon Sep 17 00:00:00 2001 From: Kuba <36666515+QB4-dev@users.noreply.github.com> Date: Thu, 5 Oct 2023 16:02:31 +0200 Subject: [PATCH] Update u8x8_d_framebuffer.c screensize variable was not set --- sys/linux-fb/common/u8x8_d_framebuffer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/linux-fb/common/u8x8_d_framebuffer.c b/sys/linux-fb/common/u8x8_d_framebuffer.c index b5e7cf0e..7bde08c7 100644 --- a/sys/linux-fb/common/u8x8_d_framebuffer.c +++ b/sys/linux-fb/common/u8x8_d_framebuffer.c @@ -67,10 +67,11 @@ uint8_t u8x8_LinuxFb_alloc(int fbfd, u8x8_linuxfb_t *fb) fb->active_color = 0xFFFFFF; tile_width = (fb->vinfo.xres+7)/8; tile_height = (fb->vinfo.yres+7)/8; + screensize = tile_width*tile_height * 8; /* allocate the tile buffer twice, one for u8x8 and another bitmap for u8g2 */ - fb->u8x8_buf = (uint8_t *)malloc(tile_width*tile_height*8*2); - fb->u8g2_buf = (uint8_t *)fb->u8x8_buf + tile_width*tile_height*8; + fb->u8x8_buf = (uint8_t *)malloc(screensize*2); + fb->u8g2_buf = (uint8_t *)fb->u8x8_buf + screensize; if ( fb->u8x8_buf == NULL ) { fb->u8g2_buf = NULL;