2 commits - src/cairo-clip.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 14 13:01:49 UTC 2025


 src/cairo-clip.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 2f21b3874cb76266d1a45216b5f9179d0d4fe588
Merge: 55cb75c4d 1d3347a69
Author: Uli Schlachter <psychon at znc.in>
Date:   Mon Jul 14 13:01:46 2025 +0000

    Merge branch 'fix-clipping-crash' into 'master'
    
    Fix a crash in the clipping code
    
    See merge request cairo/cairo!622

commit 1d3347a6904fd4d9a57e4a5e4819de885fce6e46
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Thu May 22 14:33:54 2025 -0400

    Fix a crash in the clipping code
    
    When cairo_is_all_clipped return true, we must not attempt
    to change any of the clip fields, since it is pointing to
    the static const __cairo_clip_all.
    
    Moving the check for ->region into the 'if' is fine, since
    it will always be NULL for _cairo_clip_all.
    
    This was causing a crash in inkscape, see
    https://gitlab.com/inkscape/inkscape/-/issues/5631

diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index 0822ea908..870a86c26 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -337,13 +337,13 @@ _cairo_clip_intersect_clip (cairo_clip_t *clip,
 	    else
 		clip = _cairo_clip_intersect_clip_path (clip, other->path);
 	}
-    }
 
-    if (clip->region) {
-	cairo_region_destroy (clip->region);
-	clip->region = NULL;
+        if (clip->region) {
+	    cairo_region_destroy (clip->region);
+	    clip->region = NULL;
+        }
+        clip->is_region = FALSE;
     }
-    clip->is_region = FALSE;
 
     return clip;
 }


More information about the cairo-commit mailing list