fix(draw_sw_img): avoid divide by zero (#7447)

This commit is contained in:
Paul Vogel
2024-12-17 19:08:23 -06:00
committed by GitHub
parent cd9c7e5b6b
commit e1f2b2e451
+3
View File
@@ -388,6 +388,9 @@ static void recolor_only(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t *
uint8_t * tmp_buf;
int32_t buf_h;
uint32_t buf_stride = blend_w * px_size;
if(buf_stride == 0) {
buf_stride = 1;
}
buf_h = MAX_BUF_SIZE / buf_stride;
if(buf_h > blend_h) buf_h = blend_h;
tmp_buf = lv_malloc(buf_stride * buf_h);