mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
fix(decoder): fix potential mem leak in image decoder (#5077)
This commit is contained in:
parent
372cbeb934
commit
ccb1bfee37
@ -172,6 +172,7 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
||||
decoded->data_size);
|
||||
if(cache == NULL) {
|
||||
lv_cache_unlock();
|
||||
lv_draw_buf_destroy(decoded);
|
||||
return LV_RESULT_INVALID;
|
||||
}
|
||||
|
||||
|
@ -162,6 +162,7 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
||||
lv_cache_entry_t * cache = lv_cache_add(decoded, 0, decoder->cache_data_type, decoded->data_size);
|
||||
if(cache == NULL) {
|
||||
lv_cache_unlock();
|
||||
lv_draw_buf_destroy(decoded);
|
||||
return LV_RESULT_INVALID;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user