delaunator-cpp
delaunator-cpp copied to clipboard
Unsigned integer overflow detected by AddressSanitizer
when compiling with -fsanitize=address,undefined,integer
$ make test
/home/travis/build/delfrrr/delaunator-cpp/include/delaunator.hpp:412:34: runtime error: unsigned integer overflow: 18446744073709551615 + 2 cannot be represented in type 'unsigned long'
I assume this is from the fact that I selected the std::numeric_limits<std::size_t>::max() to be our magic value for indexes that are not yet assigned. Therefore, at some point we are calling legalize() and it is selecting a half_edge that has this index value preset. There likely needs to be a check to prevent this from occurring here.