mirror of
https://github.com/lubosz/overte.git
synced 2025-04-17 00:57:44 +02:00
Do sanity checks on data length in readBinaryArray in FBXSerializer_Node.cpp
This commit is contained in:
parent
c1ee4deb12
commit
8a799967d1
1 changed files with 6 additions and 0 deletions
|
@ -41,8 +41,14 @@ QVariant readBinaryArray(QDataStream& in, int& position) {
|
|||
quint32 compressedLength;
|
||||
|
||||
in >> arrayLength;
|
||||
if (arrayLength > std::numeric_limits<int>::max() / sizeof(T)) { // Upcoming byte containers are limited to max signed int
|
||||
throw QString("FBX file most likely corrupt: binary data exceeds data limits");
|
||||
}
|
||||
in >> encoding;
|
||||
in >> compressedLength;
|
||||
if (compressedLength > std::numeric_limits<int>::max() / sizeof(T)) { // Upcoming byte containers are limited to max signed int
|
||||
throw QString("FBX file most likely corrupt: compressed binary data exceeds data limits");
|
||||
}
|
||||
position += sizeof(quint32) * 3;
|
||||
|
||||
QVector<T> values;
|
||||
|
|
Loading…
Reference in a new issue