The code below has to handle the case when `sample_length` is greater or equal to the total length already anyway, so we can just make that a valid input. Currently, the snake hook brush for curves also makes use of passing in larger sample lengths which current results in crashes in debug builds.