mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
renderer: hotfix a null memory copy
This commit is contained in:
parent
173edf62a1
commit
782f067b22
2 changed files with 1 additions and 1 deletions
|
@ -76,7 +76,7 @@ struct Fill::Impl
|
||||||
ret->pImpl->cnt = cnt;
|
ret->pImpl->cnt = cnt;
|
||||||
ret->pImpl->spread = spread;
|
ret->pImpl->spread = spread;
|
||||||
ret->pImpl->colorStops = static_cast<ColorStop*>(malloc(sizeof(ColorStop) * cnt));
|
ret->pImpl->colorStops = static_cast<ColorStop*>(malloc(sizeof(ColorStop) * cnt));
|
||||||
memcpy(ret->pImpl->colorStops, colorStops, sizeof(ColorStop) * cnt);
|
if (cnt > 0) memcpy(ret->pImpl->colorStops, colorStops, sizeof(ColorStop) * cnt);
|
||||||
if (transform) {
|
if (transform) {
|
||||||
ret->pImpl->transform = static_cast<Matrix*>(malloc(sizeof(Matrix)));
|
ret->pImpl->transform = static_cast<Matrix*>(malloc(sizeof(Matrix)));
|
||||||
*ret->pImpl->transform = *transform;
|
*ret->pImpl->transform = *transform;
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue