mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 17:00:36 +02:00
don't put arbitrarily large array on stack
This commit is contained in:
parent
2d4a95c634
commit
1e50d94384
1 changed files with 2 additions and 1 deletions
|
@ -2053,12 +2053,13 @@ bool Octree::readSVOFromStream(unsigned long streamLength, QDataStream& inputStr
|
|||
}
|
||||
|
||||
bool Octree::readJSONFromStream(unsigned long streamLength, QDataStream& inputStream) {
|
||||
char rawData[streamLength];
|
||||
char *rawData = new char[streamLength];
|
||||
inputStream.readRawData(rawData, streamLength);
|
||||
QJsonDocument d = QJsonDocument::fromJson(rawData);
|
||||
QVariant v = d.toVariant();
|
||||
QVariantMap m = v.toMap();
|
||||
readFromMap(m);
|
||||
delete rawData;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue