Skip to content

Commit

Permalink
fuzzer: make sure that encoding options are always freed
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Nov 16, 2024
1 parent b638097 commit 235e750
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fuzzing/color_conversion_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,16 @@ 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;
}

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() ==
Expand Down

0 comments on commit 235e750

Please sign in to comment.