pool.glb.zip
When loading this GLB file, a crash occurred. After investigation, I found that there’s a pointer in this file that isn’t properly checked for validity.
filament/libs/gltfio/src/ResourceLoader.cpp
std::pair<Texture*, CacheResult> ResourceLoader::Impl::getOrCreateTexture(FFilamentAsset* asset, size_t textureIndex, TextureProvider::TextureFlags flags) { const cgltf_texture& srcTexture = asset->mSourceAsset->hierarchy->textures[textureIndex]; const cgltf_image* image = srcTexture.basisu_image ? srcTexture.basisu_image : srcTexture.image; const cgltf_buffer_view* bv = image->buffer_view; const char* uri = image->uri;
const cgltf_image* image
The image here might be invalid. After I added a validity check, the crash no longer occurred. However, I’m not sure if this kind of direct check could cause other issues — I’ll leave it to the professionals to evaluate.