tinyusdz
tinyusdz copied to clipboard
[TODO] Rewrite recursive function call with for-loop
There are some recursive function call in TinyUSDZ, for example:
https://github.com/syoyo/tinyusdz/blob/b158c289c964c9b107dc7530fbf45f3db4387d88/src/usdc-reader.cc#L1339
To avoid potential stack overflow, rewrite it to for-loop (For security, for running TinyUSDZ on embedded(wasm) environment)
The stackoverflow also happens in crate-reader.cc::!BuildDecompressedPathsImpl
when input USD scene has too many USD Prims(too deep PathIndex hierarchy)