Commit 0c81a846 for libheif
commit 0c81a846b7401dbdb7118afd0761057f21e43511
Author: Dirk Farin <dirk.farin@gmail.com>
Date: Tue May 19 19:06:43 2026 +0200
unci: update unit tests with new error response
diff --git a/libheif/codecs/uncompressed/unc_boxes.cc b/libheif/codecs/uncompressed/unc_boxes.cc
index a259984b..a07881b5 100644
--- a/libheif/codecs/uncompressed/unc_boxes.cc
+++ b/libheif/codecs/uncompressed/unc_boxes.cc
@@ -346,8 +346,8 @@ Error Box_uncC::parse(BitstreamRange& range, const heif_security_limits* limits)
// The field is stored as `count - 1`, so 0xFFFFFFFF would mean 2^32 tiles,
// which we cannot represent in our uint32 m_num_tile_cols/rows. Reject this
- // unconditionally; the security-limit check below is policy and may be
- // disabled by the user, but this representation limit must always hold.
+ // before the security-limit check so that disabling the security limit does
+ // not silently turn this into a divide-by-zero in get_heif_image_tiling().
if (num_tile_cols_minus_one == 0xFFFFFFFF || num_tile_rows_minus_one == 0xFFFFFFFF) {
return {heif_error_Unsupported_feature,
heif_suberror_Invalid_parameter_value,
diff --git a/tests/uncompressed_box.cc b/tests/uncompressed_box.cc
index c65e1783..21b3fe37 100644
--- a/tests/uncompressed_box.cc
+++ b/tests/uncompressed_box.cc
@@ -326,8 +326,8 @@ TEST_CASE("uncC_parse_excess_tile_cols") {
std::shared_ptr<Box> box;
Error error = Box::read(range, &box, heif_get_global_security_limits());
REQUIRE(range.error() == 0);
- REQUIRE(error.error_code == 6);
- REQUIRE(error.sub_error_code == 1000);
+ REQUIRE(error.error_code == heif_error_Unsupported_feature);
+ REQUIRE(error.sub_error_code == heif_suberror_Invalid_parameter_value);
}
TEST_CASE("uncC_parse_excess_tile_rows") {
@@ -348,8 +348,8 @@ TEST_CASE("uncC_parse_excess_tile_rows") {
std::shared_ptr<Box> box;
Error error = Box::read(range, &box, heif_get_global_security_limits());
REQUIRE(range.error() == 0);
- REQUIRE(error.error_code == 6);
- REQUIRE(error.sub_error_code == 1000);
+ REQUIRE(error.error_code == heif_error_Unsupported_feature);
+ REQUIRE(error.sub_error_code == heif_suberror_Invalid_parameter_value);
}
TEST_CASE("cmpC_defl") {