[cairo-commit] 2 commits - src/cairo-xcb-surface-render.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 25 14:43:16 UTC 2020


 src/cairo-xcb-surface-render.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit c7b6c073ea0e8cac32c4a34f99ffd502096f19a1
Merge: 78266cc8c eb75ce086
Author: Uli Schlachter <psychon at znc.in>
Date:   Fri Dec 25 14:43:14 2020 +0000

    Merge branch 'xcb-fix-clip-leak' into 'master'
    
    Fix a leak in cairo-xcb's render compositor
    
    Closes #24
    
    See merge request cairo/cairo!83

commit eb75ce0861b2f3dc753b8fa5653afc2f99948f0b
Author: Uli Schlachter <psychon at znc.in>
Date:   Sat Dec 5 08:15:34 2020 +0100

    Fix a leak in cairo-xcb's render compositor
    
    The code here temporary replaces extents->clip with another clip to call
    a function. Afterwards, it restores the previous copy. The temporary
    clip is only freed when it still is pointed to by extents->clip.
    
    This logic is wrong. It is indeed possible that the clip is simplified
    and changes. In this case, the original clip is also correctly freed.
    However, this still means that we have to clean up and destroy the new
    clip. The previous code just leaked it.
    
    This was originally identified by Massimo in [1]. I am just committing
    his patch.
    
    [1]: https://bugs.freedesktop.org/show_bug.cgi?id=91267
    
    Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/24
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c
index 42f27c71f..e0569d860 100644
--- a/src/cairo-xcb-surface-render.c
+++ b/src/cairo-xcb-surface-render.c
@@ -3144,8 +3144,7 @@ _clip_and_composite_boxes (cairo_xcb_surface_t *dst,
 					 antialias,
 					 fill_rule,
 					 extents);
-	    if (extents->clip != clip)
-		clip = NULL;
+	    clip = extents->clip;
 	    extents->clip = saved_clip;
 	    _cairo_polygon_fini (&polygon);
 	}


More information about the cairo-commit mailing list