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
2 changed files with 2 additions and 0 deletions
@@ -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;
}
+1
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;
}