ifcplusplus
ifcplusplus copied to clipboard
Out of bounds vector in simplifyPolygon
Hello,
in the function simplifyPolygon (the one that takes a vector of vec2) inside GeomUtils.h there are multiple unsafe erase calls : polygon.erase(polygon.begin() + ii - 1); that cause a crash when ii is 0.
Looks like d2b0e9c4f550515acadb26120c2356649351a7ae messed things up
Regards, Antoine
Some changes are already made, so there is only this erase left:
size_t idx1 = ii % polygon.size();
polygon.erase(polygon.begin() + idx1);
polygon.size() is always > 1, so the iterator can never be at the end
This should be solved with previous update