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:
lion2tomato
2024-10-10 03:47:03 +08:00
committed by GitHub
parent e470349974
commit 302c3b65cd
+1
View File
@@ -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) {
LV_LOG_ERROR("alloc PNG_IMAGE_SIZE(%" LV_PRIu32 ") failed: %s", (uint32_t)PNG_IMAGE_SIZE(image),
(const char *)dsc->src);
png_image_free(&image);
lv_free(png_data);
}
else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE)