Skip to content

Commit

Permalink
fix compilation of color-conversion-fuzzer
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Nov 16, 2024
1 parent 09ac283 commit 72f1793
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions fuzzing/color_conversion_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static bool read_plane(BitstreamRange* range,
if (!range->prepare_read(static_cast<size_t>(width) * height)) {
return false;
}
if (!image->add_plane(channel, width, height, bit_depth)) {
if (auto err = image->add_plane2(channel, width, height, bit_depth)) {
return false;
}
uint32_t stride;
Expand All @@ -96,7 +96,7 @@ static bool read_plane_interleaved(BitstreamRange* range,
if (!range->prepare_read(static_cast<size_t>(width) * height * comps)) {
return false;
}
if (!image->add_plane(channel, width, height, bit_depth)) {
if (auto err = image->add_plane2(channel, width, height, bit_depth)) {
return false;
}
uint32_t stride;
Expand Down Expand Up @@ -250,12 +250,15 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
int output_bpp = 0; // Same as input.
heif_encoding_options* options = heif_encoding_options_alloc();

auto out_image = convert_colorspace(in_image,
static_cast<heif_colorspace>(out_colorspace),
static_cast<heif_chroma>(out_chroma),
nullptr,
output_bpp,
options->color_conversion_options);
auto out_image_result = convert_colorspace(in_image,
static_cast<heif_colorspace>(out_colorspace),
static_cast<heif_chroma>(out_chroma),
nullptr,
output_bpp,
options->color_conversion_options);
assert(out_image_result);
auto out_image = *out_image_result;

heif_encoding_options_free(options);

if (!out_image) {
Expand Down

0 comments on commit 72f1793

Please sign in to comment.