summaryrefslogtreecommitdiff
path: root/src/cairo-path-fixed.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-09-16 16:11:42 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-09-16 16:11:42 +0100
commit1ce5d4707cf260618bd4d61f39aad4371ffa3336 (patch)
treea4e0844fdbd2d8c3d8c055c143168062da3a0f0a /src/cairo-path-fixed.c
parentf09361cff16776b49e9159c60eea4e8a049865d6 (diff)
path: Skip calls to zero-length memcpy
We attempt to copy 0 points onto the array of path points for a close-path. This is pointless and an unnecessary function call under MSVC at least. Based on a patch by Steve Snyder, incorporating Behdad's review comments. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37836 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-path-fixed.c')
-rw-r--r--src/cairo-path-fixed.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index c257d73b..f4410b35 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -808,6 +808,9 @@ _cairo_path_buf_add_points (cairo_path_buf_t *buf,
const cairo_point_t *points,
int num_points)
{
+ if (buf->num_points == 0)
+ return;
+
memcpy (buf->points + buf->num_points,
points,
sizeof (points[0]) * num_points);