* svg_loader: allow multiple defs without data and memory leak
If the svg file contained multiple <defs> tags, each subsequent tag
overwritten the previous tag. This resulted in incorrect rendering of the
file and memory leaks.
@Issues: 491
* svg_loader: allow multiple defs without data and memory leak- fix#1
Changed the idea to abandon node creating instead of deleting it after
creation. Removed simpleXmlParseAttributes for _createDefsNode.
Composition can be applied recursively if its children nodes have composition target to this one.
This can be occured by wrong svg description, and tvg prevents this exception case.
@Issue: https://github.com/Samsung/thorvg/issues/494
svg may have 'em' unit for fonts, strtof() must handle this case to not
drop in the infinite loop.
Yet thorvg doesn't support font feature in svg,
it must multiply values with font size if those values have 'em' size.
@Issue: https://github.com/Samsung/thorvg/issues/488
tvg sw_engine tries to skip composition as far as its doable,
it tries composition only if the translucent shape with stroking is there.
There has been a condition bug that composition is applied unnecessarily
even if stroking is disabled. This resulted in broken blending
at gradient filling since it applied alpha values multiple times.
Issues:
https://github.com/Samsung/thorvg/issues/445
After finding no attributes but white spaces, attrs length could be negative
that resulted in segmentation fault in simpleXmlParseAttributes function.
@Issue: #487
../src/loaders/svg/tvgSvgLoader.cpp: In function ‘void _copyAttr(SvgNode*, const SvgNode*)’:
../src/loaders/svg/tvgSvgLoader.cpp:1598:60: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct SvgStyleProperty’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
memcpy(to->style, from->style, sizeof(SvgStyleProperty));
@Issue: 498
The PaintType enum was used to set the paint type in the internal Paint
implementation. This solution is switched to an identifier with id() getter,
so that the information about the type can be reached from outside the Paint.
The ColorStop offset < 0 and > 1 should be treated as 0 and 1 respectively.
The offset value < than the previous offset value should be replaced
by the previous value - without this change segfault occurred.
Validating the APIs parameters values is the user responsibility.
for optimial library, we removed some peripheral information in default,
this breaks asan environment.
This patch changes it to make it both.
if you want to use asan, please change the meson option.
default is disabled.
example)
$meson . build -Db_sanitize=address
$meson . build -Db_sanitize=address,undefined
When copying an attribute, url information of stype's composite is overwritten with memcpy.
This causes double free by deleting the wrong string in freeNodeStyle.