mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-14 20:56:12 +08:00
Merge pull request #452 from nyalldawson/permissive_align
Relax bin chunk end alignment check in permissive mode
This commit is contained in:
commit
35735bb686
@ -6733,11 +6733,18 @@ bool TinyGLTF::LoadBinaryFromMemory(Model *model, std::string *err,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((chunk1_length % 4) != 0) {
|
if ((chunk1_length % 4) != 0) {
|
||||||
|
if (strictness_==ParseStrictness::Permissive) {
|
||||||
|
if (warn) {
|
||||||
|
(*warn) += "BIN Chunk end is not aligned to a 4-byte boundary.\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
if (err) {
|
if (err) {
|
||||||
(*err) = "BIN Chunk end does not aligned to a 4-byte boundary.";
|
(*err) = "BIN Chunk end is not aligned to a 4-byte boundary.";
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (uint64_t(chunk1_length) + header_and_json_size > uint64_t(length)) {
|
if (uint64_t(chunk1_length) + header_and_json_size > uint64_t(length)) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user