fix(refr): fix memory write out of bounds issue

This commit is contained in:
Gabor Kiss-Vamosi
2022-07-05 08:57:56 +02:00
parent 23c8a91a11
commit 13c99fc4b6
3 changed files with 24 additions and 7 deletions

View File

@@ -438,9 +438,9 @@ void _lv_disp_refr_timer(lv_timer_t * tmr)
uint32_t max_kb_tenth = (max_size - (max_kb * 1024)) / 102;
lv_label_set_text_fmt(mem_label,
"%"LV_PRIu32 ".%"LV_PRIu32 " kB used (%d %%)\n"
"%"LV_PRIu32 ".%"LV_PRIu32 " kB max, %d%% frag.",
"%d%% frag.",
used_kb, used_kb_tenth, mon.used_pct,
max_kb, max_kb_tenth, mon.frag_pct);
mon.frag_pct);
}
#endif
@@ -958,7 +958,7 @@ void refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj)
if((flags & LV_DRAW_LAYER_FLAG_CAN_SUBDIVIDE) == 0) break;
layer_ctx->area_act.y1 = layer_ctx->area_act.y2 + 1;
layer_ctx->area_act.y2 += layer_ctx->area_act.y1 + layer_ctx->max_row_with_no_alpha;
layer_ctx->area_act.y2 = layer_ctx->area_act.y1 + layer_ctx->max_row_with_no_alpha - 1;
}
lv_draw_layer_destroy(draw_ctx, layer_ctx);

View File

@@ -128,7 +128,6 @@ static void draw_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, co
if(!mask_any && dsc->radius == 0 && (grad_dir == LV_GRAD_DIR_NONE)) {
blend_dsc.blend_area = &bg_coords;
blend_dsc.opa = dsc->bg_opa;
lv_draw_sw_blend(draw_ctx, &blend_dsc);
return;
}