From c25487578072a3775d39c8dddbe58201a5f8dba7 Mon Sep 17 00:00:00 2001 From: Mirco Miranda Date: Mon, 16 Feb 2026 10:12:05 +0100 Subject: [PATCH] ANI: fix possible QByteArray allocation exception --- src/imageformats/ani.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/imageformats/ani.cpp b/src/imageformats/ani.cpp index 0fa1ed8..c8cc22b 100644 --- a/src/imageformats/ani.cpp +++ b/src/imageformats/ani.cpp @@ -418,6 +418,9 @@ bool ANIHandler::ensureScanned() const // IART and INAM are technically inside LIST->INFO but "INFO" is supposedly optional // so just handle those two attributes wherever we encounter them } else if (chunkId == "INAM" || chunkId == "IART") { + if (chunkSize > kMaxQVectorSize) { + return false; + } const QByteArray value = device()->read(chunkSize); if (static_cast(value.size()) != chunkSize) {