From 4da2842330bc630c7ca9a568b0f3d26f151f9caf Mon Sep 17 00:00:00 2001 From: Dirk Farin Date: Wed, 30 Oct 2024 00:45:54 +0100 Subject: [PATCH] unci: little-endian inputs with != 8 bits/component are not supported --- libheif/codecs/uncompressed/unc_codec.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/libheif/codecs/uncompressed/unc_codec.cc b/libheif/codecs/uncompressed/unc_codec.cc index 8718cbc5fe..49adab1ee3 100644 --- a/libheif/codecs/uncompressed/unc_codec.cc +++ b/libheif/codecs/uncompressed/unc_codec.cc @@ -201,13 +201,18 @@ static Error uncompressed_image_type_is_supported(const std::shared_ptris_components_little_endian()) { - return Error(heif_error_Unsupported_feature, - heif_suberror_Unsupported_data_version, - "Uncompressed components_little_endian == 1 is not implemented yet"); + + if (uncC->is_components_little_endian()) { + const auto& comps = uncC->get_components(); + bool all_8_bit = std::all_of(comps.begin(), comps.end(), + [](const Box_uncC::Component& c) { return c.component_bit_depth==8; }); + if (!all_8_bit) { + return Error(heif_error_Unsupported_feature, + heif_suberror_Unsupported_data_version, + "Uncompressed components_little_endian == 1 is not implemented yet"); + } } - */ + if (uncC->is_block_pad_lsb()) { return Error(heif_error_Unsupported_feature, heif_suberror_Unsupported_data_version,