The bug was found by ASAN when running the file from #105953. It's not entirely clear what the root issue for the division by zero is, but at least now the result is more predictable. Pull Request: https://projects.blender.org/blender/blender/pulls/106165