From 4f11ad7adb8f6abbf9f3a4cb2c6835fb54063405 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Sun, 28 Oct 2018 09:07:00 +0100 Subject: [PATCH] lv_draw_img: fix buffer size --- lv_draw/lv_draw_img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lv_draw/lv_draw_img.c b/lv_draw/lv_draw_img.c index 0f7fa5153..2d81dbbe3 100644 --- a/lv_draw/lv_draw_img.c +++ b/lv_draw/lv_draw_img.c @@ -305,7 +305,7 @@ static lv_res_t lv_img_draw_core(const lv_area_t * coords, const lv_area_t * mas lv_coord_t width = lv_area_get_width(&mask_com); #if LV_COMPILER_VLA_SUPPORTED - uint8_t buf[(lv_area_get_width(&mask_com) * (LV_COLOR_SIZE + 1))]; + uint8_t buf[(lv_area_get_width(&mask_com) * ((LV_COLOR_DEPTH >> 3) + 1))]; #else uint8_t buf[LV_HOR_RES * ((LV_COLOR_DEPTH >> 3) + 1)]; /*+1 because of the possible alpha byte*/ #endif