mirror of
https://github.com/CTCaer/hekate
synced 2024-12-22 11:21:23 +00:00
lvgl: Fix edge case in lv_label_set_text
This fixes an edge case where the original label set was done with set_static_text, the next one with set_text and the text is at the same address. The incomplete check would think that the text resides on heap and it would reallocate it as such, effectively corrupting .data on the next sets.
This commit is contained in:
parent
9c2202fa39
commit
a39ba2cd71
1 changed files with 1 additions and 1 deletions
|
@ -156,7 +156,7 @@ void lv_label_set_text(lv_obj_t * label, const char * text)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ext->text == text) {
|
if(ext->text == text && ext->static_txt == 0) {
|
||||||
/*If set its own text then reallocate it (maybe its size changed)*/
|
/*If set its own text then reallocate it (maybe its size changed)*/
|
||||||
ext->text = lv_mem_realloc(ext->text, strlen(ext->text) + 1);
|
ext->text = lv_mem_realloc(ext->text, strlen(ext->text) + 1);
|
||||||
lv_mem_assert(ext->text);
|
lv_mem_assert(ext->text);
|
||||||
|
|
Loading…
Reference in a new issue