Commit f9c31273 for libheif
commit f9c31273232120e842cdb54267fa568dbd78f152
Author: Dirk Farin <dirk.farin@gmail.com>
Date: Thu Jul 2 12:19:56 2026 +0200
Check decoded image dimensions in meta-size-0 test (#1857)
The regression test for a 'meta' box with size 0 only asserted that
FileLayout::read() succeeded and produced a meta box. Also read the file
through the high-level API and verify the primary image dimensions
(33x11). This confirms that resolving the box to the end of the file
lets the nested 'iprp'/'ispe' metadata parse correctly, not just that
the outer box boundary was accepted.
The check uses the 'ispe' dimensions, so it does not require an AV1
decoder to be available.
diff --git a/tests/file_layout.cc b/tests/file_layout.cc
index 39c48403..afcf6140 100644
--- a/tests/file_layout.cc
+++ b/tests/file_layout.cc
@@ -60,4 +60,14 @@ TEST_CASE("meta box with size 0 (extends to end of file)") {
REQUIRE(err.error_code == heif_error_Ok);
REQUIRE(file.get_meta_box() != nullptr);
+
+ // The resolved 'meta' box must yield the correct image metadata. Read the
+ // file through the high-level API and check the primary image dimensions.
+ // These come from the 'ispe' box, so no AV1 decoder is required.
+ heif_context* context = get_context_for_test_file("meta_size_zero.avif");
+ heif_image_handle* handle = get_primary_image_handle(context);
+ REQUIRE(heif_image_handle_get_ispe_width(handle) == 33);
+ REQUIRE(heif_image_handle_get_ispe_height(handle) == 11);
+ heif_image_handle_release(handle);
+ heif_context_free(context);
}