svg_loader: ++robustness

prevent a crash with an exceptional handling.

@Issue: https://github.com/Samsung/thorvg/issues/1131
This commit is contained in:
Hermet Park 2022-01-06 12:40:52 +09:00 committed by Hermet Park
parent 440cc81b4d
commit 1f5b66c256

View file

@ -540,7 +540,7 @@ static void _toColor(const char* str, uint8_t* r, uint8_t* g, uint8_t* b, char**
}
}
}
} else if (len >= 3 && !strncmp(str, "url", 3)) {
} else if (ref && len >= 3 && !strncmp(str, "url", 3)) {
*ref = _idFromUrl((const char*)(str + 3));
} else {
//Handle named color