When the datas are copied with deep copy, memory issue caused (SEGV on unknown address) due to these reasons:
1. `mimeType` is nullptr when it's not embedded(base64) data
2. datas(b64Data, mimeType) should not be clear, it's used for next slot copy in same pair.
If the svg contained an unsupported element with <stop> elements,
they were incorrectly assigned to the last loaded gradient. Now fixed.
@Issue: https://github.com/thorvg/thorvg/issues/3321
In member function ‘constexpr LottieGenericProperty<LottieScalarFrame<float>, float>& LottieGenericProperty<LottieScalarFrame<float>, float>::ope> inlined from ‘LottieFloat& LottieStroke::dashValue()’ at ../src/loaders/lottie/tvgLottieModel.h:60:104,
inlined from ‘void LottieParser::parseStrokeDash(LottieStroke*)’ at ../src/loaders/lottie/tvgLottieParser.cpp:623:82:
../src/loaders/lottie/tvgLottieProperty.h:297:8: warning: ‘<anonymous>.LottieGenericProperty<LottieScalarFrame<float>, float>::value’ may be used> 297 | struct LottieGenericProperty : LottieProperty
| ^~~~~~~~~~~~~~~~~~~~~
../src/loaders/lottie/tvgLottieModel.h: In member function ‘void LottieParser::parseStrokeDash(LottieStroke*)’:
../src/loaders/lottie/tvgLottieModel.h:60:104: note: ‘<anonymous>’ declared here
60 | for (uint8_t i = 0; i < dashattr->size; ++i) newValues[i] = LottieFloat(dashattr->values[i]);
|
Generating the outline may return false, e.g., if the shape
is completely trimmed. If such a shape was used as a clip,
an attempt to generate 'rle' will still be made. In such a case,
a crash will occur because the outline is nullptr.
While dashing, changing the path command each time caused
a new 'move to' command to be added, even when dash segments
across different path commands should have been connected.
@Issue: https://github.com/thorvg/thorvg/issues/3231
A JavaScript code line may return undefined, but this should not be treated as an error.
For example, consider the following two lines of code:
- `var $bm_rt = 30` (Statement) → result: `undefined`
- `$bm_rt = 30` (Expression) → result: `30`
Both lines execute the same operation, but the JavaScript interpreter (REPL JS) evaluates them differently.
Therefore, an evaluation result of undefined should not be blocked, as it does not indicate a failed code execution.
Before the C++ compiler couldn't decide the template of std::min (that happen if `int` type is not an `int32_t`), so explicitly changing all types to int32_t fixes this.
In cases where the fill was changed while the stroke existed
but remained unchanged, the stroke would disappear because it
was being reset during the shape preparing (shapeReset).
Fixed by disabling the reset of stroke rle from shape reseting.
Also the shape should be prepared not only when the RenderUpdateFlag
is set to Color, but also when it is set to Gradient.
@Issue: https://github.com/thorvg/thorvg/issues/3237
Until now lottie loader supported only a single
dash-gap pair, and only the case where only the dash
was provided was handled correctly. When both values
were provided, the gap was incorrectly increased by
the dash value. If more values were supplied, only
the last pair was considered.
@Issue: https://github.com/thorvg/thorvg/issues/3191
Dodge d / (1 - s):
- handle d = 0 first to avoid 0/0 when s = 1
- for d != 0 and s = 1, the formula results in d/0 (infinity),
which maps to 1 in the 0-1 range (or 255 in the 0-255 range)
Burn 1 - (1 - d) / s:
- handle d = 1 first to avoid 0/0 when s = 0
- for d != 1 and s = 0, the formula results in 1 - 0/0 -> 1 - inf = -inf
Negative infinity in the 0-1 range corresponds to the minimum possible
value, which is 0 (255 if we operate in 0-255 range).
Unify the common parts of the parsing logic
by applying a strategy pattern,
allowing the behavior to vary based on the effect type.
This helps to reduce the size and improved the parsing safety.
Applied the compromised approach for the gaussian blur
since the effect is a bit burdensome for cpu processing
as animatable effects.
- Optimized performance and quality with negligible observable differences.
- Disabled the border option until specific use cases are identified.
RenderMethod effects methods would have changes:
+ update() //update the effects if any
- prepare() -> region() //update the effect drawing region
- effect() -> render() //draw the effect
Fix heap buffer overflow in texture mapping rasterizer by adding proper
bounds checking for texture coordinates. This prevents accessing memory
outside of the allocated image buffer during texture sampling and
interpolation.
Co-Authored-By: Hermet Park <hermet@lottiefiles.com>
issue: https://github.com/thorvg/thorvg/issues/3102
The text stroke's 'of' property determines whether
the stroke appears above (true) or below (false)
the fill.
Previously, it was incorrectly used to decide whether
the stroke would render.
@Issue: https://github.com/thorvg/thorvg/issues/3126