mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-01 00:51:49 +08:00
fix(png): fix mem leak in libpng decoder (#6952)
Signed-off-by: lijianjun <lijianjun@xiaomi.com> Co-authored-by: lijianjun <lijianjun@xiaomi.com>
This commit is contained in:
@@ -316,6 +316,7 @@ static lv_draw_buf_t * decode_png(lv_image_decoder_dsc_t * dsc)
|
|||||||
if(dsc->src_type == LV_IMAGE_SRC_FILE) {
|
if(dsc->src_type == LV_IMAGE_SRC_FILE) {
|
||||||
LV_LOG_ERROR("alloc PNG_IMAGE_SIZE(%" LV_PRIu32 ") failed: %s", (uint32_t)PNG_IMAGE_SIZE(image),
|
LV_LOG_ERROR("alloc PNG_IMAGE_SIZE(%" LV_PRIu32 ") failed: %s", (uint32_t)PNG_IMAGE_SIZE(image),
|
||||||
(const char *)dsc->src);
|
(const char *)dsc->src);
|
||||||
|
png_image_free(&image);
|
||||||
lv_free(png_data);
|
lv_free(png_data);
|
||||||
}
|
}
|
||||||
else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE)
|
else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE)
|
||||||
|
|||||||
Reference in New Issue
Block a user