From 1c6f6efafcf10f8a2981a1316253e16a5a2ed546 Mon Sep 17 00:00:00 2001 From: rhiskey <35545041+rhiskey@users.noreply.github.com> Date: Mon, 4 Dec 2023 14:21:06 +0300 Subject: [PATCH] Update tiny_gltf.h Fix max size of `header_and_json_size` limit. In case of 4GB will check ` sizeof(uint64_t)` insted deprecated max --- tiny_gltf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 5f64f17..c8c329e 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -6669,7 +6669,7 @@ bool TinyGLTF::LoadBinaryFromMemory(Model *model, std::string *err, // Use 64bit uint to avoid integer overflow. uint64_t header_and_json_size = 20ull + uint64_t(chunk0_length); - if (header_and_json_size > std::numeric_limits::max()) { + if (header_and_json_size > sizeof(uint64_t)) { // Do not allow 4GB or more GLB data. (*err) = "Invalid glTF binary. GLB data exceeds 4GB."; }