loader/svg: Fix invalid syntax check

If the key is not parsed and the '=' keyword is located next,
modify it to parse the following syntax.

related issue:
https://github.com/thorvg/thorvg/issues/2116
This commit is contained in:
JunsuChoi 2024-04-04 11:17:16 +09:00 committed by Hermet Park
parent ab49e2ee2b
commit a4ced1963e

View file

@ -314,7 +314,10 @@ bool simpleXmlParseAttributes(const char* buf, unsigned bufLength, simpleXMLAttr
if ((*keyEnd == '=') || (isspace((unsigned char)*keyEnd))) break;
}
if (keyEnd == itrEnd) goto error;
if (keyEnd == key) continue;
if (keyEnd == key) { // There is no key. This case is invalid, but explores the following syntax.
itr = keyEnd + 1;
continue;
}
if (*keyEnd == '=') value = keyEnd + 1;
else {