Commit 31bb79ec for libheif

commit 31bb79ec934d952f58d20e848cb17678e68eced5
Author: Dirk Farin <dirk.farin@gmail.com>
Date:   Mon Feb 9 19:19:13 2026 +0100

    fix writing rrggbb and loading block pixel interleave with block_size==0

diff --git a/libheif/codecs/uncompressed/unc_decoder_block_pixel_interleave.cc b/libheif/codecs/uncompressed/unc_decoder_block_pixel_interleave.cc
index 2b1cceb9..7d52e575 100644
--- a/libheif/codecs/uncompressed/unc_decoder_block_pixel_interleave.cc
+++ b/libheif/codecs/uncompressed/unc_decoder_block_pixel_interleave.cc
@@ -60,12 +60,16 @@ Error unc_decoder_block_pixel_interleave::decode_tile(const std::vector<uint8_t>
                                                        std::shared_ptr<HeifPixelImage>& img,
                                                        uint32_t out_x0, uint32_t out_y0)
 {
-  const uint32_t block_size = m_uncC->get_block_size();
+  uint32_t block_size = m_uncC->get_block_size();
   const uint32_t pixel_size = m_uncC->get_pixel_size();
   const bool little_endian = m_uncC->is_block_little_endian();
   const bool pad_lsb = m_uncC->is_block_pad_lsb();
   const bool reversed = m_uncC->is_block_reversed();

+  if (block_size == 0) {
+    block_size = pixel_size;
+  }
+
   // Build per-component info
   struct ComponentInfo {
     uint32_t shift;
@@ -199,6 +203,10 @@ bool unc_decoder_factory_block_pixel_interleave::can_decode(const std::shared_pt
     return false;
   }

+  if (uncC->is_components_little_endian()) {
+    return false;
+  }
+
   for (const auto& component : uncC->get_components()) {
     if (component.component_bit_depth > 16) {
       return false;
diff --git a/libheif/codecs/uncompressed/unc_encoder_rrggbb.cc b/libheif/codecs/uncompressed/unc_encoder_rrggbb.cc
index d83bbf8d..18bb43a8 100644
--- a/libheif/codecs/uncompressed/unc_encoder_rrggbb.cc
+++ b/libheif/codecs/uncompressed/unc_encoder_rrggbb.cc
@@ -83,6 +83,7 @@ unc_encoder_rrggbb::unc_encoder_rrggbb(const std::shared_ptr<const HeifPixelImag
   m_uncC->set_interleave_type(interleave_mode_pixel);
   m_uncC->set_sampling_type(sampling_mode_no_subsampling);
   m_uncC->set_components_little_endian(little_endian);
+  m_uncC->set_pixel_size(m_bytes_per_pixel);

   m_uncC->add_component({0, bpp, component_format_unsigned, component_align_size});
   m_uncC->add_component({1, bpp, component_format_unsigned, component_align_size});