Fix memory corruption in svg parsing
This commit is contained in:
parent
4148d7332e
commit
7cf893fe81
1 changed files with 2 additions and 1 deletions
|
@ -278,8 +278,9 @@ ConfigSubstitutions SL1_SVGReader::read(std::vector<ExPolygons> &slices,
|
|||
|
||||
// Don't want to use dirty casts for the buffer to be usable in
|
||||
// the NanoSVGParser until performance is not a bottleneck here.
|
||||
auto svgtxt = reserve_vector<char>(entry.buf.size());
|
||||
auto svgtxt = reserve_vector<char>(entry.buf.size() + 1);
|
||||
std::copy(entry.buf.begin(), entry.buf.end(), std::back_inserter(svgtxt));
|
||||
svgtxt.emplace_back('\0');
|
||||
NanoSVGParser svgp(svgtxt.data());
|
||||
|
||||
Polygons polys;
|
||||
|
|
Loading…
Reference in a new issue