mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-02 17:48:01 +02:00
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 0bfd2acd35
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>
This commit is contained in:
parent
f39eef8524
commit
e079e4e229
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue