mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-13 07:39:06 +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
13
tiny_gltf.h
13
tiny_gltf.h
@ -6733,10 +6733,17 @@ bool TinyGLTF::LoadBinaryFromMemory(Model *model, std::string *err,
|
||||
}
|
||||
|
||||
if ((chunk1_length % 4) != 0) {
|
||||
if (err) {
|
||||
(*err) = "BIN Chunk end does not aligned to a 4-byte boundary.";
|
||||
if (strictness_==ParseStrictness::Permissive) {
|
||||
if (warn) {
|
||||
(*warn) += "BIN Chunk end is not aligned to a 4-byte boundary.\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (err) {
|
||||
(*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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user