Implement overflow check in Q3DLoader (#6417)
* Implement overflow check in Q3DLoader
This commit is contained in:
@@ -379,7 +379,12 @@ void Q3DImporter::InternReadFile(const std::string &pFile,
|
||||
light->mColorSpecular = light->mColorDiffuse;
|
||||
|
||||
// We don't need the rest, but we need to know where this chunk ends.
|
||||
unsigned int temp = (unsigned int)(stream.GetI4() * stream.GetI4());
|
||||
const auto t1 = stream.GetI4();
|
||||
const auto t2 = stream.GetI4();
|
||||
if (t1 < 0 || t2 < 0) {
|
||||
throw DeadlyImportError("Quick3D: Overflow detected.");
|
||||
}
|
||||
const unsigned int temp = static_cast<unsigned int>(t1*t2);
|
||||
|
||||
// skip the background file name
|
||||
while (stream.GetI1())
|
||||
|
||||
Reference in New Issue
Block a user