mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
fix(cache): fix use after free in lv_cache_invalidate_by_src (#4853)
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
This commit is contained in:
parent
dbf0444d79
commit
cf74e81917
@ -100,11 +100,13 @@ void lv_cache_invalidate(lv_cache_entry_t * entry)
|
||||
|
||||
void lv_cache_invalidate_by_src(const void * src, lv_cache_src_type_t src_type)
|
||||
{
|
||||
lv_cache_entry_t * next;
|
||||
LV_ASSERT(_cache_manager.locked);
|
||||
lv_cache_entry_t * entry = lv_cache_find_by_src(NULL, src, src_type);
|
||||
while(entry) {
|
||||
next = lv_cache_find_by_src(entry, src, src_type);
|
||||
lv_cache_invalidate(entry);
|
||||
entry = lv_cache_find_by_src(entry, src, src_type);
|
||||
entry = next;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user