mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-02 01:18:04 +08:00
fix(draw_sw_img): avoid divide by zero (#7447)
This commit is contained in:
@@ -388,6 +388,9 @@ static void recolor_only(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t *
|
|||||||
uint8_t * tmp_buf;
|
uint8_t * tmp_buf;
|
||||||
int32_t buf_h;
|
int32_t buf_h;
|
||||||
uint32_t buf_stride = blend_w * px_size;
|
uint32_t buf_stride = blend_w * px_size;
|
||||||
|
if(buf_stride == 0) {
|
||||||
|
buf_stride = 1;
|
||||||
|
}
|
||||||
buf_h = MAX_BUF_SIZE / buf_stride;
|
buf_h = MAX_BUF_SIZE / buf_stride;
|
||||||
if(buf_h > blend_h) buf_h = blend_h;
|
if(buf_h > blend_h) buf_h = blend_h;
|
||||||
tmp_buf = lv_malloc(buf_stride * buf_h);
|
tmp_buf = lv_malloc(buf_stride * buf_h);
|
||||||
|
|||||||
Reference in New Issue
Block a user