svg_loader SvgLoader: Prevent invalid access
authorJunsuChoi <jsuya.choi@samsung.com>
Tue, 22 Jun 2021 07:15:05 +0000 (16:15 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Thu, 24 Jun 2021 00:26:30 +0000 (09:26 +0900)
If there is no path information, it is not copied.

src/loaders/svg/tvgSvgLoader.cpp

index f660e84..1fd6250 100644 (file)
@@ -1621,7 +1621,7 @@ static void _copyAttr(SvgNode* to, const SvgNode* from)
             break;
         }
         case SvgNodeType::Path: {
-            to->node.path.path = new string(from->node.path.path->c_str());
+            if (from->node.path.path) to->node.path.path = new string(from->node.path.path->c_str());
             break;
         }
         case SvgNodeType::Polygon: {