The values in the env_length array are used as divisors, so if they are allowed a range down to 0 the divisions will result in NaN, which propagates through env_vol all the way to ssample, which is the output. This change might remove some minimal amount of "snap" from the sound, but that would in many cases be the sound of some component not liking NaNs.
This should at least partly fix #1877. I'm not saying SFXR doesn't include other calculations that might lead to NaN.
SFXR: Avoid NaNs by making envelope length minimum 1 sample, it is us…
…ed as a divisor.
Fix out of bounds array access
Make the changes closer to the coding standard [skip ci]
Since this is a bugfix for a bug that I assume also exists in 1.1, it might be a good idea to rebase this for the stable-1.1 branch?