1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix(font): fix font_fmt_txt range check (#4207)

This commit is contained in:
sp-cai 2023-05-08 23:00:31 +08:00 committed by GitHub
parent 8c99b359d2
commit 64009fec23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,7 +221,7 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter)
/*Relative code point*/
uint32_t rcp = letter - fdsc->cmaps[i].range_start;
if(rcp > fdsc->cmaps[i].range_length) continue;
if(rcp >= fdsc->cmaps[i].range_length) continue;
uint32_t glyph_id = 0;
if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY) {
glyph_id = fdsc->cmaps[i].glyph_id_start + rcp;