summaryrefslogtreecommitdiff
path: root/src/cairo-image-surface.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-06-20 14:02:14 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-06-20 14:02:14 +0100
commite079e4e2297810ceb10798cf310a7fafe39b18f0 (patch)
treef922dcdb3e07d069c672ab52531e4c15bf2677c2 /src/cairo-image-surface.c
parentf39eef852491c10dec4089f9fb3d332a712da28c (diff)
downloadcairo-e079e4e2297810ceb10798cf310a7fafe39b18f0.tar.gz
image: Mark the data as owned after stealing the snapshot's image
Victor Goya found that we ended up leaking memory after reading a PNG into an image surface and drawing that onto a PDF surface. In particular, he discovered that commit 0bfd2acd35547fc2bd0de99cc67d153f0170697d Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Aug 13 01:34:12 2012 +0100 xlib: Implement SHM fallbacks and fast upload paths introduced a path to steal the image data for a snapshot (and thereby avoid a redundant copy), but that path then lead to the leak of the "owned" data. Reported-by: Victor Goya <victor.goya@af83.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-image-surface.c')
-rw-r--r--src/cairo-image-surface.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 49f6e189e..98d928f48 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -767,7 +767,7 @@ _cairo_image_surface_snapshot (void *abstract_surface)
clone->transparency = image->transparency;
clone->color = image->color;
- clone->owns_data = FALSE;
+ clone->owns_data = TRUE;
return &clone->base;
}