[mutter] MetaRegionIterator: avoid reading off end of rectangles array
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] MetaRegionIterator: avoid reading off end of rectangles array
- Date: Mon, 6 Dec 2010 17:01:00 +0000 (UTC)
commit 3f9c375f1c06787eeeda5c4ddbfce16963c8f421
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Mon Dec 6 11:49:24 2010 -0500
MetaRegionIterator: avoid reading off end of rectangles array
Fix an off-by-one error in the check for "can we peek ahead to the next
rectangle".
https://bugzilla.gnome.org/show_bug.cgi?id=636491
src/compositor/region-utils.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/compositor/region-utils.c b/src/compositor/region-utils.c
index 9cfc393..b4071ca 100644
--- a/src/compositor/region-utils.c
+++ b/src/compositor/region-utils.c
@@ -180,7 +180,7 @@ meta_region_iterator_next (MetaRegionIterator *iter)
iter->rectangle = iter->next_rectangle;
iter->line_start = iter->line_end;
- if (iter->i < iter->n_rectangles)
+ if (iter->i + 1 < iter->n_rectangles)
{
cairo_region_get_rectangle (iter->region, iter->i + 1, &iter->next_rectangle);
iter->line_end = iter->next_rectangle.y != iter->rectangle.y;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]