From 306c72fce9da705cb89697705ddd7c6317355949 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Sun, 22 Mar 2026 02:50:02 +0900 Subject: [PATCH] Update tests/tester_intensive_customjson.cc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- tests/tester_intensive_customjson.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/tester_intensive_customjson.cc b/tests/tester_intensive_customjson.cc index ad41fbf..44e24e6 100644 --- a/tests/tester_intensive_customjson.cc +++ b/tests/tester_intensive_customjson.cc @@ -680,8 +680,11 @@ TEST_CASE("cj-roundtrip-material", "[customjson][roundtrip]") { /* ===== Section 6: Binary (GLB) loading ==================================== */ TEST_CASE("cj-glb-invalid-magic", "[customjson][glb]") { - // GLB header: magic (4), version (4), length (4) = 12 bytes - // Wrong magic number + // GLB file header fields: magic (4), version (4), length (4) = 12 bytes. + // TinyGLTF::LoadBinaryFromMemory, however, requires at least 20 bytes + // (12-byte file header + 8-byte first chunk header) before checking magic/version. + // This buffer is only 12 bytes long (and uses a wrong magic), so the loader + // will reject it as an undersized/invalid GLB binary. unsigned char data[12] = {0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00}; tinygltf::Model model;