boostorg / boostorg/polygon

segfault in polygon_set_data<int>::get

Open
#36 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
70
Forks
75
PR merge metrics
No merged PRs in 30d

Description

The following program crashes with a segmentation fault inside the `get()` call. I've tested against `1.65`, `1.72`, and current `master`. I'm pretty sure that this usage falls inside the API contract, but perhaps I'm missing something?

```c++
#include

int main(int argc, char **argv) {
const boost::polygon::point_data triangles[][3] = {
{{-7273739,1362950}, {-7273144,1362356}, {-3077455,-2833333}},
{{-490017,-3840545}, {-2888380,-1442182}, {-6168936,1838374}},
{{-3078718,-2832071}, {-3078274,-2832514}, {-2288161,-2042401}},
};

boost::polygon::polygon_set_data polygon_set;
polygon_set.insert(boost::polygon::polygon_data(std::begin(triangles[0]), std::end(triangles[0])));
polygon_set.insert(boost::polygon::polygon_data(std::begin(triangles[1]), std::end(triangles[1])));
polygon_set.insert(boost::polygon::polygon_data(std::begin(triangles[2]), std::end(triangles[2])));

std::vector> output;
polygon_set.get(output);
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.