1
0
mirror of https://github.com/CTCaer/hekate.git synced 2024-12-26 00:16:33 +00:00

nyx: Fix a long standing heap corruption issue

This commit is contained in:
CTCaer 2020-04-30 03:51:13 +03:00
parent a7c64f8ba2
commit 3cecb03dac

View File

@ -942,20 +942,21 @@ static lv_res_t _launch_more_cfg_action(lv_obj_t *btn)
static lv_res_t _win_launch_close_action(lv_obj_t * btn) static lv_res_t _win_launch_close_action(lv_obj_t * btn)
{ {
// Cleanup icons. // Cleanup icons.
lv_btn_ext_t *ext; for (u32 i = 0; i < 8; i++)
lv_obj_t *btn_tmp;
for (u32 i = 0; i < 16; i += 2)
{ {
btn_tmp = launch_ctxt[i]; lv_obj_t *btn = launch_ctxt[i * 2];
ext = lv_obj_get_ext_attr(btn_tmp); lv_btn_ext_t *ext = lv_obj_get_ext_attr(btn);
if (ext->idx) if (ext->idx)
{ {
btn_tmp = lv_obj_get_child(btn_tmp, NULL); // This gets latest object, which is the button overlay. So iterate 2 times.
lv_img_dsc_t *tmp = (lv_img_dsc_t *)lv_img_get_src(btn_tmp); lv_obj_t * img = lv_obj_get_child(btn, NULL);
img = lv_obj_get_child(btn, img);
lv_img_dsc_t *src = (lv_img_dsc_t *)lv_img_get_src(img);
// Avoid freeing base icons. // Avoid freeing base icons.
if ((tmp != icon_switch) && (tmp != icon_payload) && (tmp != icon_lakka)) if ((src != icon_switch) && (src != icon_payload) && (src != icon_lakka))
free(tmp); free(src);
} }
} }