|
@@ -642,8 +642,7 @@ void ParseVectorDataArray(std::vector<aiVector3D>& out, const Element& el)
|
|
|
|
|
|
ai_assert(data == end);
|
|
ai_assert(data == end);
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * (type == 'd' ? 8 : 4);
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * (type == 'd' ? 8 : 4);
|
|
- ai_assert(buff.size() == dataToRead);
|
|
|
|
- if (dataToRead > buff.size()) {
|
|
|
|
|
|
+ if (dataToRead != buff.size()) {
|
|
ParseError("Invalid read size (binary)",&el);
|
|
ParseError("Invalid read size (binary)",&el);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -733,8 +732,7 @@ void ParseVectorDataArray(std::vector<aiColor4D>& out, const Element& el)
|
|
|
|
|
|
ai_assert(data == end);
|
|
ai_assert(data == end);
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * (type == 'd' ? 8 : 4);
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * (type == 'd' ? 8 : 4);
|
|
- ai_assert(buff.size() == dataToRead);
|
|
|
|
- if (dataToRead > buff.size()) {
|
|
|
|
|
|
+ if (dataToRead != buff.size()) {
|
|
ParseError("Invalid read size (binary)",&el);
|
|
ParseError("Invalid read size (binary)",&el);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -816,8 +814,7 @@ void ParseVectorDataArray(std::vector<aiVector2D>& out, const Element& el)
|
|
|
|
|
|
ai_assert(data == end);
|
|
ai_assert(data == end);
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * (type == 'd' ? 8 : 4);
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * (type == 'd' ? 8 : 4);
|
|
- ai_assert(buff.size() == dataToRead);
|
|
|
|
- if (dataToRead > buff.size()) {
|
|
|
|
|
|
+ if (dataToRead != buff.size()) {
|
|
ParseError("Invalid read size (binary)",&el);
|
|
ParseError("Invalid read size (binary)",&el);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -892,8 +889,7 @@ void ParseVectorDataArray(std::vector<int>& out, const Element& el)
|
|
|
|
|
|
ai_assert(data == end);
|
|
ai_assert(data == end);
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * 4;
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * 4;
|
|
- ai_assert(buff.size() == dataToRead);
|
|
|
|
- if (dataToRead > buff.size()) {
|
|
|
|
|
|
+ if (dataToRead != buff.size()) {
|
|
ParseError("Invalid read size (binary)",&el);
|
|
ParseError("Invalid read size (binary)",&el);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -954,8 +950,7 @@ void ParseVectorDataArray(std::vector<float>& out, const Element& el)
|
|
|
|
|
|
ai_assert(data == end);
|
|
ai_assert(data == end);
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * (type == 'd' ? 8 : 4);
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * (type == 'd' ? 8 : 4);
|
|
- ai_assert(buff.size() == dataToRead);
|
|
|
|
- if (dataToRead > buff.size()) {
|
|
|
|
|
|
+ if (dataToRead != buff.size()) {
|
|
ParseError("Invalid read size (binary)",&el);
|
|
ParseError("Invalid read size (binary)",&el);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1019,8 +1014,7 @@ void ParseVectorDataArray(std::vector<unsigned int>& out, const Element& el)
|
|
|
|
|
|
ai_assert(data == end);
|
|
ai_assert(data == end);
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * 4;
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * 4;
|
|
- ai_assert(buff.size() == dataToRead);
|
|
|
|
- if (dataToRead > buff.size()) {
|
|
|
|
|
|
+ if (dataToRead != buff.size()) {
|
|
ParseError("Invalid read size (binary)",&el);
|
|
ParseError("Invalid read size (binary)",&el);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1088,8 +1082,7 @@ void ParseVectorDataArray(std::vector<uint64_t>& out, const Element& el)
|
|
|
|
|
|
ai_assert(data == end);
|
|
ai_assert(data == end);
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * 8;
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * 8;
|
|
- ai_assert(buff.size() == dataToRead);
|
|
|
|
- if (dataToRead > buff.size()) {
|
|
|
|
|
|
+ if (dataToRead != buff.size()) {
|
|
ParseError("Invalid read size (binary)",&el);
|
|
ParseError("Invalid read size (binary)",&el);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1150,8 +1143,7 @@ void ParseVectorDataArray(std::vector<int64_t>& out, const Element& el)
|
|
|
|
|
|
ai_assert(data == end);
|
|
ai_assert(data == end);
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * 8;
|
|
uint64_t dataToRead = static_cast<uint64_t>(count) * 8;
|
|
- ai_assert(buff.size() == dataToRead);
|
|
|
|
- if (dataToRead > buff.size()) {
|
|
|
|
|
|
+ if (dataToRead != buff.size()) {
|
|
ParseError("Invalid read size (binary)",&el);
|
|
ParseError("Invalid read size (binary)",&el);
|
|
}
|
|
}
|
|
|
|
|