From 33f5448a382fda5b2dae405c1510a1927d7f0fa2 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 17 Jan 2020 15:49:36 +0100 Subject: [PATCH] fix overflow on 16 bit MCU in font processing --- src/lv_font/lv_font_fmt_txt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lv_font/lv_font_fmt_txt.c b/src/lv_font/lv_font_fmt_txt.c index a36be57c8..78fcccdd0 100644 --- a/src/lv_font/lv_font_fmt_txt.c +++ b/src/lv_font/lv_font_fmt_txt.c @@ -475,5 +475,5 @@ static uint8_t rle_next(void) */ static int32_t unicode_list_compare(const void * ref, const void * element) { - return (*(uint16_t *)ref) - (*(uint16_t *)element); + return ((int32_t)(*(uint16_t *)ref)) - ((int32_t)(*(uint16_t *)element)); }