Guest User

Untitled

a guest
Oct 21st, 2011
96
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. From 4734e275d6644536aec3fe76d5c28a124db68b17 Mon Sep 17 00:00:00 2001
  2. From: Benjamin Franzke <benjaminfranzke@googlemail.com>
  3. Date: Fri, 2 Sep 2011 11:02:38 +0200
  4. Subject: [PATCH] clip: Fix processing-skip of rectangle-intersect
  5.  
  6. Destroy region clip before (eventually) early
  7. skipping processing of intersection.
  8.  
  9. Fixes segfault-on-focus with "zenity --entry".
  10. Bisected to:
  11.   commit 52e3814824235ff236bc013f9adc85ed85eb8fb8
  12.   Author: Chris Wilson <chris@chris-wilson.co.uk>
  13.   Date:   Sun Jul 24 17:31:39 2011 +0100
  14.  
  15.   clip: Skip processing of rectangle-intersection if it wholly subsumes the clip
  16. ---
  17. src/cairo-clip-boxes.c |   13 +++++++------
  18.  1 files changed, 7 insertions(+), 6 deletions(-)
  19.  
  20. diff --git a/src/cairo-clip-boxes.c b/src/cairo-clip-boxes.c
  21. index e18c2f8..ff72f8e 100644
  22. --- a/src/cairo-clip-boxes.c
  23. +++ b/src/cairo-clip-boxes.c
  24. @@ -166,6 +166,13 @@ _cairo_clip_intersect_rectangle_box (cairo_clip_t *clip,
  25.         return _cairo_clip_set_all_clipped (clip);
  26.      }
  27.  
  28. +    if (clip->region) {
  29. +   cairo_region_destroy (clip->region);
  30. +   clip->region = NULL;
  31. +    }
  32. +
  33. +    clip->is_region = FALSE;
  34. +
  35.      if (clip->num_boxes == 0) {
  36.     clip->boxes = &clip->embedded_box;
  37.     clip->boxes[0] = *box;
  38. @@ -242,12 +249,6 @@ _cairo_clip_intersect_rectangle_box (cairo_clip_t *clip,
  39.         return _cairo_clip_set_all_clipped (clip);
  40.      }
  41.  
  42. -    if (clip->region) {
  43. -   cairo_region_destroy (clip->region);
  44. -   clip->region = NULL;
  45. -    }
  46. -
  47. -    clip->is_region = FALSE;
  48.      return clip;
  49.  }
  50.  
  51. --
  52. 1.7.3.4
  53.  
  54.  
RAW Paste Data