From 8e9aadf569c7f9905bec53254d60da88b4abac75 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Thu, 24 Aug 2023 11:47:23 +1000 Subject: [PATCH] Fix misleading error message Avoids a confusing "Must have 4 bytes or more bytes, but got 4." error. --- tiny_gltf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 4aaa17c..65c19ee 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -6644,8 +6644,8 @@ bool TinyGLTF::LoadBinaryFromMemory(Model *model, std::string *err, if (err) { (*err) = "Insufficient storage space for Chunk1(BIN data). At least Chunk1 " - "Must have 4 bytes or more bytes, but got " + - std::to_string((header_and_json_size + 12ull) - uint64_t(length)) + + "Must have 4 or more bytes, but got " + + std::to_string((header_and_json_size + 8ull) - uint64_t(length)) + ".\n"; } return false;