ani: Make sure riffSizeData is of the correct size before doing the quint32_le cast dance

oss-fuzz/29290
This commit is contained in:
Albert Astals Cid
2021-01-05 21:20:35 +01:00
parent bf3f99abf5
commit c72c9f577b

View File

@ -325,6 +325,9 @@ bool ANIHandler::ensureScanned() const
}
const auto riffSizeData = device()->read(sizeof(quint32_le));
if (riffSizeData.size() != sizeof(quint32_le)) {
return false;
}
const auto riffSize = *(reinterpret_cast<const quint32_le *>(riffSizeData.data()));
// TODO do a basic sanity check if the size is enough to hold some metadata and a frame?
if (riffSize == 0) {