[cairo-commit] src/cairo-clip-boxes.c

Uli Schlachter psychon at kemper.freedesktop.org
Thu Mar 6 00:52:53 PST 2014


 src/cairo-clip-boxes.c |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit ed175b2a2bebb6def85133257bc11a875d13b0dd
Author: Uli Schlachter <psychon at znc.in>
Date:   Thu Mar 6 09:45:08 2014 +0100

    clip: Fix handling of special all-clipped cairo_clip_t
    
    _cairo_clip_intersect_box() wasn't checking if it was called with the special,
    read-only all-clipped clip and thus could have ended up writing to read-only
    memory.
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=75819
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-clip-boxes.c b/src/cairo-clip-boxes.c
index 352654f..7bcbeb1 100644
--- a/src/cairo-clip-boxes.c
+++ b/src/cairo-clip-boxes.c
@@ -258,6 +258,9 @@ _cairo_clip_intersect_box (cairo_clip_t *clip,
 {
     cairo_rectangle_int_t r;
 
+    if (_cairo_clip_is_all_clipped (clip))
+	return clip;
+
     _cairo_box_round_to_rectangle (box, &r);
     if (r.width == 0 || r.height == 0)
 	return _cairo_clip_set_all_clipped (clip);


More information about the cairo-commit mailing list