Files
test2/source
Jacques Lucke 8182f684be Fix #127054: crash due to integer overflow in Resample Curves node
This adds a variant of `accumulate_counts_to_offsets` which checks for
overflows. The hot loop stays essentially the same, it just uses a `int64_t`
instead of `int` for the counter now. For now the error state is returned by
using an `std::optional`. Alternatives could be to throw `std::overflow_error`
or to use some Result/Expected type in the future.

Obviously, there are more places that should handle this kind of error. It's
also not obvious how to propagate that error further up yet so that we can
display e.g. a warning in the node. That decision should be applicable to other
nodes too. For now, there is no warning on the node.

Pull Request: https://projects.blender.org/blender/blender/pulls/127184
2024-09-11 16:12:47 +02:00
..