lighttransport/tinyusdz

[TODO] Rewrite recursive function call with for-loop

Opened this issue · 1 comments

syoyo commented

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)

syoyo commented

The stackoverflow also happens in crate-reader.cc::!BuildDecompressedPathsImpl when input USD scene has too many USD Prims(too deep PathIndex hierarchy)