svg_loader: Fix invaild '<' nested check 39/289339/1
authorJunsuChoi <jsuya.choi@samsung.com>
Wed, 4 May 2022 01:23:20 +0000 (10:23 +0900)
committerMichal Szczecinski <mihashco89@gmail.com>
Mon, 6 Mar 2023 10:02:16 +0000 (11:02 +0100)
When Type is DOCTYPE, Child Entities start with '<'.
This condition is valid when general Elements (svg, g, path etc) are used.
Add a Doctype check to if condition.
(There can be various cases related to '<' nested case.
But for now, I only add Doctype considering the side effect.)

Change-Id: I205a900ac4765d6017f6ddc68c52907e932ce333

src/loaders/svg/tvgXmlParser.cpp

index a12689c..cee97af 100644 (file)
@@ -388,7 +388,7 @@ bool simpleXmlParse(const char* buf, unsigned bufLength, bool strip, simpleXMLCb
 
             if (p) {
                 //Invalid case: '<' nested
-                if (*p == '<') return false;
+                if (*p == '<' && type != SimpleXMLType::Doctype) return false;
                 const char *start, *end;
 
                 start = itr + 1 + toff;