mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
lottie: Fix invalid font match
When Lottie has similar font names, it incorrectly matches fonts due to a logic bug. This error causes an infinite loop when searching for glyphs.
This commit is contained in:
parent
91187cd963
commit
97a1aa136a
1 changed files with 1 additions and 1 deletions
|
@ -1306,7 +1306,7 @@ static void _attachFont(LottieComposition* comp, LottieLayer* parent)
|
||||||
for (uint32_t i = 0; i < comp->fonts.count; ++i) {
|
for (uint32_t i = 0; i < comp->fonts.count; ++i) {
|
||||||
auto font = comp->fonts[i];
|
auto font = comp->fonts[i];
|
||||||
auto len2 = strlen(font->name);
|
auto len2 = strlen(font->name);
|
||||||
if (!strncmp(font->name, doc.name, len < len2 ? len : len2)) {
|
if (len == len2 && !strcmp(font->name, doc.name)) {
|
||||||
text->font = font;
|
text->font = font;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue