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
This commit is contained in:
Owen W. Taylor 2010-12-06 11:49:24 -05:00
parent 544c8edd9e
commit 3f9c375f1c

View File

@ -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;