Skip to content

Commit 4f11ad7

Browse files
committed
lv_draw_img: fix buffer size
1 parent 436c09a commit 4f11ad7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lv_draw/lv_draw_img.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ static lv_res_t lv_img_draw_core(const lv_area_t * coords, const lv_area_t * mas
305305
lv_coord_t width = lv_area_get_width(&mask_com);
306306

307307
#if LV_COMPILER_VLA_SUPPORTED
308-
uint8_t buf[(lv_area_get_width(&mask_com) * (LV_COLOR_SIZE + 1))];
308+
uint8_t buf[(lv_area_get_width(&mask_com) * ((LV_COLOR_DEPTH >> 3) + 1))];
309309
#else
310310
uint8_t buf[LV_HOR_RES * ((LV_COLOR_DEPTH >> 3) + 1)]; /*+1 because of the possible alpha byte*/
311311
#endif

0 commit comments

Comments
 (0)