Closed wlinna closed 1 year ago
Found it! I was able to create a small test case. The bug is in serde_json.
let json_str2 = &[ b'"', b'\xCE', b'\xF8', b'"'];
let v2: serde_json::Result<Box<serde_json::value::RawValue>> = serde_json::from_slice(json_str2);
I will report this bug in serde_json's bug tracker.
At least with the recently published 1.0.64, json parsing doesn't panic anymore, just returns a Result::Err
. Though the file works with Three.js, it doesn't work with Blender, and the error is categorized as an error by the gltf validator too. I suppose it's not worth it to try to work around the issue.
if this doesn't panic anymore, then the issue could be closed?
Cargo.toml
of this repo doesn't require 1.0.64
or higher of serde_json
. I'm not sure.. maybe that version should be bumped to make sure that the old version won't be installed?
I have a GLB file that causes a panic when opening. The file works fine on ThreeJS, so I think gltf-rs should be able to handle it as well, or at least fail gracefully.
The GLB file is available here: https://drive.google.com/file/d/1tPjXiUlLO2Drh1hdGnqYg4KTpQVUGDZM/view?usp=sharing
This is how I open it:
let gltf_result = gltf::Gltf::open(gltf_path);
This is how I added gltf-rs to my project:
I'm running this on Windows 10
Here's my backtrace:
Here's the validation log: