We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug createAsset crashes when given content that's valid JSON, but invalid GLTF.
createAsset
To Reproduce
Engine* engine = Engine::create(); MaterialProvider* materialProvider = createUbershaderProvider(engine, UBERARCHIVE_DEFAULT_DATA, UBERARCHIVE_DEFAULT_SIZE); ResourceLoader* resourceLoader = new ResourceLoader(ResourceConfiguration{ .engine = engine }); AssetLoader* assetLoader = AssetLoader::create({ engine, materialProvider }); std::string validJsonInvalidGLTF = "{ \"invalid\": \"gltf\" }"; FilamentAsset* asset = assetLoader->createAsset(reinterpret_cast<uint8_t*>(validJsonInvalidGLTF.data()), validJsonInvalidGLTF.size());
With Filament 1.51.8, this program logs "There is no scene in the asset." to console, and then hits an access violation.
Expected behavior Print an error to console, and createAsset should return nullptr without crashing.
Logs Call stack:
filament_test.exe!std::copy_n<filament::gltfio::FFilamentInstance * *,unsigned __int64,filament::gltfio::FilamentInstance * *>(filament::gltfio::FFilamentInstance * * _First, unsigned __int64 _Count_raw, filament::gltfio::FilamentInstance * * _Dest) Line 4217 C++ filament_test.exe!filament::gltfio::FAssetLoader::createInstancedAsset(const unsigned char * bytes, unsigned int byteCount, filament::gltfio::FilamentInstance * * instances, unsigned __int64 numInstances) Line 369 C++ filament_test.exe!filament::gltfio::FAssetLoader::createAsset(const unsigned char * bytes, unsigned int byteCount) Line 315 C++ filament_test.exe!filament::gltfio::AssetLoader::createAsset(const unsigned char * bytes, unsigned int nbytes) Line 1617 C++ filament_test.exe!main(int argc, char * * argv) Line 22 C++
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
gltfio: fix invalid gltf crash
7e23702
Invalid gltf but valid json should not crash but return null for asset. Fixes #7868
278e706
poweifeng
Successfully merging a pull request may close this issue.
Describe the bug
createAsset
crashes when given content that's valid JSON, but invalid GLTF.To Reproduce
With Filament 1.51.8, this program logs "There is no scene in the asset." to console, and then hits an access violation.
Expected behavior
Print an error to console, and
createAsset
should return nullptr without crashing.Logs
Call stack:
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: