mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-14 23:45:56 +08:00
Fix check for invalid glTF to consider invalid length/model_length combinations.
This commit is contained in:
parent
e886247329
commit
cf668683f9
@ -5618,6 +5618,7 @@ bool TinyGLTF::LoadBinaryFromMemory(Model *model, std::string *err,
|
|||||||
// JSON contents,
|
// JSON contents,
|
||||||
// so use "greater than" operator.
|
// so use "greater than" operator.
|
||||||
if ((20 + model_length > size) || (model_length < 1) || (length > size) ||
|
if ((20 + model_length > size) || (model_length < 1) || (length > size) ||
|
||||||
|
(20 + model_length > length) ||
|
||||||
(model_format != 0x4E4F534A)) { // 0x4E4F534A = JSON format.
|
(model_format != 0x4E4F534A)) { // 0x4E4F534A = JSON format.
|
||||||
if (err) {
|
if (err) {
|
||||||
(*err) = "Invalid glTF binary.";
|
(*err) = "Invalid glTF binary.";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user