svg_loader: multiple composition memory leak

Multiple composition are still not supported, but this patch fixes a
memory leak if it is tried to be applied.
This commit is contained in:
Michal Maciola 2021-07-01 11:29:22 +02:00 committed by Hermet Park
parent 6a09a8f015
commit 99263d54d1

View file

@ -869,7 +869,11 @@ static void _handleClipPathAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node,
#endif
style->comp.method = CompositeMethod::ClipPath;
int len = strlen(value);
if (len >= 3 && !strncmp(value, "url", 3)) style->comp.url = _idFromUrl((const char*)(value + 3));
if (len >= 3 && !strncmp(value, "url", 3)) {
//FIXME: Support multiple composition.
if (style->comp.url) delete(style->comp.url);
style->comp.url = _idFromUrl((const char*)(value + 3));
}
}