diff --git a/src/renderer/tvgFill.h b/src/renderer/tvgFill.h index f249356a..83f2a3a4 100644 --- a/src/renderer/tvgFill.h +++ b/src/renderer/tvgFill.h @@ -76,7 +76,7 @@ struct Fill::Impl ret->pImpl->cnt = cnt; ret->pImpl->spread = spread; ret->pImpl->colorStops = static_cast(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) { ret->pImpl->transform = static_cast(malloc(sizeof(Matrix))); *ret->pImpl->transform = *transform; diff --git a/test/resources/tag.tvg b/test/resources/tag.tvg index cbe550cd..c360da37 100644 Binary files a/test/resources/tag.tvg and b/test/resources/tag.tvg differ