1
0
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:
Benign X 2023-12-23 10:24:36 +08:00 committed by GitHub
parent 372cbeb934
commit ccb1bfee37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}