Add gltf json length check

This commit is contained in:
Riyyi
2021-02-06 01:53:59 +01:00
parent 1134ce6a43
commit 5ddfa0515c
+1
View File
@@ -63,6 +63,7 @@ namespace Inferno {
// Read JSON data // Read JSON data
auto jsonChunk = readChunk(glb, header, 0x4e4f534a); auto jsonChunk = readChunk(glb, header, 0x4e4f534a);
ASSERT(jsonChunk.second >= json, "GlTF file invalid JSON content length '{}'", jsonChunk.second);
// Read binary data // Read binary data
auto binaryChunk = readChunk(glb, header + size * 2 + jsonChunk.second, 0x004e4942); auto binaryChunk = readChunk(glb, header + size * 2 + jsonChunk.second, 0x004e4942);