Commit 3a313027 for libheif
commit 3a313027cc3d91b669d3f55fba23ac6404995305
Author: Dirk Farin <dirk.farin@gmail.com>
Date: Tue Sep 29 21:45:48 2026 +0200
tests: skip reading the 'uncv' track of file_layout without the uncompressed codec
The test "moov box with size 0" failed in builds without the uncompressed
codec, which is the default: the frames of its file are stored in an 'uncv'
track, and libheif refuses a track with a sample entry that it does not know.
The test is split in two. Finding the 'moov' box does not depend on the codec
and is always tested. Reading the track is skipped without the codec.
diff --git a/tests/file_layout.cc b/tests/file_layout.cc
index 00a2b863..c814abec 100644
--- a/tests/file_layout.cc
+++ b/tests/file_layout.cc
@@ -142,8 +142,17 @@ TEST_CASE("moov box with size 0 (extends to end of file)") {
REQUIRE(err.error_code == heif_error_Ok);
REQUIRE(file.get_moov_box() != nullptr);
+}
+
+
+TEST_CASE("moov box with size 0 yields a readable sequence track") {
+ // The frames of the file are stored in an 'uncv' track. libheif only knows this sample
+ // entry when it is built with the uncompressed codec (WITH_UNCOMPRESSED_CODEC), and
+ // refuses the track otherwise.
+ if (!heif_have_decoder_for_format(heif_compression_uncompressed)) {
+ SKIP("the uncompressed codec is not compiled in");
+ }
- // The resolved 'moov' box must yield a readable sequence track.
heif_context* context = get_context_for_test_file("moov_size_zero.heif");
REQUIRE(heif_context_has_sequence(context) == 1);
REQUIRE(heif_context_number_of_sequence_tracks(context) == 1);