renderer: hotfix a null memory copy

This commit is contained in:
Hermet Park 2025-01-30 21:08:54 +09:00
parent 173edf62a1
commit 782f067b22
2 changed files with 1 additions and 1 deletions

View file

@ -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.