mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-11 23:21:55 +00:00
svg_loader: restoring changes from ed3b17b228
(preventing memcpy from a nullptr)
This commit is contained in:
parent
b535803136
commit
a5e5e48de4
1 changed files with 8 additions and 6 deletions
|
@ -2102,15 +2102,17 @@ static void _copyAttr(SvgNode* to, const SvgNode* from)
|
|||
break;
|
||||
}
|
||||
case SvgNodeType::Polygon: {
|
||||
to->node.polygon.pointsCount = from->node.polygon.pointsCount;
|
||||
if ((to->node.polygon.pointsCount = from->node.polygon.pointsCount)) {
|
||||
to->node.polygon.points = (float*)malloc(to->node.polygon.pointsCount * sizeof(float));
|
||||
memcpy(to->node.polygon.points, from->node.polygon.points, to->node.polygon.pointsCount * sizeof(float));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SvgNodeType::Polyline: {
|
||||
to->node.polyline.pointsCount = from->node.polyline.pointsCount;
|
||||
if ((to->node.polyline.pointsCount = from->node.polyline.pointsCount)) {
|
||||
to->node.polyline.points = (float*)malloc(to->node.polyline.pointsCount * sizeof(float));
|
||||
memcpy(to->node.polyline.points, from->node.polyline.points, to->node.polyline.pointsCount * sizeof(float));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SvgNodeType::Image: {
|
||||
|
|
Loading…
Add table
Reference in a new issue