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) {