From 235e750f467468e7b31fba3edefa26a27ed21914 Mon Sep 17 00:00:00 2001 From: Dirk Farin Date: Sat, 16 Nov 2024 20:33:10 +0100 Subject: [PATCH] fuzzer: make sure that encoding options are always freed --- fuzzing/color_conversion_fuzzer.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fuzzing/color_conversion_fuzzer.cc b/fuzzing/color_conversion_fuzzer.cc index c80acfd879..170ac6790c 100644 --- a/fuzzing/color_conversion_fuzzer.cc +++ b/fuzzing/color_conversion_fuzzer.cc @@ -256,6 +256,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) nullptr, output_bpp, options->color_conversion_options); + + heif_encoding_options_free(options); + if (out_image_result.error) { // Conversion is not supported. return 0; @@ -263,8 +266,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) auto out_image = *out_image_result; - heif_encoding_options_free(options); - assert(out_image->get_width() == width); assert(out_image->get_height() == height); assert(out_image->get_chroma_format() ==