Closed ivxiv closed 2 years ago
FYI: Now skinned mesh sampling is officially supported, so I'd recommend using it instead of Smrvfx for better performance, stability and technical support.
https://docs.unity3d.com/Packages/com.unity.visualeffectgraph@12.0/manual/Operator-SampleMesh.html
I'm closing this issue as I changed the main aim of this repository to provide an example of the built-in mesh sampling feature. This issue doesn't reproduce with the built-in one.
Hello, I discovered a buffer overrun scenario in SamplePointGenerator.Execute(). The issue is that the code can attempt to write past the end of the Output[] array by 1 in certain cases, as a result of accumulated numerical error.
Our repro case is use of a SkinnedMeshBaker component with 1 source and a Point Count of 65536
Accumulated numerical error causes SamplePointGenerator.Execute() to attempt to write to Output[65536] - which is out of bounds by 1.
When this occurs, the problem will initially manifest itself as a crash in the UnityPlayer (if running a standalone build) with a call stack that looks like this (on WIndows):
If running in the Editor, the problem manifests as an IndexOutOfRangeException that looks like this:
With Burst Compilation disabled (as instructed by the original error message), running again in the Editor we get:
To work around the issue, I made the following local code change to SamplePointGenerator.Execute():