Merge branch 'syoyo:release' into release

This commit is contained in:
rhiskey 2023-12-04 16:55:16 +03:00 committed by GitHub
commit 30ec815748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6671,8 +6671,11 @@ bool TinyGLTF::LoadBinaryFromMemory(Model *model, std::string *err,
if (header_and_json_size > sizeof(uint64_t)) { if (header_and_json_size > sizeof(uint64_t)) {
// Do not allow 4GB or more GLB data. // Do not allow 4GB or more GLB data.
if (err) {
(*err) = "Invalid glTF binary. GLB data exceeds 4GB."; (*err) = "Invalid glTF binary. GLB data exceeds 4GB.";
} }
return false;
}
if ((header_and_json_size > uint64_t(size)) || (chunk0_length < 1) || if ((header_and_json_size > uint64_t(size)) || (chunk0_length < 1) ||
(length > size) || (header_and_json_size > uint64_t(length)) || (length > size) || (header_and_json_size > uint64_t(length)) ||
@ -6690,6 +6693,7 @@ bool TinyGLTF::LoadBinaryFromMemory(Model *model, std::string *err,
if (err) { if (err) {
(*err) = "JSON Chunk end does not aligned to a 4-byte boundary."; (*err) = "JSON Chunk end does not aligned to a 4-byte boundary.";
} }
return false;
} }
// std::cout << "header_and_json_size = " << header_and_json_size << "\n"; // std::cout << "header_and_json_size = " << header_and_json_size << "\n";