From 8a139a67ad3ceaaa236ae3c62d32f652e4e5f600 Mon Sep 17 00:00:00 2001 From: Dirk Farin Date: Sun, 17 Nov 2024 00:01:08 +0100 Subject: [PATCH] Remove invalid assertion from file_fuzzer --- fuzzing/file_fuzzer.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fuzzing/file_fuzzer.cc b/fuzzing/file_fuzzer.cc index 5608686f6b..c43c1630b8 100644 --- a/fuzzing/file_fuzzer.cc +++ b/fuzzing/file_fuzzer.cc @@ -51,7 +51,11 @@ static void TestDecodeImage(struct heif_context* ctx, heif_image_handle_get_metadata_type(handle, metadata_ids[i]); heif_image_handle_get_metadata_content_type(handle, metadata_ids[i]); size_t metadata_size = heif_image_handle_get_metadata_size(handle, metadata_ids[i]); - assert(metadata_size < filesize); + + // This assertion is invalid. Metadata can in fact be larger than the file if there are several + // overlapping iloc extents. Does not make much sense, but it is technically valid. + //assert(metadata_size < filesize); + uint8_t* metadata_data = static_cast(malloc(metadata_size)); assert(metadata_data); heif_image_handle_get_metadata(handle, metadata_ids[i], metadata_data);