mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-07-18 20:04:16 -04:00
ani: Make sure riffSizeData is of the correct size before doing the quint32_le cast dance
oss-fuzz/29290
This commit is contained in:
@ -325,6 +325,9 @@ bool ANIHandler::ensureScanned() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto riffSizeData = device()->read(sizeof(quint32_le));
|
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()));
|
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?
|
// TODO do a basic sanity check if the size is enough to hold some metadata and a frame?
|
||||||
if (riffSize == 0) {
|
if (riffSize == 0) {
|
||||||
|
Reference in New Issue
Block a user