Skip to content

Commit

Permalink
Fix misleading error message
Browse files Browse the repository at this point in the history
Avoids a confusing "Must have 4 bytes or more bytes, but got 4."
error.
  • Loading branch information
nyalldawson committed Aug 24, 2023
1 parent 0eaa23f commit 8e9aadf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tiny_gltf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8e9aadf

Please sign in to comment.