ANI: fix possible QByteArray allocation exception

This commit is contained in:
Mirco Miranda
2026-02-16 10:12:05 +01:00
parent f3de2e77c1
commit c254875780

View File

@ -418,6 +418,9 @@ bool ANIHandler::ensureScanned() const
// IART and INAM are technically inside LIST->INFO but "INFO" is supposedly optional // IART and INAM are technically inside LIST->INFO but "INFO" is supposedly optional
// so just handle those two attributes wherever we encounter them // so just handle those two attributes wherever we encounter them
} else if (chunkId == "INAM" || chunkId == "IART") { } else if (chunkId == "INAM" || chunkId == "IART") {
if (chunkSize > kMaxQVectorSize) {
return false;
}
const QByteArray value = device()->read(chunkSize); const QByteArray value = device()->read(chunkSize);
if (static_cast<quint32_le>(value.size()) != chunkSize) { if (static_cast<quint32_le>(value.size()) != chunkSize) {