Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty polygon triggers seg fault #464

Closed
markghayden opened this issue Mar 25, 2023 · 0 comments · Fixed by #465
Closed

empty polygon triggers seg fault #464

markghayden opened this issue Mar 25, 2023 · 0 comments · Fixed by #465

Comments

@markghayden
Copy link

It seems a set of polygons which ends in an empty polygon triggers a segmentation violation. Please see attached program and output from Valgrind below.

This was tested with Clipper 2 v1.2.0 on Debian Linux.

make -w -k -j8 make: Entering directory '/home/mhayden/plotter/plotter/clipper' g++ -g -O2 -std=c++17 -I/home/mhayden/plotter/toolchain/clipper2/release/linux/Clipper2/include clipper_test.cpp /home/mhayden/plotter/toolchain/clipper2/release/linux/Clipper2/lib/libclipper2.a -o test valgrind ./test ==44300== Memcheck, a memory error detector ==44300== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==44300== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info ==44300== Command: ./test ==44300== len=55 len=48 len=14 len=58 polygons=1 len=25 ==44300== Invalid write of size 8 ==44300== at 0x1102BC: Clipper2Lib::ClipperBase::AddPaths(std::vector<std::vector<Clipper2Lib::Point<long>, std::allocator<Clipper2Lib::Point<long> > >, std::allocator<std::vector<Clipper2Lib::Point<long>, std::allocator<Clipper2Lib::Point<long> > > > > const&, Clipper2Lib::PathType, bool) (clipper.engine.cpp:597) ==44300== by 0x1096FF: AddSubject (clipper.engine.h:446) ==44300== by 0x1096FF: main (clipper_test.cpp:216) ==44300== Address 0x4cb3b70 is 16 bytes after a block of size 7,008 in arena "client" ==44300==
clipper_test.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant