From 5ddfa0515cf70ba47b91ecf8581b3542b0dd492c Mon Sep 17 00:00:00 2001 From: Riyyi Date: Sat, 6 Feb 2021 01:53:59 +0100 Subject: [PATCH] Add gltf json length check --- inferno/src/inferno/io/gltffile.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/inferno/src/inferno/io/gltffile.cpp b/inferno/src/inferno/io/gltffile.cpp index 9e93e05..d8ee479 100644 --- a/inferno/src/inferno/io/gltffile.cpp +++ b/inferno/src/inferno/io/gltffile.cpp @@ -63,6 +63,7 @@ namespace Inferno { // Read JSON data auto jsonChunk = readChunk(glb, header, 0x4e4f534a); + ASSERT(jsonChunk.second >= json, "GlTF file invalid JSON content length '{}'", jsonChunk.second); // Read binary data auto binaryChunk = readChunk(glb, header + size * 2 + jsonChunk.second, 0x004e4942);