Closed attitudechunfeng closed 4 years ago
Thank you for your comment.
It seems that there are two solutions. One is adding the safeguard as you pointed out, and the other is adding the other protection in the lowest F0. Since the noise size is roughly determined as 1 / F0, this safeguard would be useful to solve this problem.
I think that both ideas provide the same result, and your plan is more straightforward. noise_size=tmp-current_location. -> noise_size = MyMinInt(synth->fft_size, tmp - current_location);
Thanks for your reply. As the problem is located, I close this issue
@mmorise I thought i find an outbound bug in the file synthesisrealtime.cpp,when i tested the library on an mobile platform. It may not cause crash on some usual platforms even it exactly out of bound, so it's hard to find it. Please refer the code in line 585: noise_size=tmp-current_location. According to your codes, i think noise_size shouldn't be larger than fft_size,so i added an upper bound to noise_size,and everything is normal. Please make sure if there's any better solutions.