mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
common paint: fix invalid memory access in unit test
casting the paint to shape is not allowed if the compositor target is not shape, here it concretely checking the the type before casting....
This commit is contained in:
parent
d520da2db8
commit
b1604e2ec7
1 changed files with 1 additions and 1 deletions
|
@ -206,7 +206,7 @@ void* Paint::Impl::update(RenderMethod& renderer, const RenderTransform* pTransf
|
|||
we can avoid regular ClipPath / AlphaMasking sequence but use viewport for performance */
|
||||
auto tryFastTrack = false;
|
||||
if (cmpMethod == CompositeMethod::ClipPath) tryFastTrack = true;
|
||||
else if (cmpMethod == CompositeMethod::AlphaMask) {
|
||||
else if (cmpMethod == CompositeMethod::AlphaMask && cmpTarget->identifier() == TVG_CLASS_ID_SHAPE) {
|
||||
auto shape = static_cast<Shape*>(cmpTarget);
|
||||
uint8_t a;
|
||||
shape->fillColor(nullptr, nullptr, nullptr, &a);
|
||||
|
|
Loading…
Add table
Reference in a new issue