[metacity] core/boxes.c: fix unchecked values in meta_rectangle_clip_to_region()
- From: Thomas James Alexander Thurman <tthurman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] core/boxes.c: fix unchecked values in meta_rectangle_clip_to_region()
- Date: Thu, 27 Jan 2011 22:10:47 +0000 (UTC)
commit 5132ca4145b0f4f4afd5c4ddad6288bc56716140
Author: Sascha Silbe <sascha-org-sugar-git silbe org>
Date: Wed Sep 23 17:48:27 2009 +0000
core/boxes.c: fix unchecked values in meta_rectangle_clip_to_region()
src/core/boxes.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/core/boxes.c b/src/core/boxes.c
index dda283a..e57663e 100644
--- a/src/core/boxes.c
+++ b/src/core/boxes.c
@@ -907,6 +907,9 @@ meta_rectangle_clip_to_region (const GList *spanning_rects,
const MetaRectangle *best_rect = NULL;
int best_overlap = 0;
+ if (!rect)
+ return;
+
/* First, find best rectangle from spanning_rects to which we will clip
* rect into.
*/
@@ -933,7 +936,8 @@ meta_rectangle_clip_to_region (const GList *spanning_rects,
continue;
/* Determine maximal overlap amount */
- meta_rectangle_intersect (rect, compare_rect, &overlap);
+ if (!meta_rectangle_intersect (rect, compare_rect, &overlap))
+ continue;
maximal_overlap_amount_for_compare = meta_rectangle_area (&overlap);
/* See if this is the best rect so far */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]