diff --git a/firmware/lcd/render.c b/firmware/lcd/render.c index c98b147..37f0110 100644 --- a/firmware/lcd/render.c +++ b/firmware/lcd/render.c @@ -223,7 +223,9 @@ int DoChar(int sx, int sy, int c){ _getFontData(SEEK_DATA,toff); UINT res; UINT readbytes; - res = f_read(&file, charBuf, width*height, &readbytes); + UINT size = width * height; + if(size > MAXCHR) size = MAXCHR; + res = f_read(&file, charBuf, size, &readbytes); if(res != FR_OK || readbytes MAXCHR) size = MAXCHR; + res = f_read(&file, charBuf, size, &readbytes); if(res != FR_OK || readbytes