You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
789 B

From dfd88deb1d80b4195ef16cddad256f33b46fbe29 Mon Sep 17 00:00:00 2001
From: Brad Hards <bradh@frogmouth.net>
Date: Wed, 17 Jan 2024 11:47:15 +1100
Subject: [PATCH] examples: fix leak in PNG decoder
This shows up with heif-enc (e.g. with --avif) under valgrind
---
examples/decoder_png.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/examples/decoder_png.cc b/examples/decoder_png.cc
index 5742f02653..c3eeed88a8 100644
--- a/examples/decoder_png.cc
+++ b/examples/decoder_png.cc
@@ -419,6 +419,7 @@ InputImage loadPNG(const char* filename, int output_bit_depth)
} // for
delete[] row_pointers;
+ fclose(fh);
input_image.image = std::shared_ptr<heif_image>(image,
[](heif_image* img) { heif_image_release(img); });