Commit 294d9c09 for libheif
commit 294d9c09db838aba9a615a6b6aba4c7019b7bbfd
Author: Dirk Farin <dirk.farin@gmail.com>
Date: Mon May 18 17:03:25 2026 +0200
reject unci images with no ispe box
diff --git a/libheif/image-items/unc_image.cc b/libheif/image-items/unc_image.cc
index 22bbbbf5..cea15f2e 100644
--- a/libheif/image-items/unc_image.cc
+++ b/libheif/image-items/unc_image.cc
@@ -430,6 +430,12 @@ Error ImageItem_uncompressed::initialize_decoder()
"No 'uncC' box found."};
}
+ if (!ispe) {
+ return Error{heif_error_Invalid_input,
+ heif_suberror_Unspecified,
+ "No 'ispe' box found for uncompressed image item."};
+ }
+
m_decoder = std::make_shared<Decoder_uncompressed>(uncC, cmpd, ispe);
return Error::Ok;