mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 01:39:02 +08:00
Fix memory corruption in svg parsing
This commit is contained in:
parent
4148d7332e
commit
7cf893fe81
@ -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
|
// Don't want to use dirty casts for the buffer to be usable in
|
||||||
// the NanoSVGParser until performance is not a bottleneck here.
|
// 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));
|
std::copy(entry.buf.begin(), entry.buf.end(), std::back_inserter(svgtxt));
|
||||||
|
svgtxt.emplace_back('\0');
|
||||||
NanoSVGParser svgp(svgtxt.data());
|
NanoSVGParser svgp(svgtxt.data());
|
||||||
|
|
||||||
Polygons polys;
|
Polygons polys;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user