[frameworks/kimageformats] src/imageformats: heif: increase Maximum number of child boxes limit
Daniel Novomeský <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit a0825fe5cb5756a521aa6385ce50397fa7ca44db by Daniel Novomeský.
Committed on 18/07/2026 at 10:59.
Pushed by novomeskyd into branch 'master'.
heif: increase Maximum number of child boxes limit
M +5 -0 src/imageformats/heif.cpp
https://invent.kde.org/frameworks/kimageformats/-/commit/a0825fe5cb5756a521aa6385ce50397fa7ca44db
diff --git a/src/imageformats/heif.cpp b/src/imageformats/heif.cpp
index e5cd3552..ea81dec4 100644
--- a/src/imageformats/heif.cpp
+++ b/src/imageformats/heif.cpp
@@ -828,6 +828,11 @@ bool HEIFHandler::ensureDecoder()
if (auto heif_limits = heif_context_get_security_limits(ctx)) {
heif_limits->max_image_size_pixels = quint64(HEIF_MAX_IMAGE_WIDTH) * HEIF_MAX_IMAGE_HEIGHT;
heif_limits->max_memory_block_size = quint64(QImageReader::allocationLimit()) * 1024 * 1024;
+
+ static constexpr uint32_t relaxed_childboxes_limit = 360;
+ if (heif_limits->max_children_per_box > 0 && heif_limits->max_children_per_box < relaxed_childboxes_limit) {
+ heif_limits->max_children_per_box = relaxed_childboxes_limit;
+ }
#if LIBHEIF_HAVE_VERSION(1, 20, 0)
heif_limits->max_total_memory = heif_limits->max_memory_block_size;
#endif