Commit d1851bf5 for libheif
commit d1851bf513a24150c79e82e76d49ff7fdc8d50e3
Author: Dirk Farin <dirk.farin@gmail.com>
Date: Mon Feb 23 01:32:55 2026 +0100
unci: block_pixel_interleave decoder rejects input with pixel_size==0 (#1708)
diff --git a/libheif/codecs/uncompressed/unc_decoder_block_pixel_interleave.cc b/libheif/codecs/uncompressed/unc_decoder_block_pixel_interleave.cc
index 42f1b6ec..848b6186 100644
--- a/libheif/codecs/uncompressed/unc_decoder_block_pixel_interleave.cc
+++ b/libheif/codecs/uncompressed/unc_decoder_block_pixel_interleave.cc
@@ -191,7 +191,12 @@ bool unc_decoder_factory_block_pixel_interleave::can_decode(const std::shared_pt
return false;
}
- if (!(uncC->get_block_size() == 0 || uncC->get_block_size() == uncC->get_pixel_size())) {
+ if (uncC->get_pixel_size() == 0) {
+ return false;
+ }
+
+ // Block size must be either 0 or equal to the pixel_size.
+ if (uncC->get_block_size() != 0 && uncC->get_block_size() != uncC->get_pixel_size()) {
return false;
}