diff --git a/gtk/gtkgridview.c b/gtk/gtkgridview.c index c2a4abe9d2..869f4be206 100644 --- a/gtk/gtkgridview.c +++ b/gtk/gtkgridview.c @@ -441,6 +441,7 @@ gtk_grid_view_get_position_from_allocation (GtkListBase *base, return FALSE; n_items = gtk_list_base_get_n_items (base); + along = CLAMP (along, 0, gtk_grid_view_compute_total_height (self) - 1); if (!gtk_grid_view_get_cell_at_y (self, along, &pos,