From fd84ceb791a61cfdc1333d2db28c0bb8f64bb095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 16 Aug 2018 21:07:56 +0200 Subject: [PATCH] Properly fail also when external *.bin are missing from *.glb. Consistency with behavior for external *.bin files referenced from *.gltf. --- tiny_gltf.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 633f4b3..e253fce 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -2260,8 +2260,10 @@ static bool ParseBuffer(Buffer *buffer, std::string *err, const json &o, } } else { // External .bin file. - LoadExternalFile(&buffer->data, err, /* warn */ nullptr, buffer->uri, - basedir, bytes, true, fs); + if (!LoadExternalFile(&buffer->data, err, /* warn */ nullptr, buffer->uri, + basedir, bytes, true, fs)) { + return false; + } } } else { // load data from (embedded) binary data