Fix misleading error message

Avoids a confusing "Must have 4 bytes or more bytes, but got 4."
error.
This commit is contained in:
Nyall Dawson 2023-08-24 11:47:23 +10:00
parent 0eaa23fbfc
commit 8e9aadf569
No known key found for this signature in database
GPG Key ID: D853AA00D2F6AFD0

View File

@ -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;